Animations don't work ingame [Solved]

In this forum you will find and post information regarding the modding of Star Wars Battlefront 2. DO NOT POST MOD IDEAS/REQUESTS.

Moderator: Moderators

Post Reply
User avatar
Anakin
Master of the Force
Master of the Force
Posts: 4817
Joined: Sat Sep 19, 2009 11:37 am
Projects :: RC Side Mod - Remastered - SWBF3 Legacy
Location: Mos Espa (germany)

Animations don't work ingame [Solved]

Post by Anakin »

Hi,

i have some problems to get an 3rd and an 1st person animation working.

fpanimset.req
Hidden/Spoiler:
[code]ucft
{
REQN
{
"zafbin"
"humanfp"
}

REQN
{
"zaabin"
"humanfp"
}
}[/code]
geo1r_con.lua
Hidden/Spoiler:
[code]--
-- Copyright (c) 2005 Pandemic Studios, LLC. All rights reserved.
--

-- load the gametype script
ScriptCB_DoFile("ObjectiveConquest")
ScriptCB_DoFile("setup_teams")

ReadDataFile("dc:common.lvl")
ReadDataFile("common.lvl")

-- REP Attacking (attacker is always #1)
REP = 1
CIS = 2
GEONO = 3
CLONEDEA = 4
JEDI = 5
CLONECON = 6
-- These variables do not change
ATT = 1
DEF = 2
---------------------------------------------------------------------------
-- FUNCTION: ScriptInit
-- PURPOSE: This function is only run once
-- INPUT:
-- OUTPUT:
-- NOTES: The name, 'ScriptInit' is a chosen convention, and each
-- mission script must contain a version of this function, as
-- it is called from C to start the mission.
---------------------------------------------------------------------------

function ScriptPostLoad()
cp1 = CommandPost:New{name = "cp1"}
cp2 = CommandPost:New{name = "cp2"}
cp3 = CommandPost:New{name = "cp3"}
cp4 = CommandPost:New{name = "cp4"}
cp6 = CommandPost:New{name = "cp6"}
cp7 = CommandPost:New{name = "cp7"}
cp8 = CommandPost:New{name = "cp8"}

--This sets up the actual objective. This needs to happen after cp's are defined
conquest = ObjectiveConquest:New{teamATT = ATT, teamDEF = DEF, text = "level.geo1.objectives.conquest", multiplayerRules = true}

--This adds the CPs to the objective. This needs to happen after the objective is set up
conquest:AddCommandPost(cp1)
conquest:AddCommandPost(cp2)
conquest:AddCommandPost(cp3)
conquest:AddCommandPost(cp4)
conquest:AddCommandPost(cp6)
conquest:AddCommandPost(cp7)
conquest:AddCommandPost(cp8)

conquest:Start()
SetUberMode(1)
EnableSPHeroRules()

AddDeathRegion("deathregion")
AddDeathRegion("deathregion2")
AddDeathRegion("deathregion3")
AddDeathRegion("deathregion4")
AddDeathRegion("deathregion5")

SetProperty("cp1", "AllyPath", "cp1_spawn")
SetProperty("cp2", "AllyPath", "cp2_spawn")
SetProperty("cp3", "AllyPath", "cp3_spawn")
SetProperty("cp4", "AllyPath", "cp4_spawn")
SetProperty("cp6", "AllyPath", "cp6_spawn")
SetProperty("cp7", "AllyPath", "cp7_spawn")
SetProperty("cp8", "AllyPath", "cp8_spawn")

end

function ScriptInit()
ReadDataFile("dc:Load\\RCM_Load.lvl")

StealArtistHeap(800*1024)
-- Designers, these two lines *MUST* be first.
SetPS2ModelMemory(3500000)

SetMemoryPoolSize("ParticleTransformer::SizeTransf", 2500)
SetMemoryPoolSize("ParticleTransformer::ColorTrans", 3000)
SetMemoryPoolSize("ParticleTransformer::PositionTr", 2500)
SetMemoryPoolSize ("ClothData",20)
SetMemoryPoolSize ("Combo",30) -- should be ~ 2x number of jedi classes
SetMemoryPoolSize ("Combo::State",500) -- should be ~12x #Combo
SetMemoryPoolSize ("Combo::Transition",500) -- should be a bit bigger than #Combo::State
SetMemoryPoolSize ("Combo::Condition",500) -- should be a bit bigger than #Combo::State
SetMemoryPoolSize ("Combo::Attack",400) -- should be ~8-12x #Combo
SetMemoryPoolSize ("Combo::DamageSample",4000) -- should be ~8-12x #Combo::Attack
SetMemoryPoolSize ("Combo::Deflect",88) -- should be ~1x #combo

local screenWidth, screenHeight = ScriptCB_GetScreenInfo()

ReadDataFile("dc:SIDE\\fpanimset.lvl")

if screenHeight == 1080 and screenWidth == 1920 then
ReadDataFile("dc:HUD\\hud1920x1080.lvl")
ReadDataFile("ingame.lvl")
ReadDataFile("dc:HUD\\hudBmpKill.lvl")
else
ReadDataFile("dc:HUD\\hud1024x768.lvl")
ReadDataFile("ingame.lvl")
end



SetTeamAggressiveness(CIS, 1.0)
SetTeamAggressiveness(REP, 0.5)

SetMemoryPoolSize("Music", 40)
ReadDataFile("dc:sound\\rcm.lvl;comSnd")
ReadDataFile("dc:sound\\rcm.lvl")
ReadDataFile("sound\\geo.lvl;geo1cw")

ReadDataFile("SIDE\\jed.lvl",
"jed_knight_01",
"jed_knight_02",
"jed_knight_03",
"jed_master_01",
"jed_master_02")

ReadDataFile("SIDE\\cis.lvl",
"cis_fly_droidfighter_dome",
--"cis_fly_geofighter",
"cis_tread_hailfire",
"cis_hover_stap",
"cis_walk_spider")

ReadDataFile("SIDE\\rep.lvl",
"rep_fly_assault_dome",
"rep_fly_gunship_dome",
"rep_hover_fightertank",
--"rep_fly_gunship",
--"rep_bldg_forwardcenter",
"rep_fly_jedifighter_dome",
"rep_walk_atte")

ReadDataFile("dc:SIDE\\rep.lvl",
"rep_inf_commando_01_rifleman",
"rep_inf_commando_02_roketeer",
"rep_inf_commando_03_sniper",
"rep_inf_commando_04_engineer",
"rep_inf_commando_05_electronic",
"rep_inf_commando_06_sergeant",
"rep_inf_commando_07_havoc",
"rep_inf_commando_08_elite")

ReadDataFile("dc:SIDE\\cis.lvl",
"cis_inf_b1_rifleman",
"cis_inf_b1_rocketeer",
"cis_inf_b1_sniper",
"cis_inf_sbd",
"cis_inf_magnaguard",
"cis_inf_droideka")

ReadDataFile("dc:SIDE\\geo.lvl",
"geo_inf_geonosian",
"geo_inf_geonosian_elite")

ReadDataFile("SIDE\\tur.lvl",
"tur_bldg_geoturret")

ReadDataFile("dc:SIDE\\rrl.lvl",
"rrl_inf_ep2_rifleman",
"rrl_inf_ep2_commander",
"rrl_inf_ep2_jettrooper")

-- GEOS ---------------------------
SetTeamName(3, "locals")
AddUnitClass(3, "geo_inf_geonosian", 7)
AddUnitClass(3, "geo_inf_geonosian_elite", 7)
SetUnitCount(3, 7)
AddAIGoal(GEONO, "Deathmatch", 100)
-----------------------------------

-- Jedi ---------------------------
SetTeamName (5, "jedi")
AddUnitClass(5, "jed_knight_01",4)
AddUnitClass(5, "jed_knight_02",4)
AddUnitClass(5, "jed_knight_03",4)
AddUnitClass(5, "jed_master_01",2)
AddUnitClass(5, "jed_master_02",2)
SetUnitCount (5, 10)
AddAIGoal(JEDI, "Deathmatch", 100)
-----------------------------------

-- Clones -------------------------
SetTeamName (4, "clone")
AddUnitClass (4, "rrl_inf_ep2_rifleman", 15)
AddUnitClass (4, "rrl_inf_ep2_jettrooper", 5)
AddUnitClass(4, "rrl_inf_ep2_commander",3)
SetUnitCount (4, 8)
AddAIGoal(CLONEDEA, "Deathmatch", 100)
-----------------------------------

-- Clones -------------------------
SetTeamName (6, "clone")
AddUnitClass (6, "rrl_inf_ep2_rifleman", 15)
AddUnitClass (6, "rrl_inf_ep2_jettrooper", 5)
AddUnitClass(6, "rrl_inf_ep2_commander",3)
SetUnitCount (6, 7)
AddAIGoal(CLONECON, "Conquest", 100)
-----------------------------------

-- Friends ------------------------
SetTeamAsFriend(REP,JEDI)
SetTeamAsFriend(JEDI,REP)

SetTeamAsFriend(REP,CLONECON)
SetTeamAsFriend(CLONECON,REP)

SetTeamAsFriend(REP,CLONEDEA)
SetTeamAsFriend(CLONEDEA,REP)

SetTeamAsFriend(JEDI,CLONECON)
SetTeamAsFriend(CLONECON,JEDI)

SetTeamAsFriend(JEDI,CLONEDEA)
SetTeamAsFriend(CLONEDEA,JEDI)

SetTeamAsFriend(CLONECON,CLONEDEA)
SetTeamAsFriend(CLONEDEA,CLONECON)

SetTeamAsFriend(CIS,GEONO)
SetTeamAsFriend(GEONO,CIS)
-----------------------------------

-- Enemys -------------------------
SetTeamAsEnemy(REP,GEONO)
SetTeamAsEnemy(GEONO,REP)

SetTeamAsEnemy(GEONO,JEDI)
SetTeamAsEnemy(JEDI,GEONO)

SetTeamAsEnemy(GEONO,CLONECON)
SetTeamAsEnemy(CLONECON,GEONO)

SetTeamAsEnemy(GEONO,CLONEDEA)
SetTeamAsEnemy(CLONEDEA,GEONO)

SetTeamAsEnemy(CIS,JEDI)
SetTeamAsEnemy(JEDI,CIS)

SetTeamAsEnemy(CIS,CLONECON)
SetTeamAsEnemy(CLONECON,CIS)

SetTeamAsEnemy(CIS,CLONEDEA)
SetTeamAsEnemy(CLONEDEA,CIS)
-----------------------------------

-- Level Stats

ClearWalkers()
SetMemoryPoolSize("EntityWalker", -1)
AddWalkerType(0, 3) -- 8 droidekas (special case: 0 leg pairs)
AddWalkerType(2, 3) -- 2 spider walkers with 2 leg pairs each
AddWalkerType(3, 0) -- 2 attes with 3 leg pairs each
local weaponcnt = 300
SetMemoryPoolSize("Aimer", 100)
SetMemoryPoolSize("AmmoCounter", weaponcnt)
SetMemoryPoolSize("BaseHint", 100)
SetMemoryPoolSize("CommandWalker", 1)
SetMemoryPoolSize("EnergyBar", weaponcnt)
SetMemoryPoolSize("EntityFlyer", 6)
SetMemoryPoolSize("EntityHover", 32)
SetMemoryPoolSize("EntityLight", 50)
SetMemoryPoolSize("EntityCloth", 50)
SetMemoryPoolSize("EntitySoundStream", 4)
SetMemoryPoolSize("MountedTurret", 10)
SetMemoryPoolSize("Navigator", 70)
SetMemoryPoolSize("Obstacle", 450)
SetMemoryPoolSize("PathFollower", 70)
SetMemoryPoolSize("PathNode", 100)
SetMemoryPoolSize("TreeGridStack", 300)
SetMemoryPoolSize("UnitAgent", 70)
SetMemoryPoolSize("UnitController", 70)
SetMemoryPoolSize("Weapon", weaponcnt)
SetMemoryPoolSize("SoldierAnimation", 580)

SetSpawnDelay(10.0, 0.25)

SetupTeams{
rep = {
team = REP,
units = 16,
reinforcements = 150,
soldier = { "rep_inf_commando_01_rifleman",9, 25},
assault = { "rep_inf_commando_02_roketeer",1,4},
sniper = { "rep_inf_commando_03_sniper",1,4},
engineer= { "rep_inf_commando_04_engineer",1,4},
officer = { "rep_inf_commando_05_electronic",1,4},
special = { "rep_inf_commando_06_sergeant",1,4},
commander={ "rep_inf_commando_07_havoc", 1, 4},
general = { "rep_inf_commando_08_elite", 1, 2}
},
cis = {
team = CIS,
units = 32,
reinforcements = 300,
soldier = {"cis_inf_b1_rifleman",10, 30},
assault = {"cis_inf_b1_rocketeer",1, 4},
sniper = {"cis_inf_b1_sniper",1, 4},
engineer= {"geo_inf_geonosian",1, 6},
officer = {"cis_inf_sbd",1, 2},
special = {"geo_inf_geonosian_elite", 1, 2},
commander={"cis_inf_droideka", 1, 2},
general = {"cis_inf_magnaguard", 1, 2},
}
}




-- Attacker Stats

--teamATT = ConquestTeam:New{team = ATT}
--teamATT:AddBleedThreshold(21, 0.75)
--teamATT:AddBleedThreshold(11, 2.25)
--teamATT:AddBleedThreshold(1, 3.0)
--teamATT:Init()

-- Defender Stats

--teamDEF = ConquestTeam:New{team = DEF}
--teamDEF:AddBleedThreshold(21, 0.75)
--teamDEF:AddBleedThreshold(11, 2.25)
--teamDEF:AddBleedThreshold(1, 3.0)
--teamDEF:Init()

-- Local Stats

--SetTeamName(4, "locals")
--AddUnitClass(4, "rep_inf_jedimale",1)
--AddUnitClass(4, "rep_inf_jedimaleb",1)
--AddUnitClass(4, "rep_inf_jedimaley",1)
--SetUnitCount(4, 3)
--SetTeamAsFriend(4, ATT)

ReadDataFile("GEO\\geo1.lvl", "geo1_conquest")

SetDenseEnvironment("false")
SetMinFlyHeight(-65)
SetMaxFlyHeight(50)
SetMaxPlayerFlyHeight(50)



-- Birdies
--SetNumBirdTypes(1)
--SetBirdType(0.0,10.0,"dragon")
--SetBirdFlockMinHeight(90.0)

-- Sound

voiceSlow = OpenAudioStream("sound\\global.lvl", "rep_unit_vo_slow")
AudioStreamAppendSegments("sound\\global.lvl", "cis_unit_vo_slow", voiceSlow)
AudioStreamAppendSegments("sound\\global.lvl", "global_vo_slow", voiceSlow)

voiceQuick = OpenAudioStream("sound\\global.lvl", "rep_unit_vo_quick")
AudioStreamAppendSegments("sound\\global.lvl", "cis_unit_vo_quick", voiceQuick)

OpenAudioStream("dc:sound\\rcm.lvl", "rcm_music")
OpenAudioStream("sound\\global.lvl", "cw_music")
-- OpenAudioStream("sound\\global.lvl", "global_vo_quick")
-- OpenAudioStream("sound\\global.lvl", "global_vo_slow")
OpenAudioStream("sound\\geo.lvl", "geo1cw")
OpenAudioStream("sound\\geo.lvl", "geo1cw")

SetBleedingVoiceOver(REP, REP, "rep_off_com_report_us_overwhelmed", 1)
SetBleedingVoiceOver(REP, CIS, "rep_off_com_report_enemy_losing", 1)
SetBleedingVoiceOver(CIS, REP, "cis_off_com_report_enemy_losing", 1)
SetBleedingVoiceOver(CIS, CIS, "cis_off_com_report_us_overwhelmed", 1)

SetLowReinforcementsVoiceOver(REP, REP, "rep_off_defeat_im", .1, 1)
SetLowReinforcementsVoiceOver(REP, CIS, "rep_off_victory_im", .1, 1)
SetLowReinforcementsVoiceOver(CIS, CIS, "cis_off_defeat_im", .1, 1)
SetLowReinforcementsVoiceOver(CIS, REP, "cis_off_victory_im", .1, 1)

SetOutOfBoundsVoiceOver(1, "repleaving")
SetOutOfBoundsVoiceOver(2, "cisleaving")

SetAmbientMusic(REP, 1.0, "rep_amb_start", 0,1)
SetAmbientMusic(REP, 0.8, "rep_amb_middle", 1,1)
SetAmbientMusic(REP, 0.2, "rep_amb_end", 2,1)
SetAmbientMusic(CIS, 1.0, "cis_amb_start", 0,1)
SetAmbientMusic(CIS, 0.8, "cis_amb_middle", 1,1)
SetAmbientMusic(CIS, 0.2, "cis_amb_end", 2,1)

SetVictoryMusic(REP, "rep_geo_amb_victory")
SetDefeatMusic (REP, "rep_geo_amb_defeat")
SetVictoryMusic(CIS, "cis_geo_amb_victory")
SetDefeatMusic (CIS, "cis_geo_amb_defeat")

SetSoundEffect("ScopeDisplayZoomIn", "binocularzoomin")
SetSoundEffect("ScopeDisplayZoomOut", "binocularzoomout")
--SetSoundEffect("WeaponUnableSelect", "com_weap_inf_weaponchange_null")
--SetSoundEffect("WeaponModeUnableSelect", "com_weap_inf_modechange_null")
SetSoundEffect("SpawnDisplayUnitChange", "shell_select_unit")
SetSoundEffect("SpawnDisplayUnitAccept", "shell_menu_enter")
SetSoundEffect("SpawnDisplaySpawnPointChange", "shell_select_change")
SetSoundEffect("SpawnDisplaySpawnPointAccept", "shell_menu_enter")
SetSoundEffect("SpawnDisplayBack", "shell_menu_exit")


--ActivateBonus(CIS, "SNEAK_ATTACK")
--ActivateBonus(REP, "SNEAK_ATTACK")

SetAttackingTeam(ATT)

--Opening Satalite Shot
--Geo
--Mountain
AddCameraShot(0.996091, 0.085528, -0.022005, 0.001889, -6.942698, -59.197201, 26.136919)
--Wrecked Ship
AddCameraShot(0.906778, 0.081875, -0.411906, 0.037192, 26.373968, -59.937874, 122.553581)
--War Room
--AddCameraShot(0.994219, 0.074374, 0.077228, -0.005777, 90.939568, -49.293945, -69.571136)


if screenHeight == 1080 and screenWidth == 1920 then
ReadDataFile("dc:SIDE\\1920x1080.lvl")
ReadDataFile("dc:HUD\\hudTxtKill.lvl")
else
ReadDataFile("dc:SIDE\\1024x768.lvl")
end

end

[/code]
rep_weap_wrist_vibroblade.odf
Hidden/Spoiler:
[code][WeaponClass]
ClassLabel = "cannon"
GeometryName = "vibroblade.msh"

[Properties]
GeometryName = "vibroblade"
HighResGeometry = "vibroblade_fp"
HUDTag = "hud_rc_vibro"

CustomAnimationBank = "knife bazooka"

RoundsPerClip = "0"
ReloadTime = "0.3"
HeatRecoverRate = "0.2"
HeatThreshold = "0.0"

//FirePointName = "hp_fire"

TriggerSingle = "1"
ShotDelay = "0.5"
HeatPerShot = "0.0"
MaxPressedTime = "1.0"

MinRange = 0
OptimalRange = 1
MaxRange = 2

LockOnRange = "2.0"
LockTime = "0.0"
AutoAimSize = "2.0"

SalvoCount = "1"
ShotsPerSalvo = "1"
SalvoDelay = "0.0"
SalvoTime = "0.0"
InitialSalvoDelay = "0.5" // must have one or no animation - Mike Z

FireAnim = "2"
InstantPlayFireAnim = "1"
OffhandWeapon = 1

TargetEnemy = "1"
TargetNeutral = "1"
TargetFriendly = "0"

TargetPerson = "1"
TargetAnimal = "1"
TargetDroid = "1"
TargetVehicle = "0"
TargetBuilding = "0"

AITargetPerson = "0"
AITargetAnimal = "0"
AITargetDroid = "0"
AITargetVehicle = "0"
AITargetBuilding = "0"

//SOUND
FireSound = "snd_rc_vibro_attack"
//ReloadSound = ""
WeaponChangeSound = ""
ChangeModeSound = ""
FireEmptySound = ""
ChargeSound = ""
ChargeSoundPitch = "0.05"
OverheatSound = ""
OverheatSoundPitch = "0.5"
OverheatStopSound = ""

OrdnanceName = "rep_weap_wrist_vibroblade_ord"
EnergyDrain = 20.0

NEXTCHARGE = "0.25"
OrdnanceName = "rep_weap_wrist_vibroblade_ord2"
EnergyDrain = 60.0[/code]
fp animation goes to fpanimset.lvl, an custom side with just the fp animation, and the 3rd animation is integrated in my commando animation, that contains some more animations, such as darthDUCK's pistol animation, the z6 animation,...
If you need any more informations please tell me.


==EDIT==

there can't be everything wrong. The fp animation works fine for the CIS bazooka ;) looks a bit funny an vibro animation for the bazooka, but ok it's working. But why not for the vibro??
Last edited by Anakin on Mon Dec 22, 2014 10:30 am, edited 1 time in total.
User avatar
Nedarb7
Lieutenant General
Lieutenant General
Posts: 676
Joined: Sat Sep 22, 2012 3:41 pm

Re: Animations don't work ingame

Post by Nedarb7 »

FireAnim = "2"
InstantPlayFireAnim = "1"
OffhandWeapon = 1
There should only be instantplayfireanim = 1, the other lines need to be removed.
User avatar
Anakin
Master of the Force
Master of the Force
Posts: 4817
Joined: Sat Sep 19, 2009 11:37 am
Projects :: RC Side Mod - Remastered - SWBF3 Legacy
Location: Mos Espa (germany)

Re: Animations don't work ingame [solved]

Post by Anakin »

Thank you. Now i need to fix the cis bazooka animation. You told me something in your release thread. Just that i understood everything right:

1. change the animationbank from "bazooka" to "rocket pistol"
2. copy all cis bazooka animation msh from the assets, rename to rocket, munge the animation and use this for the roketeer b1.
Hidden/Spoiler:
3. take Felucia screenies
4. munge the new screenies
5 release SWRCM :D
User avatar
Nedarb7
Lieutenant General
Lieutenant General
Posts: 676
Joined: Sat Sep 22, 2012 3:41 pm

Re: Animations don't work ingame [solved]

Post by Nedarb7 »

OPTION A

1. Change AnimationBank = "bazooka" to CustomAnimationBank = "bazooka pistol"
2. Make the unit's weapons have an arm attached to it.

If that doesn't work...

OPTION B

1. Change AnimationBank = "bazooka" to CustomAnimationBank = "rocket pistol"
2. Make an animation set for the unit, using the bdroid basepose from the assets, and copy all the bazooka animations for the human animation set, change the "bazooka" part of those files to "rocket"
3. Munge that.
4. Make the unit use the animation set by using AnimationName = "nameofnewset" (if that doesn't work try SkeletonName = "nameofnewset")
5. Do step two of the first option
Last edited by Nedarb7 on Mon Dec 22, 2014 10:44 am, edited 1 time in total.
User avatar
Anakin
Master of the Force
Master of the Force
Posts: 4817
Joined: Sat Sep 19, 2009 11:37 am
Projects :: RC Side Mod - Remastered - SWBF3 Legacy
Location: Mos Espa (germany)

Re: Animations don't work ingame [solved]

Post by Anakin »

why 2.?? at the stock bazooka fp animation is only 1 arm on the weapon
User avatar
Nedarb7
Lieutenant General
Lieutenant General
Posts: 676
Joined: Sat Sep 22, 2012 3:41 pm

Re: Animations don't work ingame [solved]

Post by Nedarb7 »

That was if you wanted an offset I guess. Since in first person the bazooka was held a little bit more elevated to the right. (if you decided to do that the unit would need a new fp model that only has the left arm)... also added option b to that post.
User avatar
Anakin
Master of the Force
Master of the Force
Posts: 4817
Joined: Sat Sep 19, 2009 11:37 am
Projects :: RC Side Mod - Remastered - SWBF3 Legacy
Location: Mos Espa (germany)

Re: Animations don't work ingame [solved]

Post by Anakin »

I got lots of these errors:
Message Severity: 3
C:\Battlefront2\main\Battlefront2\Source\DisplaySoldier.cpp(349)
DisplaySoldier 'cis_inf_b1_rocketeer' failed to find animmap rcbdroid_


I took all human_bazooka_... msh put them in my rcbdroid folder and renamed them to rcbdroid_rocket_...

Haha found the problem when i looked up the odf to copy it here. CustomAnimationBank :D

and now i know why i need to edit the weapon ;) looks very funny. the 3rd person looks like stock now ;)
Post Reply