Custom Animation Builder & Tutorial by Phobos

Started by Phobos, September 30, 2015, 08:01:04 PM

Previous topic - Next topic
September 30, 2015, 08:01:04 PM Last Edit: September 30, 2015, 08:13:37 PM by Phobos
Custom Animation Builder v1 by Phobos
http://www.swbfgamers.com/index.php?action=dlattach;topic=9847.0;attach=5198

Instructions
This new Custom Animation Builder by Phobos features the ability to munge up to 6 custom weapon animations! Common.lvl is not modified at all, the Side and Mission only need to be modded once. Modders can quickly swap out animation models and remunge the anims.lvl, without having to remunge their side LVL. This allows for unprecedented faster testing of several animations ingame! This is very useful for large mods such as TWD which take forever to remunge. The LUA and ODFs must be initially modified however, to support these new animation banks. Details are explained below for building the new animations and incorporating them into your mods.

1) To start, extract this tool to C:\BFBuilder. Now select the MSH you want to use from the SWBF2SoldierAnimationBank folder, which contains all SWBF2 animation models. Some of these always crash in SWBF1, such as the Acklay and Greivous. The following animations work well in BF1 as discovered by Phobos and Sereja, and are included by default in the Animations subfolders:
Cannon "Side Slash" = dooku_sabre_stand_attack1b_full
Cannon3 "Dual Bladed Attack" = maul_sabre_stand_dashattack_full
Gam "Zombie Bite" = sidious_sabre_stand_useforce_full
Gam3 "Zombie Swipe" = wampa_sabre_stand_dashattack_full
Tool "Overhead Swing" = vader_sabre_stand_attack1c_full
Tool3 "Smuggler Pistol" = hansolo_pistol_stand_shoot

2) Open CANNON folder and copy 2 MSH files here that you want to use. Name the primary animation human_lascannon_stand_shoot.msh and the secondary human_lascannon_stand_shoot3.msh
CustomAnimBuilder_v1\CustomAnimationSource\Animations\cannon

3) Repeat the copy process for GAM folder. Name them human_gam_stand_shoot.msh and human_gam_stand_shoot3.msh
CustomAnimBuilder_v1\CustomAnimationSource\Animations\gam

4) Repeat the copy process for TOOL folder. Name them human_tool_stand_shoot.msh and human_tool_stand_shoot3.msh
CustomAnimBuilder_v1\CustomAnimationSource\Animations\tool

5) Once all the MSH files are in place, all you do is run the CustomAnimationMunger.bat
This will munge into the animations into 3 ZAABIN and 3 ZAFBIN files. Next, these files are automatically munged into the new anims.lvl, which is then automatically copied to the required folder after munging
C:\Program Files (x86)\LucasArts\Star Wars Battlefront\GameData\Data\_LVL_PC\SIDE

6) Now all you have to do is replace the MSH files as needed, remunge, and restart the mission. New animations can be munged on the fly and tested much faster using this method. All steps after this only need to be applied once, to the Side REQ/ODFs and Mission LUA.

7) Edit the Mission LUA to call on 3 new units ingame, which are referred to as Animation Dummies. These call the custom animations into the game memory. I have chosen to name the dummies based on the animation bank they use for simplicity. The LUA only has to reference these units as part of a native faction, the dummy units should not actually spawn in game. Here is the LUA code to add for this to work
--  Team 3 Stats
AddUnitClass(3, "twd_inf_zombie_flesheater",5)
    AddUnitClass(3, "twd_inf_anim_cannon",0) -- keep these at 0
    AddUnitClass(3, "twd_inf_anim_gam",0)
    AddUnitClass(3, "twd_inf_anim_tool",0)
SetUnitCount(3, 5)
SetTeamAsEnemy(3,DEF)
SetTeamAsFriend(3,ATT)
    SetTeamAsEnemy(DEF,3)
    SetTeamAsFriend(ATT,3)   

   
8) Before any of the SIDE lvl are called upon, directly after the SOUND section of the mission LUA, you must also add this line ReadDataFile("SIDE\\anims.lvl")
-- SOUND
ReadDataFile("sound\\bes.lvl;bes2gcw");
ReadDataFile("ZOM\\029.lvl;029gcw");
ReadDataFile("ZOM\\zombie.lvl", "zombie");

ReadDataFile("SIDE\\anims.lvl")

-- SIDE
ReadDataFile("ZOM\\TWD.lvl",
"twd_inf_basic");


9) Now you edit the Side REQ and add the 3 Animation Dummies. Here is an example REQ file
ucft
{
REQN
{
"class"
"twd_inf_anim_cannon"
"twd_inf_anim_gam"
"twd_inf_anim_tool"
"twd_inf_human_abraham"
"twd_inf_human_andrea"
"twd_inf_human_bob"


10A) Now you will create the dummy ODFs. Fortunately for you I have created them already, just copy/paste and rename them as referenced in the Mission LUA and Side REQ.
10B) Specify any existing Unit Model for GeometryName and GeometryLowRes in your MSH folder. Ghoul is the model I used.
10C) Also change the WeaponName1 value to any existing weapon in your ODF folder.
10D) The example is for twd_inf_anim_cannon.odf, change the 4 lines for Animation and Skeleton values to GAM and TOOL for the other two dummy ODFs.
[GameObjectClass]
ClassLabel = "soldier"
GeometryName = "Ghoul.msh"

