Vader666 Posted November 21, 2016 Posted November 21, 2016 Adding Custom Animations to Fallout 4 I was asked about doing a Guide / HowTo about adding Animations to Fallout 4. So here it is. A PDF version will get attached later. Note : The guy who is writing this is neither an animator nor a professional in any other field of game / software development. All the Information here was acquired by like 30% Google Searches and 70% Trial and Error. To get it straight : Handle with care ! There are different types of animations and sometimes multiple ways to add an animation to the game. I'm going to use the following color code to show how much is tested or known : GREEN / Tested and working ORANGE / Not fully tested or working RED / Not tested or working / pure assumption Idle Animations via Idle Window 1) Open Creation Kit and load the Fallout4.esm 2) Go to Gameplay > Animations 3) A Window called “Idle Animations” opens. In the drop-down-menu of Behavior Graph select : “actors\Character\Behaviors\RaiderRootBehavior.hkx 4) Scroll to the entry called “LOOSE” and right click on it, chose “Insert Child” in the context menu. 5) In the upper right corner you have to give your animation an ID. Choose something yo can remember you will need it later. Open the drop-down-menu next to “Anim Event” and select “dyn_Activation” Under “Animation File” click on edit and set the file path to your animation file. 6) Open the “Player” form found under Actors in the Object Window and add a new script to it. Name the script whatever you want, in this case it does not have to extend any other script. 7) Add an Idle type Property to your script and give it the exact same name like the ID of your animation (Step 5) 8) Edit the script, my script is calling the property once the script is initialized which results in playing the animation. 9) Save the script, close the player form and the Idle Animations window and save your edits to a PlugIn file. 10) Load your PlugIn in Fallout4 and watch your animation. AnimObjects AnimObjects are .nif files which are loaded and drawn when an animation is calling it through its annotations. The Object gets connected to the bone of the actor´s skeleton that is specified in the .nif file. Every nif file can be used as AnimObject, even the ones that contain an animation by themselves, after preparing them in Nifscope. Setting up a nif in Nifscope : Add a NiStringExtraData block to the Scene Root NiNode and name it PRN (ParentRootNode) which is telling the game what the string data is used for. In String Data you can enter any bone the skeleton of the actor who is playing your animation has. That is the bone your AnimObject will get attached to. Setting up annotations in your animation After you did your animation you have to add a note track to your animation that contains keys which tell the game what to do. To handle an AnimObject you need three keys. The first contains the text AnimObjLoad.AnimObjectID, followed by AnimObjDraw.AnimObjectID and the last one is AnimObjUnequip. AnimObjLoad loads the AnimObject. AnimObjDraw tells the game to actually render your AnimObject, that means you can load the object at frame 0 but draw ( make visible ) at another frame. AnimObjectUnequip unloads the AnimObject if its set up as unload event in CK. Setting up the AnimObject in CK Create a new AnimObject form in CK. The ID has to be the same as the one you are using in your animations annotations. The Model is the .nif file that will be used as AnimObject. The UnloadEvent is the event that has to be send to unload your AnimObject. To pick an event set the Behavior graph filter to the Behavior graph that contains the event you want to use. Vanilla AnimObjects use : Actors\RadStag\Behaviors\RadStagRootBehavior.hkx and AnimObjUnequip as event. Now you have to set up your animation as shown in Idle animations via Idle window. Once your animation is called, the AnimObject is shown together with it. BehaviorSubGraphData Adding animations to the BehviorSubGraph is not possible. What you´re doing with BehaviorSubGraphData is a dynamic override of an existing animation under certain conditions. The BehaviorSubGraph does contain the name of the animations that are using it, that means that its absolutely necessary that your animation is named exactly like the animation you want to override. What gets changed in the BehaviorSubGraph are the file paths to the animations so you´re just redirecting to your animations. The redirect happens when all Keywords you set up in your SubGraphData entry are present on an Actor / Furniture. The SubGraph will get kind of instanced which means only the actors or furniture that have the keywords will use your animation, everything else uses the vanilla ones instead. The entry with the most keywords met is picked, which means if entry A has 2 keywords and entry B has 3 keywords and your actor has all of these keywords, the animation from entry B will be used. That is important when you want to override an animation. To override vanilla animations you need at least 2 keywords. When the redirect happens the file path of every animation is changed to the one(s) you set up in your SubGraphData entry. When you just have a single animation in your file path I.e. a walking animation every action other than walking will cause the actor to go in T-Pose, because the other animations are just not there. To use your walking animation together with the vanilla animations ( jump, swim etc ) you have to add the vanilla animation file paths below the file path your animation is using. The Order in which your file paths are set is important. File paths that are set up higher will overrule file paths that are set below. i.e. you have a file path with a walking animation and want to use it with the vanilla animations, but the vanilla animation file path contains a walking animation too. Now when yo set up your file path higher than the vanilla file path the vanilla walking animation will be ignored because a walking animation is already found in your file path. The 2nd file path will only be used for animations that are not found in the 1st . The 3rd file path will only be used for animations that are not in the 1st or the 2nd file path and so on. Adding a new BehaviorSubGraphData Form In the Object window in CK go to races and add a new race form and give it an ID Hit ok and re-open your new race form. Go to Body Data and select the skeleton and the Behavior Graph. Use the same files the race you want to animate uses. Go to the SubGraph Data tab and change “template” to additive. Now you can select which SubGraphData you want to extend. Hit ok Now you can use your new SubGraphData. MT-Animations MT-Animations are Motion animations, like walk, jump and sprint. To add an MT animation open your SubGraphData , right click in the empty list and select “new”. Since you want to add a MT-animation, set the Role to MT and chose the MTBehavior as Behavior graph. In Actor Keywords fill in the keywords the actor has to have to use your animation. In Animation Paths set the paths to your animation file(s) Target Keywords are not used for MT-animations and can stay blank. ArmOffset-Animations ArmOffset-Animations are animations that blend an offset into other animations. Used by the injured arms animations and the hands up AnimFlavor. The Setup for ArmOffset-Animations is very similar to the MT-animations one. The Role is MT but instead of the MTBehavior graph use the MTWrappingBehavior. Another difference is that we have multiple file paths, that is because you want to use your offset animation together with the vanilla MT-animations. Furniture-Animations Furniture-animations are a sequence of three animations ( Enter, Idle, Exit ) that is used when a furniture is used by an actor. Since its a furniture-animation now, set Furniture as Role and use the FurnitureBehavior graph. The Target keyword is the keyword the furniture has to have to use your animation on every actor who is using that furniture. Note : The reason why there are 2 Animation paths is that I am re using a vanilla enter animation, because I was not able to create a working one yet. The actor movement from the interaction point to the animation marker is not from the animation but either from the behavior graph or the engine itself. Haven´t found a way around or to use that yet. Idle-Animations I haven´t done that with SubGraphData yet, should work similar to the others. Weapon-Animations I haven´t done that yet, should work similar to the others. Generating MetaData Meta data is needed to provide some additional information to the game engine. Not generating MetaData causes MT-animations to run at either very low or very high speeds. The Generated text files have to be packed together with your mod. Generating MetaData is done within a build process in CK. To have access to that you need to create a shortcut of the CreationKit.exe and add some parameters to it. Under “target” you see the path to your CreationKit.exe” Right after the “ add -GenerateAnimInfo: YourMod.esp data data Which parameters you have to use depends on the animation type you´re adding. For Furniture you don´t have to add an parameter. For MT-animations add --speed after the 2nd data Side note : Using the --speed parameter to generate MetaData for furniture and MT-animation at the same time seems to be just fine. The generated output will get saved in Data\Meshes\AnimTextData. You can find more information about this in the CK-Wiki How to trigger your animations For now I know of 2 ways to trigger animations, both are using the ChangeAnimArchetype() Function. AnimArchetype Keyword : In this case one of the used keywords is of type AnimArchetype. To trigger your animations you have to add the other keyword by the AddKeyword() function and add the AnimArchetype Keyword with ChangeAnimArchetype(YourAAKeyword). As soon as the AnimArchetype is set your animations are used. This method has the downside that any change of the AnimArchetype, either by game or by mods, will break your animation. If you just want to play your animation once or under very specific conditions you could use that. To change back to vanilla animations just remove the Keyword(s) with RemoveKeyword() and the AnimArchetype Keyword by either ChangeAnimArchetype() for NPC´s or ChangeAnimArchetype(AnimArchetypePlayer) for the player. AnimInjured Keyword : In this case one of the used keywords is of type AnimInjured. To trigger your animation you have to add all your keywords with the AddKeyword() function. After all keywords are added to the actor “update” it by changing its AnimArchetype. For the player it would be : ChangeAnimArchetype() ChangeAnimArchetype(AnimArchetypePlayer) For Npc´s its the other way around. This is needed to assure that the AnimArchetype really gets changed because changing the AnimArchertype to the one that is currently active does nothing. With this way your animation will still be active even if something changed the AnimArchtype, as long as your SubGraphData entry is still the one with the most keyword conditions met. Note : Changing the AnimArchtype on the player while using the PipBoy is a bad idea. Its causing the game to ,more or less, freeze what can only be resolved by loading a save. Credits http://www.creationkit.com The guys involved in the F4 AnimationKit If you have any ideas, questions or want to contribute, feel free to post here Adding custom Animations to Fallout 4 v0.1.rar
Supertin Posted November 23, 2016 Posted November 23, 2016 This is great information. Very useful! I have some more questions, if you dont mind though. Do you know how "persistent" armoffsets are? In skyrim offset animations added through fnis are quite limited and break during certain animations (for example jumping breaks offsets in skyrim). Is this similar in fallout 4? From your description it sounds like the behavioursubgraphdata works very similarly to what fnis alternate animation does in skyrim. Except that fnis doesn't have a priority system like you described. Do you know what might happens if two or more mods add animations to the behavioursubgraphdata at the same time? Will they just overwrite each others changes or would you need a compatibility patch? Or might this be something a framework can take care off? All this information makes me wonder why there is still a big lack of fallout 4 animations. Seems like fallout 4 might have a much better base for animating than skyrim. Then again, lack of f4se papyrus, and other fundamental features are keeping me away from fallout 4 at the moment. But it seems like it will definitely be worth creating for fallout 4 later down the line.
Vader666 Posted November 23, 2016 Author Posted November 23, 2016 This is great information. Very useful! I have some more questions, if you dont mind though. Do you know how "persistent" armoffsets are? In skyrim offset animations added through fnis are quite limited and break during certain animations (for example jumping breaks offsets in skyrim). Is this similar in fallout 4? From your description it sounds like the behavioursubgraphdata works very similarly to what fnis alternate animation does in skyrim. Except that fnis doesn't have a priority system like you described. Do you know what might happens if two or more mods add animations to the behavioursubgraphdata at the same time? Will they just overwrite each others changes or would you need a compatibility patch? Or might this be something a framework can take care off? All this information makes me wonder why there is still a big lack of fallout 4 animations. Seems like fallout 4 might have a much better base for animating than skyrim. Then again, lack of f4se papyrus, and other fundamental features are keeping me away from fallout 4 at the moment. But it seems like it will definitely be worth creating for fallout 4 later down the line. Vanilla motions ( walk,sprint, sneak and jump, haven´t tested swimming ) do not break the offset. Using furniture does, at least while furniture is used after exit the offset gets re-applied to the actor. if you want to test some on your own take a look at this Using behaviorSubGraphData basically is alternate animations. When the SubGraphData of both mods is set up like shown in this guide they won´t conflict because they´re both expanding the Vanilla, in most cases Human-, SubGraphData form. Which animation will be used is just a matter of "who used more keywords" then. So you don´t need any compatibillity patches. Why there is so few content for F4 is a question that could have many answers, one of them is surely that there are just not as many people interested in F4 as in Skyrim (or SSE).
Supertin Posted November 23, 2016 Posted November 23, 2016 This is great information. Very useful! I have some more questions, if you dont mind though. Do you know how "persistent" armoffsets are? In skyrim offset animations added through fnis are quite limited and break during certain animations (for example jumping breaks offsets in skyrim). Is this similar in fallout 4? From your description it sounds like the behavioursubgraphdata works very similarly to what fnis alternate animation does in skyrim. Except that fnis doesn't have a priority system like you described. Do you know what might happens if two or more mods add animations to the behavioursubgraphdata at the same time? Will they just overwrite each others changes or would you need a compatibility patch? Or might this be something a framework can take care off? All this information makes me wonder why there is still a big lack of fallout 4 animations. Seems like fallout 4 might have a much better base for animating than skyrim. Then again, lack of f4se papyrus, and other fundamental features are keeping me away from fallout 4 at the moment. But it seems like it will definitely be worth creating for fallout 4 later down the line. Vanilla motions ( walk,sprint, sneak and jump, haven´t tested swimming ) do not break the offset. Using furniture does, at least while furniture is used after exit the offset gets re-applied to the actor. if you want to test some on your own take a look at this Using behaviorSubGraphData basically is alternate animations. When the SubGraphData of both mods is set up like shown in this guide they won´t conflict because they´re both expanding the Vanilla, in most cases Human-, SubGraphData form. Which animation will be used is just a matter of "who used more keywords" then. So you don´t need any compatibillity patches. Why there is so few content for F4 is a question that could have many answers, one of them is surely that there are just not as many people interested in F4 as in Skyrim (or SSE). That's pretty cool. So even if something doesn't allow the offset it automatically re-applies as long as its active? In skyrim you would need to re-apply the offset through a script periodically, so if this is different in fallout 4 it would be a lot more versatile. Is the keyword stuff something that was introduced in fallout 4? Don't think I've heard about it from previous games, but I could be wrong. So basically keywords are attached to actors? This would something like "injured" "bound" "healthy" idk whatever someone might come up with and is needed? Or maybe the tag system from sexlab might be closer to how this works? The subgraphdata get specific tags that would match their usage? What happens if 2 entries have the same amount of keywords? Wouldn't there still be a need for compatibility between mods when applying keywords to the same actor? For example mod A adds 3 keywords to the player while mod B adds 2. Then the player has up to 5 keywords attached, and mod A's subgraphdata would be used. But what if mod B should take precedence over mod A (maybe mod b binds the character while mod a only switches the characters idle, so this would cause visual oddities). Or would you just assume that mod B should probably use more keywords than mod A?
Vader666 Posted November 23, 2016 Author Posted November 23, 2016 That's pretty cool. So even if something doesn't allow the offset it automatically re-applies as long as its active? When using the "AnimInjured Keyword" Method, yes. Every change of the Archetype will "update" the "animation state" of that actor. When your SubGraphData is still the one with the most keywords it will still be used or re-applied. Is the keyword stuff something that was introduced in fallout 4? Keywords are around since Morrowind i think ? I think the only things new are the types a Keyword can be of. So basically keywords are attached to actors? This would something like "injured" "bound" "healthy" idk whatever someone might come up with and is needed? Or maybe the tag system from sexlab might be closer to how this works? The subgraphdata get specific tags that would match their usage? Quite like that yeah. What happens if 2 entries have the same amount of keywords? One of the entrys will win this conflict. I´m not sure if the engine will pick one by (real) random or has some preferences which one will be used in that case. Wouldn't there still be a need for compatibility between mods when applying keywords to the same actor? For example mod A adds 3 keywords to the player while mod B adds 2. Then the player has up to 5 keywords attached, and mod A's subgraphdata would be used. But what if mod B should take precedence over mod A (maybe mod b binds the character while mod a only switches the characters idle, so this would cause visual oddities). Or would you just assume that mod B should probably use more keywords than mod A? Thats the downside of this system. As soon as one mod just increases the number of used keywords to get a higher "priority" as "Mod A" it will lead to compatibillity issues with other mods. And soon you have Keyword-war. Haven´t found a way around that yet.
echostation Posted July 19, 2018 Posted July 19, 2018 Just found this thread, it's a gold mine. It's a shame the attached images don't work any longer!
Reginald_001 Posted April 20, 2019 Posted April 20, 2019 Can the pictures be updated? Trying to follow some of this guide but it's difficult without the screenshots working.
SAC Posted April 20, 2019 Posted April 20, 2019 3 hours ago, Reginald_001 said: Can the pictures be updated? Trying to follow some of this guide but it's difficult without the screenshots working. Download the rar linked at the end of the description, it contains a pdf
Reginald_001 Posted April 20, 2019 Posted April 20, 2019 4 minutes ago, SAC said: Download the rar linked at the end of the description, it contains a pdf I am blind as a bat, thank you!
Recommended Posts
Archived
This topic is now archived and is closed to further replies.