35ac42b3641df.gani
from player2_resident.mtar
. One such motion that when triggered allows moving through the air and walls.
For non-buggy SVG compatibility check out the page in a non-WebKit Chromium/Firefox browser.
Javascript-less users: if graphics are absent your script manager is blocking object
elements, too (used for embedding the SVGs so separate images can be combined together).
This guide covers adding a custom collection of existing human animations (motions) to Metal Gear Solid V: The Phantom Pain, so they can be triggered on-demand via the playable character. The guide can be followed without prior modding experience and also is useful for general reference.
Adding animations like this is mostly for fun currently: making the player pose/animate in new ways from other characters, move through the air, clip through walls, however it can also be of practical use for identifying animation files.
For this version of the guide we'll be using the improved motions features of Infinite Heaven (aka IH), based on unknown321's original research but with some added flexibility.
This version of the guide is based on unknown321's original mod and research and is included as an alternative to the Infinite Heaven (aka IH) version for those running an older version of the game/IH, or who don't use it at all.
Once set-up you'll be able to trigger and switch between animations while playing in free roam/missions, either by Infinite Heaven's menu or via button combos. using button combos.
By default IH already includes the player gestures from Metal Gear Online, such as saluting/pointing/karate/etc. You can try those out right now by opening IH's menu and selecting Motions→Play motion.
As this guide is based on improvements added to IH in version r238 it's only compatible with game versions 1.0.15.2 and higher.
If you're on an older version or don't use IH you can alternatively switch to my guide for unknown321's version using the Version toggle at the top of the page.
By default the mod we're basing this guide on already includes the player gestures from Metal Gear Online, such as saluting/pointing/karate/etc.
The main drawbacks of this mod compared to IH's version are being limited to a single modded motion archive rather than multiple, having a more involved initial installation and lacking a few QoL features. That said, they're both similar functionally.
Contents
- Things needed
- Updating the mod
- Finding the animation files
- Creating a custom motion archive
- Pointing to the new animations
- Usage
- Troubleshooting
- Resources
- Credits
Things needed
Before beginning first grab the template file, which was created to streamline a few steps.
Before beginning first grab unknown321's mod files, which will be the basis for our mod.
Then make sure you have the latest version of the game and the following:
Then make sure you have the following:
It's recommended to unzip the tools to a more permanent directory that has write permissions (eg: C:\Modding\Tools
).
It's generally more foolproof to place the tools in directories that don't contain special characters.
Updating the mod
To ensure compatibility with whatever version of the game you're running (and optionally Infinite Heaven) we'll first update the Snakebite mod package from unknown321's mod files.
It looks like quite a few steps to go through but it's pretty simple, we're only changing a single line in two text files before installing the updated package with Snakebite.
- Locate your install directory of the game. For me that's
G:\Steam\steamapps\common\MGS_TPP
. Within it open themaster
directory, which contains all the game's data files. - Open the
0
sub-directory and you'll see two DAT files. The one we want the00.dat
. Unpack it by dragging it onto GzsTool.exe. You'll see a new unpacked directory named0_dat
. - Open the unpacked directory and within
Assets\tpp\script\lib
copyTpp.lua
andTppMain.lua
somewhere else (eg: the desktop) so you can edit them. These are the files we'll be making minor edits to.
-
Open the copy of
Tpp.lua
in a text editor. Then follow the appropriate expandable steps below, depending on what you have installed.Near the top of the file there's a list of lua script paths that starts with
this.requires
. Add the following line before the closing bracket of that list, then save the file:"/Assets/tpp/script/lib/script_loader.lua",
this.requires={ ... "/Assets/tpp/script/lib/TppMbFreeDemo.lua", "/Assets/tpp/script/lib/script_loader.lua", }
The...
is truncation for brevity.Near the top of the file there's a list of lua script paths that starts with
e.requires
. Add the following line before the closing bracket of that list, then save the file:"/Assets/tpp/script/lib/script_loader.lua",
e.requires={" ... "/Assets/tpp/script/lib/TppMbFreeDemo.lua","/Assets/tpp/script/lib/script_loader.lua"}function e.IsTypeFunc(e)return t(e)=="function"end
Notice thescript_loader.lua
path at the end of the list. The...
is truncation for brevity. -
Open the copy of
TppMain.lua
in a text editor. Then follow the appropriate expandable steps below, depending on what you have installed.Search in the lua for
function this.SetUpdateFunction(missionTable)
and in the secondmoduleUpdateFuncs
add the following line before the closing bracket, then save the file:script_loader.Update,
function this.SetUpdateFunction(missionTable) moduleUpdateFuncs={} ... moduleUpdateFuncs={ ... InfMain.Update,--tex script_loader.Update, }
The...
is truncation for brevity.Search in the lua for
a={TppMission.Update,
. Add the following line before the closing bracket of that list, then save the file:script_loader.Update
a={ ... ,TppMission.UpdateForMissionLoad,script_loader.Update}p=#a
The...
is just truncating the start of the list for brevity.
-
Next we'll add the edited files back into the original Snakebite package.
- Unzip unknown321's mod files. The file we want is
script_loader.mgsv
.You can ignore
script_loader_IH.mgsv
since the only difference are the two lua files we've already edited. - Open
script_loader.mgsv
in a decent zip manager (eg: 7-Zip).Snakebite packages are just zip files with a different file extension.
- Within the zip manager nagivate to
Assets\tpp\script\lib
and replace bothTpp.lua
andTppMain.lua
with the versions we modified in the prior steps.In 7-Zip this can be done by simply dragging and dropping the updated files onto its window.
- Unzip unknown321's mod files. The file we want is
-
Lastly install the updated
script_loader.mgsv
using Snakebite Mod Manager by clicking Mods→Install .MGSV File(s) then navigating to the Snakebite package we just created and following the prompts to install.If you're using Infinite Heaven Snakebite will warn of a conflict with the two lua files but it's fine to continue since we updated the versions of the files it uses.
We won't be installing the
motions.mgsv
from unknown321's files yet since we'll be editing it later.You can also delete the unpacked
0_dat
directory since we no longer need it.
Nice. All prepped for the next section!
If you use Infinite Heaven and want to update it in the future it's pretty easy.
- Uninstall the
script_loader.mgsv
via Snakebite. - Then uninstall IH and install the newer version.
- Repeat the steps in the section above for updating the motions mod (since the two lua files may have changed).
However it's worth pointing out that if you also decide to update the game to the latest version (which is necessary for recent IH builds) then you're better off using IH's improved motions features introduced in r238 and following the IH version of this guide.
Finding the animation files
I'll be waiting for youBuddyQuiet2_heli.mtar
Quiet's animations from the ACC were chosen for the guide since there are a smaller number of them, making it simpler for an initial mod, however the same steps apply for other animations.
What we're after are the GANI (Game Animation) files. These are contained within MTAR (Motion Archive) files, which themselves are contained inside FPK files... found in the game's generic DAT files. Think of them a bit like zips within zips:
DAT → FPK → MTAR → GANI-
Locate your install directory of the game. For me that's
G:\Steam\steamapps\common\MGS_TPP
. Within it open themaster
directory, which contains all the game's data files.Open the game's install directory, then the
master
sub-directory. - The specific data file we want is
chunk1.dat
. Unpack it by dragging it onto GzsTool.exe. You'll see a new unpacked directory namedchunk1_dat
.Be patient as GzsTool can take a while to unpack everything.
- Now we need the FPK within the unpacked DAT directory. Find it in the path below then copy the FPK somewhere else (eg: the desktop).
Assets\tpp\pack\buddy\quiet\buddy_quiet2_heli.fpk
The reason for copying it elsewhere is to avoid too many nested directories in the next step, since Windows has a limit and files can silently fail to unpack otherwise.
- After that unpack the copy of the FPK by dragging it onto GzsTool.exe. You'll see a new unpacked FPK directory named
buddy_quiet2_heli_fpk
. - Within the unpacked FPK directory find the MTAR in the following path. Drag the MTAR file onto MtarTool.exe to unpack its contents.
Assets\tpp\motion\mtar\buddyquiet2\BuddyQuiet2_heli.mtar
You can also delete the unpacked
chunk1_dat
directory since we no longer need it.
Done! With all the above steps completed we now have the GANI files located for the next section.
GANI can be found in a variety of locations within the game's data files. A list of motions that users have already documented with descriptions can be found in the Resources section.
If you're interested in sourcing other animations the easiest place to start is inside chunk0.dat
within Assets\tpp\pack\player\motion
.
There you'll find various FPK files that include MTAR, such as player2_resident_motion.fpk
, containing player2_resident.mtar
, which features hundreds of the player character's default animations: actions like running, CQC, carrying bodies and more.
For a complete list of of MTAR locations download File Monolith, which includes TppMasterFileList.txt
, a giant list all the files in the game.
Keep in mind this file isn't updated regularly so mightn't reflect new changes if hashed paths are discovered in the future (though as of writing it's up-to-date afaict).
Creating a custom motion archive
With the GANI animation files on hand it's time to go about putting them into a custom MTAR, based on the template file downloaded earlier.
A custom motion archive is necessary since the game normally expects animations to only be played in certain contexts and for certain characters but through the magic of modding we can force animations to always be available for the player.
Let's begin!
- Unzip the template file somewhere that's relatively close to the root of the drive (eg: the desktop).
-
Within the template directory navigate to then unpack the following MTAR by dragging it onto MtarTool.exe:
Assets\tpp\pack\mission2\ih\custom_motions_fpk\Assets\tpp\motion\mtar\player2\custom_motions.mtar
20b11e7a7a63c.gani
from BossQuiet2_layers.mtar
-
Open the unpacked MTAR directory and within it open
Assets\tpp
. There create a directory namedBuddyQuiet2_heli
.The above is a suggested directory name but you could alternatively give it a different name and even place it within more custom sub-directories if you wanted (it just has to always begin inside
Assets\tpp
).I've just found it useful and consistent to name it after the MTAR the GANI came from so that's what this guide uses.
Filenames in MGSV are limited to upper/lowercase, numbers and underscores (no spaces)
You'll also notice a
motion
directory already there. It contains a single fulton GANI to keep the template small. See it in action beneath the Credits section. -
Time to use that MTAR we unpacked in the previous section! Open its unpacked directory and copy all the files from it except
BuddyQuiet2_heli.chnk
andBuddyQuiet2_heli.trk
into our newly created directory from step 3 of this section.For future reference animations can be just a
.gani
file, or have additional matching.enchnk
(and occasionally.exchnk
) files. Such matching files need to also be copied if present.
-
In the template directory navigate back up to where the unpacked
custom_motions_mtar
directory and XML file are located and opencustom_motions.mtar.xml
in a text editor.- In the
Entries
section there's a singleGani
entry included by default. Copy and paste it to a new line below it. -
In the copy change the path between the double quotes to one of our newly added GANI, according to the following formatting. Make such an entry for each new GANI we've added. Then save.
<Gani FilePath="/Assets/tpp/BuddyQuiet2_heli/1fcae14e60d2d" />
Only one path per animation is necessary since paths are extensionless (ie: no.gani
/etc is used).Native MGSV files use forward-slashes rather than backslashes for paths and always use a forward-slash before
Assets
.If you're unsure or want to skip ahead check the complete list of example XML entries necessary to add in the expandable section below these steps.
- In the
-
Last step before repacking the MTAR. We just need to add those same paths from the XML to MtarTool's dictionary so it knows what to look for when repacking the MTAR in the next step.
Navigate to MtarTool's program directory and open
mtar_dictionary.txt
in a text editor.-
At the start or end of the text file paste in just the paths by themselves from step 5b, like the example below. Then save.
/Assets/tpp/BuddyQuiet2_heli/1fcae14e60d2d /Assets/tpp/BuddyQuiet2_heli/239e21cf935ce /Assets/tpp/BuddyQuiet2_heli/163ffb1df1550 ...
The...
is truncation for brevity.
-
For future reference adding the entries to MtarTool's dictionary is only necessary if either the motions have hashed filenames or if they were originally non-hashed but have been added to non-original custom directories.
Hashed filenames are easy to spot since when unpacked they look random and aren't in any sub-directories, eg: 1fcae14e60d2d
.
For example, the following is the GANI path of the fulton swaying motion included in the template file, which is non-hashed. Since it was placed in the same directory structure nothing was needed to be added to MtarTool's dictionary.
Assets\tpp\motion\SI_game\fani\bodies\enet\enetnon\enetnon_ful_idl.ganiHowever if the motion were instead added to
Assets\tpp\MyCustomPath
, like the following then it would need to be added to MtarTool's dictionary, otherwise when the custom MTAR is packed the path won't work when referenced in the following section.
Assets\tpp\MyCustomPath\Assets\tpp\motion\SI_game\fani\bodies\enet\enetnon\enetnon_ful_idl.ganiWhen added to MtarTool's dictionary the path would have to be reformatted with forwardslashes instead (including one before
Assets
) and without the .gani
at the end, as per the example excerpt in step 6a.
-
*Whew* We're now ready to repack the MTAR!
Drag the
custom_motions.mtar.xml
onto MtarTool.exe and a newcustom_motions.mtar
will be created.The unpacked
custom_motions_mtar
andcustom_motions.mtar.xml
can now be deleted since we no longer need them. -
Final step is creating a Snakebite mod package and installing it. Open the Snakebite program directory and launch makebite.exe.
- On the right click the
...
button, navigate to the root of the template directory and choose Select Folder. - Included are some default metadata on the left as suggestions. Change as desired.
- On the right click the Build Mod button, select a location for the Snakebite package, then click Save.
-
Close Makebite and open SnakeBite.exe from the same program directory.
Click Mods→Install .MGSV File(s) then navigate to the Snakebite package we just created and follow the prompts to install.
- On the right click the
- Within unknown321's unzipped mod files you'll see the
motions.mgsv
Snakebite package. Unzip it somewhere (eg: the desktop).If you remember from the Updating the mod section such packages are just renamed zip files.
- In the unzipped
motions
directory navigate to the following FPK file and unpack it by dragging it onto GzsTool.exeAssets\tpp\pack\player\motion\player2_resident_motion.fpk
20b11e7a7a63c.gani
from BossQuiet2_layers.mtar
- Within the newly unpacked
player2_resident_motion_fpk
directory navigate to the following MTAR and unpack it by dragging it onto MtarTool.exe.Assets\tpp\motion\mtar\player2\player2_resident.mtar
-
Open the unpacked MTAR directory and within it open
Assets\tpp
. There create a directory namedBuddyQuiet2_heli
.The above is a suggested directory name but you could alternatively give it a different name and even place it within more custom sub-directories if you wanted (it just has to always begin inside
Assets\tpp
).I've just found it useful and consistent to name it after the MTAR the GANI came from so that's what this guide uses.
Filenames in MGSV are limited to upper/lowercase, numbers and underscores (no spaces)
-
Time to use that MTAR we unpacked in the previous section! Open its unpacked directory and copy all the files from it except
BuddyQuiet2_heli.chnk
andBuddyQuiet2_heli.trk
into our newly created directory from step 4 of this section.For future reference animations can be just a
.gani
file, or have additional matching.enchnk
(and occasionally.exchnk
) files. Such matching files need to also be copied if present.
-
Navigate back up to where the unpacked
player2_resident_mtar
directory and XML file are located and openplayer2_resident.mtar.xml
in a text editor.- In the
Entries
section are all the existingGani
entries. Copy one and paste it to a new line. -
In the copy change the path between the double quotes to one of our newly added GANI, according to the following formatting. Make such an entry for each new GANI we've added. Then save.
<Gani FilePath="/Assets/tpp/BuddyQuiet2_heli/1fcae14e60d2d" />
Only one path per animation is necessary since paths are extensionless (ie: no.gani
/etc is used).Native MGSV filesize use forward-slashes rather than backslashes for paths and always use a forward-slash before
Assets
.If you're unsure or want to skip ahead check the complete list of example XML entries necessary to add in the expandable section below these steps.
- In the
-
Last step before repacking the MTAR. We just need to add those same paths from the XML to MtarTool's dictionary so it knows what to look for when repacking the MTAR in the next step.
Navigate to MtarTool's program directory and open
mtar_dictionary.txt
in a text editor.-
At the start or end of the text file paste in just the paths by themselves from step 6b, like the example below. Then save.
/Assets/tpp/BuddyQuiet2_heli/1fcae14e60d2d /Assets/tpp/BuddyQuiet2_heli/239e21cf935ce /Assets/tpp/BuddyQuiet2_heli/163ffb1df1550 ...
The...
is truncation for brevity.
-
For future reference adding the entries to MtarTool's dictionary is only necessary if either the motions have hashed filenames or if they were originally non-hashed but have been added to non-original custom directories.
Hashed filenames are easy to spot since when unpacked they look random and aren't in any sub-directories, eg: 1fcae14e60d2d
.
For example, the following is the GANI path of the fulton swaying motion from mgoplayer_resident.mtar
, which is non-hashed. If placed in the same directory structure then nothing would need to be added to MtarTool's dictionary.
Assets\tpp\motion\SI_game\fani\bodies\enet\enetnon\enetnon_ful_idl.ganiHowever if the motion were instead added to
Assets\tpp\MyCustomPath
, like the following then it would need to be added to MtarTool's dictionary, otherwise when the custom MTAR is packed the path won't work when referenced in the following section.
Assets\tpp\MyCustomPath\Assets\tpp\motion\SI_game\fani\bodies\enet\enetnon\enetnon_ful_idl.ganiWhen added to MtarTool's dictionary the path would have to be reformatted with forwardslashes instead (including one before
Assets
) and without the .gani
at the end, as per the example excerpt in step 7a.
-
*Whew* We're now ready to repack the MTAR!
Drag the
player2_resident.mtar.xml
onto MtarTool.exe and a newplayer2_resident.mtar
will be created.The unpacked
player2_resident_mtar
andplayer2_resident.mtar.xml
can now be deleted since we no longer need them. -
Let's also repack the FPK we unpacked earlier by navigating up to where
player2_resident_motion_fpk
and the XML are located and draggingplayer2_resident_motion.fpk.xml
onto GzsTool.exe.A new
player2_resident_motion.fpk
will be created.The unpacked
player2_resident_motion_fpk
andplayer2_resident_motion.fpk.xml
can now be deleted since we no longer need them.
-
So close! Just need to re-zip the whole thing to create our Snakebite mod package. First navigate to the root of the
motions
directory we unzipped from step 1.-
Highlight both the
Assets
directory andmetadata.xml
file, right-click them and select Send to→Compressed (zipped) folder.You can of course alternatively zip them with whatever your preferred zip program is.
- Rename the newly generated zip to whatever you like and then edit the file extension to be
.mgsv
instead of.zip
(eg:custom_motions.mgsv
).
-
-
Final step is installing the Snakebite mod package. Open the Snakebite program directory and launch SnakeBite.exe.
-
Click Mods→Install .MGSV File(s) then navigate to the Snakebite package we just created and follow the prompts to install.
-
With that completed we're ready to tell IHthe mod where to find our shiny new motions, in the following section.
The above steps can be followed to also add other GANI to the same custom MTAR.
Alternatively you could create multiple Snakebite mods each with a custom MTAR, which is great for flexibility and only requires a few extra steps to rename the template MTAR (for that see the expandable section below).
The above steps can be followed to also add other GANI to the same MTAR.
Below are the full list of GANI entries necessary for adding the new GANI paths to the customized MTAR XML, not including the template's original entry that wasthe existing entries that were there originally.
For reference of step 5b6b above.
<Gani FilePath="/Assets/tpp/BuddyQuiet2_heli/1fcae14e60d2d" /> <Gani FilePath="/Assets/tpp/BuddyQuiet2_heli/239e21cf935ce" /> <Gani FilePath="/Assets/tpp/BuddyQuiet2_heli/163ffb1df1550" /> <Gani FilePath="/Assets/tpp/BuddyQuiet2_heli/1c22467fb6de7" /> <Gani FilePath="/Assets/tpp/BuddyQuiet2_heli/69e8d06626a2" /> <Gani FilePath="/Assets/tpp/BuddyQuiet2_heli/d8ce58e5cdfa" /> <Gani FilePath="/Assets/tpp/BuddyQuiet2_heli/269bc42fa2bec" /> <Gani FilePath="/Assets/tpp/BuddyQuiet2_heli/31ce91238aeab" /> <Gani FilePath="/Assets/tpp/BuddyQuiet2_heli/9622b94619c6" /> <Gani FilePath="/Assets/tpp/BuddyQuiet2_heli/265e4b6107a50" /> <Gani FilePath="/Assets/tpp/BuddyQuiet2_heli/1d72ca247ffd6" /> <Gani FilePath="/Assets/tpp/BuddyQuiet2_heli/23f479ca7f442" /> <Gani FilePath="/Assets/tpp/BuddyQuiet2_heli/279727693777d" /> <Gani FilePath="/Assets/tpp/BuddyQuiet2_heli/90e9df1ef895" /> <Gani FilePath="/Assets/tpp/BuddyQuiet2_heli/3db975a160f95" /> <Gani FilePath="/Assets/tpp/BuddyQuiet2_heli/7827e881f13d" /> <Gani FilePath="/Assets/tpp/BuddyQuiet2_heli/70c0ba4e5c1e" /> <Gani FilePath="/Assets/tpp/BuddyQuiet2_heli/58e0b4d37ba8" /> <Gani FilePath="/Assets/tpp/BuddyQuiet2_heli/2e7997d7a7344" /> <Gani FilePath="/Assets/tpp/BuddyQuiet2_heli/21b1bce3c601" /> <Gani FilePath="/Assets/tpp/BuddyQuiet2_heli/121942f76b8db" /> <Gani FilePath="/Assets/tpp/BuddyQuiet2_heli/254c06e19936c" />These example entries use the custom
BuddyQuietQuiet2_heli
directory name chosen in step 34 above. If you've chosen a different name you'll have to update the above paths.
If you plan on creating multiple Snakebite mods, each containing a custom MTAR (instead of adding all the GANI to a single custom MTAR), then you'll need to rename a few things from the template to avoid them all sharing the same name (which would cause conflicts).
It's worth renaming these parts from the template before making other changes, to minimize the number of things needed to be renamed. The steps below assume renaming prior to following the rest of the guide.
- Open the template directory and navigate to the following directory, which contains the unpacked default FPK and FPKD directories.
Assets\tpp\pack\mission2\ih
-
Rename the
custom_motions_fpk
andcustom_motions_fpkd
directories to your choosing but keep the end_fpk
and_fpkd
parts of the names.Filenames in MGSV are limited to upper/lowercase, numbers and underscores (no spaces).
-
Open the template directory and navigate to the following directory, which contains the default MTAR.
Assets\tpp\pack\mission2\ih\custom_motions_fpk\Assets\tpp\motion\mtar\player2
-
Rename the MTAR to your choosing.
-
Go back up to the root of the template directory and navigate to the following Fox2 file, then drag it onto FoxTool.exe. An XML file will be created beside it.
Assets\tpp\pack\mission2\ih\custom_motions_fpkd\Assets\tpp\level_asset\chara\player\game_object\player2_ih_additional_motion.fox2
- Open the XML file in a text editor. There's one value which contains the template's default MTAR path (
/Assets/tpp/motion/mtar/player2/custom_motions.mtar
). Update it to the new MTAR filename chosen in step 2. - Drag the XML file back onto FoxTool.exe to recreate the Fox2 file and delete the XML file.
Now after packaging the mod multiple IH motions mods can be installed separately.
Pointing to the new animations
Almost there. We just need to tell IHthe mod where to find the new animations. This is also where we get to pick which GANI we want available while in-game; this could be all of them or just a few.
- Open the game's install directory and within
mod\devmodules
copy bothIHDev_AddMotions.lua
andInfQuickMenuDefs_User.lua
tomod\modules
. -
Open the copied
IHDev_AddMotions.lua
and within thethis.packages
section edit it to point to our new FPK, like so:this.packages={ "/Assets/tpp/pack/mission2/ih/custom_motions.fpk", }
I've excluded the default disabled example for brevity (which is commented-out by two dashes at the start of the line,--
).
-
While still in
IHDev_AddMotions.lua
and within thethis.motions
section add the desired GANI paths from the MTAR we installed with Snakebite, like the following. Not all the GANI have to be added, just whichever you want to access while in-game.See the Resources section for GANI descriptions.
this.motions={ QuietLaying={ "/Assets/tpp/BuddyQuiet2_heli/58e0b4d37ba8.gani" }, QuietSittingCrossingLegs={ "/Assets/tpp/BuddyQuiet2_heli/9622b94619c6.gani" }, }
By default the lua includes a couple disabled example entries inthis.motions
, which I've excluded from the above for brevity. You can simply add your code below them.You can name the labels whatever you want. I've named them above
QuietLaying
, etc, to be recognizable.Unlike when we created the custom MTAR in the previous section any GANI paths added here need the
.gani
at the end. Otherwise the motions won't play in-game later.Another way of entering multiple GANI is placing them within a single group label:
this.motions={ QuietGroup={ "/Assets/tpp/BuddyQuiet2_heli/58e0b4d37ba8.gani", -- Laying "/Assets/tpp/BuddyQuiet2_heli/9622b94619c6.gani", -- Sitting }, }
Grouping related motions under a single label can be useful if there is an intro/middle/outro, or if you want to bulk add motions to test since as a bonus the GANI are played back in order of appearance within the group.
Descriptive comments can be added to the right-side of lines. Also notice that trailing commas can be used after all paths and closing brackets within a parent code block.
-
(Optional) If you want to have the motions sorted in a custom order rather than the default alphabetical then add your custom labels from the
this.motions
section to thethis.motionGroups
section, as per the commented-out default examples found in the lua script.If adding motions to the custom order list (
this.motionGroups
) just keep in mind to only include the same group labels that are enabled in thethis.motions
list.If one appears in the
this.motions
list but not in the custom order list then that particular GANI won't be accessible when in-game (just a minor limitation of IH's feature).
- Open the game's install directory and create an empty text file named
log.txt
in it (beside the game EXE).This is so we can display mod messages and names of motions while in-game.
- Create a directory named
lua
in the same place and into it copy the contents of theput_us_into[MGS_TPP-lua]
directory from unknown321's mod files.
-
Inside our new
lua
directory openanimation_changer.lua
in a text editor and near the top of the file change the following values:- The value in
debug = false
totrue
.This tells the mod to display messages while in-game, which is strongly recommended initially so you can tell when the mod is active and which motions are playing.
- The value in
ani_hold_forever = true
tofalse
.This is so it doesn't remain playing the motion (either on loop or remaining static on the last frame), which would require manually ending playback.
Useful to initially to get a sense of the mod, though for things like screenshotting purposes you'd want this set this to
true
.
- The value in
-
In that same lua, within the
motions_table
section add the desired GANI paths from the MTAR we installed with Snakebite, like the following. Not all the GANI have to be added, just whichever you want to access while in-game.See the Resources section for GANI descriptions.
local motions_table = { {"QuietLaying", "/Assets/tpp/BuddyQuiet2_heli/58e0b4d37ba8.gani" }, {"QuietSittingCrossingLegs", "/Assets/tpp/BuddyQuiet2_heli/9622b94619c6.gani" }, }
By default the lua includes all the MGO gestures already withinmotions_table
, which I've excluded from the above for brevity. You can add your motions above them, or disable them by commenting them out (prefixing each line with two dashes and a space:--
).You can name the labels whatever you want. I've named them above
QuietLaying
, etc, to be recognizable.Another way of entering multiple GANI is placing them within a single group label:
local motions_table = { QuietGroup={ "/Assets/tpp/BuddyQuiet2_heli/58e0b4d37ba8.gani", -- Laying "/Assets/tpp/BuddyQuiet2_heli/9622b94619c6.gani", -- Sitting }, }
Grouping related motions under a single label can be useful if there is an intro/middle/outro, or if you want to bulk add motions to test. It's all just personal preference.
Descriptive comments can be added to the right-side of lines. Also notice that trailing commas can be used after all paths and closing brackets within a parent code block.
Finally time to test them in-game! Onto the fun section.
You can also edit the lua script while the game is running, which is a quick way of testing things.
To do so: save your changes, open IH's menu and select Debug stuff menu→Reload IH modules, then pause the game and reload from checkpoint. Occasionally this doesn't work so in such cases just do a full game relaunch.
When we added the IHDev_AddMotions.lua
to the modules
directory IH disabled the default Metal Gear Online motions from appearing in the motions list.
This is intentional behavior so the user can chose exactly which motions they want available when in the game, instead of having the MGO ones always there.
Option 1: Add them all back, mixed in with your custom motions
- Open
IHDev_AddMotions.lua
and near the top change thereplaceMotions
value tofalse
.
Option 2: Selectively add them back
- Open
IHDev_AddMotions.lua
and near the top make sure thereplaceMotions
value is set totrue
. - Uncomment the default
ih_additional_motion.fpk
path from thethis.packages
section by removing the beginning two dashes from the line (--
). - Add back any default GANI you want in the
this.motions
section (there are two already there commented-out as examples).The full list of GANI paths and labels from the default IH motions can be found mid-way inside the
InfMotion.lua
, from themod\modules
directory.
*QuietThumbsUpGood*
Usage
Playing motions
- Launch the game and deploy in free-roam/Motherbase/a mission.
-
Open IH's menu, select Motions, choose a motion from the list and select Play motion.
Alternatively press the Quick Menu button combo to play/stop/change a motion (see the next subsection for details).
- Launch the game and deploy in free-roam/Motherbase/a mission.
- Press and hold V+E until it states on screen the keys have been bound.
This button combo is necessary to be used once after each new launch of the game while deployed if you want to use the motions mod. Once bound it will enable the mod until exiting the game.
- Then you can press and hold the default Zoom button + Up to play the first animation in the motions list we customized earlier.
If all went well you should see the motion play that was added in IH'sthe mod's motions list earlier (yay). If not check the Troubleshooting section.
GANI tag team!If you'd like to loop motions when played (such as the various seen in this guide) open IH's menu and in the Motions menu enable Hold motionthe game's install directory then edit lua\animation_changer.lua
in a text editor and change the ani_hold_forever
value from false
to true
.
Just know that only certain motions are loopable, while the rest will simply remain static on the last frame.
Quick Menu commands
Infinite Heaven offers the ability to trigger motions via game button combos instead of its menu. This can be enabled by returning to the ACC in-game, opening IH's menu and selecting IH system menu→Enable Quick Menu→On.
The Quick Menu commands by default use the Call button held down in combination with another button to trigger a command. The default combos are the following:
More commands are available and different buttons can be assigned if you customize the Quick Menu functions. See the expandable steps below for info.
The Quick Menu can be used for a variety of IH commands, including freezing/slowing time, toggling freecam and more but for these steps we'll focus on just customizing the motion commands.
Customizing the default button trigger
By default you hold down Call + the button configured for the command but you can change this if you prefer.- Go to the game's install directory and open
mod\modules\InfQuickMenuDefs_User.lua
in a text editor. - Search for
this.quickMenuHoldButton
and change its default value (InfButton.CALL
) to one of the other button names that can be found listed in commented-out examples at the top of the same lua.
A full list of button names can be found on the MGSV modding wiki. The most relevant buttons not covered in the aforementioned IH lua comments are DASH
(L3/left stick) and DECIDE
(R3/right stick).
Customizing the commands
- Go to the game's install directory and open
mod\modules\InfQuickMenuDefs_User.lua
in a text editor. -
Within it scroll to the
this.inMission
section and change the value withinCommand
of[InfButton.UP]
,[InfButton.DOWN]
, etc to the desired function below.FunctionDescriptionInfMotion.PlayCurrentMotion
Plays currently selected motion (whether group or within group)InfMotion.StopMotion
Stops playbackInfMotion.NextGroup
Switches to next motion groupInfMotion.PrevGroup
Switches to previous motion groupInfMotion.NextMotion
Switches to next motion within group*InfMotion.PrevMotion
Switches to previous motion within group*InfMotion.PlayNextGroupMotion
Switches to and plays next motion groupInfMotion.PlayPrevGroupMotion
Switches to and plays previous motion groupInfMotion.PlayNextMotion
Switches to and plays next motion within group*InfMotion.PlayPrevMotion
Switches to and plays previous motion within group*this.motions
list ofIHDev_AddMotions.lua
will anything occur.[InfButton.UP]={immediate=true,Command='InfMotion.PlayCurrentMotion'}, [InfButton.DOWN]={immediate=true,Command='InfMotion.StopMotion'}, [InfButton.LEFT]={immediate=true,Command='InfMotion.PlayPrevGroupMotion'}, [InfButton.RIGHT]={immediate=true,Command='InfMotion.PlayNextGroupMotion'}, [InfButton.HOLD]={immediate=true,Command='InfMotion.PlayNextMotion'},
The above is what I use personally. I added an extra combo (Hold) to play motions within a group since I use it less frequently and prefer switching between groups using the directional buttons.
Quick commands
As you've seen playback of motions is controlled via button combos. We'll call these 'quick commands' since it's catchier and similar to what Infinite Heaven calls them.
The quick commands by default use the Zoom button held down in combination with another button to trigger a command. The default combos are the following:
The buttons used for the combos can be customized, and it's possible to add a function to play a previous motion group. See the expandable steps below for info.
Adding a play previous motion group function
Since by default the mod lacks a way to play a previous motion group we'll add one. It's super simple.
- Go to the game's install directory and open
lua\animation_changer.lua
in a text editor. - Below the
function animation_changer.play_next_animation()
code block paste in the following function:function animation_changer.play_prev_animation() -- animation_changer.stop_animation() ani_index = ani_index - 1 animation_changer.play_animation(ani_index, ani_inner_index, ani_hold_forever, ani_repeat) if debug==true then local animation_name = motions_table[ani_index][1] helpers.log(string.format("[ANICHANGER] playing %s %s %s",tostring(ani_index), tostring(ani_inner_index), animation_name),true) end end
This function allows playing a previous motion group after some next motion group has been switched to but can't wrap backwards to the very last motions group if pressed while at the first group of the list.
Now that function is available to use for the next subsection.
Customizing the buttons
- Go to the game's install directory and open
lua\script_loader.json
in a text editor. -
Within the
keys
section there are the names of the buttons used in combination with the Zoom:PlayerPad.UP
,PlayerPad.RIGHT
, etc. Swap thefunction
value to the desired function below.FunctionDescriptionplay_current_animation
Plays currently selected motion (whether group or within group)stop_animation
Stops playbackplay_next_animation
Switches to and plays next motion groupplay_prev_animation
Switches to and plays previous motion group*play_next_animation_step
Switches to and plays next motion within group**motions_table
list ofanimation_changer.lua
will anything occur."keys": { "PlayerPad.UP": { "module":"animation_changer", "function":"play_current_animation" }, "PlayerPad.RIGHT": { "module":"animation_changer", "function":"play_next_animation" }, "PlayerPad.LEFT": { "module":"animation_changer", "function":"play_prev_animation" }, "PlayerPad.DOWN": { "module":"animation_changer", "function":"stop_animation" } },
The above is what I use personally, after adding the custom function to play the previous motion group.
Troubleshooting
Stuck on some issue after testing in-game? Here are some things to check first. Usually it's nothing major.
Infinite Heaven specific
- Only the default MGO motions show in IH's in-game motions list.
- Could be a mistake in
IHDev_AddMotions.lua
. Check that commas are correctly set inthis.motions
andthis.packages
, as per step 2-3 of this section. - If you made an edit to the lua then reloaded it via IH's menu (Debug stuff menu→Reload IH modules) and continued from the last checkpoint, it could be IH didn't reload the lua properly. Try relaunching the game.
- Could be a mistake in
- Group labels appear in the motions list in-game but nothing plays.
- Check in
IHDev_AddMotions.lua
that the GANI paths withinthis.motions
are correct (eg: that they end with.gani
and/Assets/
begins with a forward slash). - Check that the custom FPK is correctly listed in the
this.packages
section withinIHDev_AddMotions.lua
, as per step 2 of this section.
- Check in
- Motions were able to be played while in-game but a moment later stopped working.
- Occasionally this just happens for unknown reasons. A checkpoint reload usually resolves it. Alternatively try relaunching the game.
- After launching game it gets stuck on the black loading screen, following the intro logos.
-
Check that the FPK listed in the
this.packages
section within theIHDev_AddMotions.lua
(step 2 of this section) is installed via Snakebite.I've encountered this issue when I once tested multiple FPKs (each with custom MTARs) and forgot I'd uninstalled one of the FPKs while GANI from it were still listed in
this.motions
.
-
- Some of the custom motions show up in-game and others not.
- If you've added anything to the custom order list (
this.motionGroups
) from step 4 of this section make sure there are the same items included in that list as enabled in thethis.motions
list, as per note in the linked step.
- If you've added anything to the custom order list (
- No motions are listed or appear in-game.
- If you have multiple, separate motion mods installed via Snakebite make sure each unique FPK path of theirs is included in the
this.packages
section with theIHDev_AddMotions.lua
(step 2 of this section). Also check that only GANI from currently installed mods are listed inthis.motions
.
- If you have multiple, separate motion mods installed via Snakebite make sure each unique FPK path of theirs is included in the
Mod specific
- Nothing plays and there's no indication on screen of the mod.
- Check that you've bound the keys after deploying in the field, as per step 2 of the Usage section. The mod won't be enabled until doing so.
- Only the MGO motions are available in-game.
- Could be a mistake in
animation_changer.lua
. Check that commas are correctly set in themotions_table
, as per step 4 of this section.
- Could be a mistake in
General
- The custom motions still won't play, even after trying the troubleshooting suggestions above.
- Open MtarTool's
mtar_dictionary.txt
and check whether the custom GANI paths were added/saved to it, as per step 67 of this section. If the custom paths aren't present you'll need to redo those steps to pack the MTAR as intended.While MtarTool will still pack the MTAR even without any custom entries in the dictionary (they'll simply be converted to alternate hashed filenames instead) the issue is that the GANI paths added to
IHDev_AddMotions.lua
animation_changer.lua
would be using differently named paths so IHthe mod wouldn't find them. - Check the filesize of the custom MTAR. If it's suspiciously small (eg: it's meant to be close to 1MB but instead it's 100KB) unpack the MTAR and check that the MTAR XML contains exactly the same number of GANI entries as there are GANI files in the unpacked MTAR and that they're the correct paths.
If there are more/less entries in the XML than there are files in the MTAR MtarTool can fail to pack it correctly, resulting in an unusually small MTAR filesize.
- Open MtarTool's
Something not covered here? Ask on the Modders' Heaven Discord. Be sure to mention you're using Infinite Heaven'sunknown321's motions mod.
Resources
Below is a collection of GANI notes about various MTAR, made by users to document the motions and save time for others.
Each motion description is numbered and sorted according to the GANI internal order of appearance to be more consistent between each author and since GANI filenames may change over time but the internal order generally won't.
0000 - Description 0001 - Description 0002 - Description ...Description formatting can vary.
To match the numbers to the the actual GANI filenames check out the Matching the numbers to the GANI filenames expandable section further below.
Notes list
All the text file notes here also include the location of the MTAR version used, along with a supplementary list of the GANI filenames matched to the order (accurate as of the date they were unpacked), for easier lookup.
mgo
game directory.This MTAR version is the one located in chunk0.dat
, which wasn't affected by the 2018 game updates.
If you sourced the MTAR from 00.dat
/01.dat
however it will have a different internal order and the order won't match (but the GANI filenames can still be referred to).
player2_resident.mtar
.If you want to contribute your own to the above list get in touch on the Modders' Heaven Discord!
The game sometimes has related GANI located in different MTAR.
Some of Quiet's boss motions for instance are used for Quiet's buddy motions, or Snake having a couple intros for the Phantom Cigar motions in one MTAR and loops in another.
Notes how-tos
In the notes above, each description begins with the internal GANI order number from the MTAR. It's simply the order each GANI was originally packed into the MTAR by the devs.
For example from the BuddyQuiet2_heli.mtar
notes we can see one of Quiet's motions (laying prone) is number 0017
.
So in the notes file scroll down to the Raw MtarTool reference list and find the line beginning with 0017
, which currently shows as:
0017_58e0b4d37ba8
This tells us that the filename of the GANI was 58e0b4d37ba8.gani
, as of the date listed that MtarTool unpacked it. MtarTool then added the 0017_
prefix since it was generated with the internal order number setting enabled.
So if you extracted the same MTAR yourself for use in a custom motions mod, or perhaps some animation swap mod, you can then find the GANI being described in the notes, assuming MtarTool's dictionary has remained the same.
If MtarTool's dictionary should change, which would happen if the community discovers more non-hashed GANI paths, then you can follow the Generating MTAR numbers for your own notes expandable section below.
As an alternative example of how this can be applicable, if you're using someone else's custom MTAR that was made by following the guide above and using the suggested custom MTAR name, the full path to that GANI would be as below, which we could then use to point Infinite Heaven to (as described in step 3 of this section) in step 4 of this section:
/Assets/tpp/BuddyQuiet2_heli/58e0b4d37ba8.ganiThe guide suggests using the MTAR's name as the parent directory since the GANI used are hashed and it keeps them in a recognizable location.
In contrast, here's an example of a non-hashed GANI path from the guide's template filetemplate file in the Infinite Heaven version of the guide:
/Assets/tpp/motion/SI_game/fani/bodies/enet/enetnon/enetnon_ful_idl.ganiHere the non-hashed GANI was added directly to the root of
/Assets/tpp
, which is useful since MtarTool already has the path in its vanilla dictionary. However it's all just arbitrary preference.
Keep in mind if you're using someone else's mod they may be using a different path structure/naming (and even custom GANI filenames), so it's best to check with the mod author in such cases to find how they named their paths if they lack a full list of motions included.
This section covers how to extract an MTAR with the internal ordering numbers setting enabled.
This is ideal for making new notes oneself about an MTAR, since it'll be consistent with existing notes by other users.
It's also useful for if you discover user notes that lack a Raw MtarTool reference section, or if in the future the MtarTool dictionary has been updated and some of the GANI filenames included no longer match in the user notes.
- First locate the original MTAR and copy it somewhere else (eg: the desktop).
We can determine where an MTAR is located by searching for the MTAR filename in
TppMasterFileList.txt
from File Monolith, which contains a list of all the MTARs in the game.File Monolith's list doesn't display which DAT file it's contained within though so you may have to unpack them all to find them.
- Open the MtarTool program directory, select the addressbar at the top of the File Explorer window, type
cmd
then press Enter. This will open a command prompt at that location. -
Type
MtarTool.exe
into the command prompt, followed by a space, then drag and drop the MTAR onto the command prompt window. Lastly add another space and type-n
.It should look like this but with your path instead of the example:
MtarTool.exe "C:\example.mtar" -n
- Press Enter and MtarTool will unpack the MTAR but this time it'll prefix all the GANI filenames with the original internal order (eg:
0002_163ffb1df1550.gani
, where0002
is the order number).Make sure you unpack only an original MTAR. If the MTAR has been repacked previously (even if nothing else has been modified) the internal order will be different.
-
To get a quick text file list of all the extracted GANI open the matching
mtar.xml
file that gets generated.Then you can copy its list of GANI paths and re-format it using find and replace, to have a structured starting point for making notes beside each motion.
This is also how I create the Raw MtarTool reference sections of each notes file.
That's it. Now you have a copy of the originally packed GANI order for that MTAR.
Credits
- tinmantex for updating Infinite Heaven with suggested improvements for the motions modules. Big thanks.
- unknown321 for the original motions research and mod.
- BobDoleOwndU for various of the exhaustive GANI description lists and for helping locate files (including the one used for this guide, a while back).
- originalnicodr for their time-saving StageDepthPlus.fx shader.
- caplag for indirectly and unknowingly causing me to consider making a more comprehensive guide.