[Properties]
FootWaterSplashEffect = "watersplash_sm"
WaterSplashEffect = "watersplash_md"
WakeWaterSplashEffect = "watersplash_wade"
UnitType = "assault"
IconTexture = "all_soldier_icon"
MapTexture = "troop_icon"
MapScale = 1.6
GeometryName = "Ghoul"
//AnimationName = "all_inf_snowtrooper"
AnimationName = "cannon"
AnimationLowRes = "cannon"
SkeletonName            = "cannon"
SkeletonLowRes          = "cannon"
FirstPerson = "all\alltroop;all_1st_trooper"
FirstPersonFOV = "70"
ThirdPersonFOV = "65"
GeometryLowRes = "Ghoul_low1"
CapturePosts = 0
CAMERASECTION = "STAND"
EyePointOffset = "0.0 1.8 0.0"
TrackCenter = "0.0 1.8 0.0
TrackOffset = "0.0 0.0 3.5"
TiltValue = "5.0"
CAMERASECTION = "STANDZOOM"
EyePointOffset = "0.0 1.8 0.0"
TrackCenter = "0.0 1.8 0.0
TrackOffset = "0.4 0.05 2.8"
TiltValue = "3.5"
CAMERASECTION = "CROUCH"
EyePointOffset = "0.0 1.3 0.0"
TrackCenter = "0.0 1.3 0.0
TrackOffset = "0.0 0.15 3.5"
TiltValue = "5.0"
CAMERASECTION = "CROUCHZOOM"
EyePointOffset = "0.0 1.3 0.0"
TrackCenter = "0.0 1.3 0.0
TrackOffset = "0.4 0.2 2.8"
TiltValue = "3.5"
CAMERASECTION = "PRONE"
EyePointOffset = "0.0 0.5 0.0"
TrackCenter = "0.0 0.5 0.0"
TrackOffset = "0.0 0.0 3.0"
TiltValue = "5.0"
CAMERASECTION = "PRONEZOOM"
EyePointOffset = "0.0 0.5 0.0"
TrackCenter = "0.0 0.5 0.0"
TrackOffset = "0.4 0.2 2.8"
TiltValue = "3.5"
AimValue = "1.0"
HealthType = "person"
MaxHealth = 1000.0
NoEnterVehicles = 1
Acceleraton = 35.0
MaxSpeed = 3.5
MaxStrafeSpeed = 2.25
MaxTurnSpeed = 2.0
ScanningRange = "50000.0"
TransmitRange = "50000.0"
WeaponName1 = "twd_weap_inf_zombiemelee2"
WeaponAmmo1 = 0
AimFactorPostureSpecial = 50
AimFactorPostureStand = 100
AimFactorPostureCrouch = 140
AimFactorPostureProne = 160
AimFactorStrafe = 60
AimFactorMove = 70
AISizeType = "SOLDIER"


11) There are 3 primary and 3 secondary animations that can be used, for banks CANNON, GAM, and TOOL. Weapons that are ClassLabel=Melee only support primary animations. Weapons that are ClassLabel=Cannon, Dispenser, & Grenade support primary and secondary anims. AnimationBank specifies the custom animation to use. FireAnim = 2 will call upon the secondary animation, but unfortunately this property is not supported for the melee classlabel. You must now assign the animation banks to each weapon ODF as specified. When all of this is finished, munge your mission, anims, and side LVLs. You won't have to repeate steps 6-11 if followed correctly, unless you wish to add more weapons or change the assigned animations.

Example of a functional Melee ODF using Primary Animation
[WeaponClass]
ClassLabel          = "melee"

[Properties]
IconTexture     = "hud_knife_icon"
GeometryName        = "MonkSpade"
AnimationBank       = "tool" //overhead swing
CanDeflect = 0


Example of a functional Pistol ODF using Secondary Animation
[WeaponClass]
ClassLabel = "cannon"

[Properties]
AnimationBank = "cannon" // not to be confused with classlabel cannon!
FireAnim            = "2" // calls on human_lascannon_stand_shoot3
GeometryName = "coltrevolver"


Conclusion
There you have it, a builder and tutorial for everything needed to add custom weapon animations to your mods! You can improve these tools as needed but please retain the original readme and credits. If you have further questions or get stuck you can post on the thread for help. Also, if you find any animations that resemble a two-handed Scythe Sweep or a Spear Stab / Punch, please let me know.
       
Additional Information
http://www.swbfgamers.com/index.php?topic=8448
http://www.swbfgamers.com/index.php?topic=8089

Credits
Phobos - Custom Animation Builder, Batch Scripting, Discovering Animation Dummies & LasCannon Bank
MileHighGuy/Ginev - Yoda Animation Munger, Tutorials
Sereja - Tutorials, Helping Discover Custom Animations
Psych0fred - Assets, Mod Tools

Quote-----Bf1_yoda_v2_milehighguy readme-----

yoda bf1 version

my last link went down so heres a new one. it has bf2 animations by replacement of the gammorean's animations

there can only be 1 set of gamorean animations per map, i think.

I could not get his low res animation to stop stretching so i just used the high res.

I have included the unmunged animations so you can see how i did it.
i think the only way to get custom animations without modifying the common lvl is by using "gam" in the weapon and the new animation in the soldier odf.

credit me if you use.

credits:

pandemic/lucasarts: original art/odfs

Nice work--and thanks for the detailed write-up.

:cheers:
Quote from: Abraham Lincoln. on November 04, 1971, 12:34:40 PM
Don't believe everything you read on the internet

It's great to know that new builders are still coming out. :)
The BOBclan:  A Rich History


Quote from: Unit 33 on November 29, 2014, 03:44:44 AM
'Please, tell me more about the logistics of the design of laser swords being wielded by space wizards' - Some guy on the internet.