Page 1 of 1

Adding Wampa to Hero Assault Crashes

Posted: Tue Feb 02, 2016 2:56 pm
by yonilerner
Im trying to add the Wampa class to Hero Assault, but every time I attempt to spawn as the wampa, the game crashes. Here is my tat2g_eli.lua and BFront2.log (posted separately because of character limits).

Something to notice in the BFront2.log are the following lines:

Message Severity: 2
C:\Battlefront2\main\Battlefront2\Source\Combo.cpp(2290)
Combo[99276cd7]::State[ATTACK_CLAP]::Animation: failed to add 'stand_alternate_attack' [d316619f]

Im using the stock snw.lvl that comes with the game, and hoth hunt works fine, so I dont understand why this is happening.

I have removed a bunch of other characters to make room for the wampa and have jacked up a bunch of the memory pool sizes to compensate.

Thanks.
Hidden/Spoiler:
[code]
--
-- Copyright (c) 2005 Pandemic Studios, LLC. All rights reserved.
--
-- Mos Eisley Hero Deathmatch (uses Space Assault rules)
-- First team to reach 100 kills wins
--

ScriptCB_DoFile("setup_teams")
ScriptCB_DoFile("ObjectiveTDM")

---------------------------------------------------------------------------
-- ScriptPostLoad
---------------------------------------------------------------------------
function ScriptPostLoad()
EnableSPHeroRules()
-- This is the actual objective setup
TDM = ObjectiveTDM:New{teamATT = 1, teamDEF = 2,
multiplayerScoreLimit = 100,
textATT = "game.modes.tdm",
textDEF = "game.modes.tdm2", multiplayerRules = true, isCelebrityDeathmatch = true}
TDM:Start()

AddAIGoal(1, "Deathmatch", 100)
AddAIGoal(2, "Deathmatch", 100)
end

---------------------------------------------------------------------------
-- ScriptInit
---------------------------------------------------------------------------
function ScriptInit()
if(ScriptCB_GetPlatform() == "PS2") then
StealArtistHeap(1536*1024)
end
-- Designers, these two lines *MUST* be first!
SetPS2ModelMemory(2097152 + 65536 * 8)
ReadDataFile("ingame.lvl")

SetMaxFlyHeight(70)
SetMaxPlayerFlyHeight(70)
SetGroundFlyerMap(1);

SetMemoryPoolSize ("ClothData",50)
SetMemoryPoolSize ("Combo",60) -- should be ~ 2x number of jedi classes
SetMemoryPoolSize ("Combo::State",1000) -- should be ~12x #Combo
SetMemoryPoolSize ("Combo::Transition",1000) -- should be a bit bigger than #Combo::State
SetMemoryPoolSize ("Combo::Condition",1000) -- should be a bit bigger than #Combo::State
SetMemoryPoolSize ("Combo::Attack",1000) -- should be ~8-12x #Combo
SetMemoryPoolSize ("Combo::DamageSample",10000) -- should be ~8-12x #Combo::Attack
SetMemoryPoolSize ("Combo::Deflect",200) -- should be ~1x #combo

ALL = 1
IMP = 2
-- These variables do not change
ATT = 1
DEF = 2

ReadDataFile("sound\\tat.lvl;tat2gcw")
ReadDataFile("SIDE\\all.lvl",
"all_hero_luke_jedi"
--"all_hero_hansolo_tat",
--"all_hero_leia"
--"all_hero_chewbacca"
)

ReadDataFile("SIDE\\imp.lvl",
"imp_hero_darthvader",
"imp_hero_emperor"
--"imp_hero_bobafett"
)

ReadDataFile("SIDE\\rep.lvl",
"rep_hero_yoda",
"rep_hero_macewindu",
"rep_hero_anakin",
"rep_hero_aalya",
"rep_hero_kiyadimundi",
"rep_hero_obiwan")

ReadDataFile("SIDE\\cis.lvl",
"cis_hero_grievous",
"cis_hero_darthmaul",
"cis_hero_countdooku"
--"cis_hero_jangofett"
)

--[[ Turrets disabled
ReadDataFile("SIDE\\tur.lvl",
"tur_bldg_chaingun_roof",
"tur_weap_built_gunturret")
SetMemoryPoolSize("MountedTurret", 15)
--]]

ReadDataFile("SIDE\\snw.lvl", "snw_inf_wampa")

SetupTeams{
hero = {
team = ALL,
units = 32,
reinforcements = -1,
soldier = { "rep_hero_aalya",1,2},
assault = { "rep_hero_kiyadimundi", 1,2},
engineer= { "all_hero_luke_jedi", 1,2},
sniper = { "rep_hero_obiwan", 1,2},
officer = { "rep_hero_yoda", 1,2},
special = { "rep_hero_macewindu", 1,2},
},
}

--AddUnitClass(ALL,"all_hero_leia", 1,2)
--AddUnitClass(ALL,"rep_hero_aalya", 1,2)
--AddUnitClass(ALL,"rep_hero_kiyadimundi",1,2)

SetupTeams{
villain = {
team = IMP,
units = 32,
reinforcements = -1,
soldier = { "rep_hero_anakin", 1,2},
assault = { "imp_hero_darthvader",1,2},
engineer= { "cis_hero_darthmaul", 1,2},
sniper = { "cis_hero_countdooku", 1,2},
officer = { "cis_hero_grievous", 1,2},
special = { "imp_hero_emperor", 1,2},

},
}
--AddUnitClass(IMP, "rep_hero_anakin",1,2)
--AddUnitClass(IMP, "cis_hero_countdooku",1,2)
AddUnitClass(IMP, "snw_inf_wampa",0,0)

-- Level Stats
ClearWalkers()
SetMemoryPoolSize("EntityWalker", -2)
AddWalkerType(0, 0) -- special -> droidekas
AddWalkerType(1, 5) -- 1x2 (1 pair of legs)
AddWalkerType(2, 2) -- 2x2 (2 pairs of legs)
--AddWalkerType(3, 0) -- 3x2 (3 pairs of legs)


local weaponCnt = 96
SetMemoryPoolSize("Aimer", 90)
SetMemoryPoolSize("AmmoCounter", 269)
SetMemoryPoolSize("BaseHint", 320)
SetMemoryPoolSize("CommandWalker", 2)
SetMemoryPoolSize("ConnectivityGraphFollower", 56)
SetMemoryPoolSize("EnergyBar", 269)
SetMemoryPoolSize("EntityCloth",80)
SetMemoryPoolSize("EntityDefenseGridTurret", 0)
SetMemoryPoolSize("EntityDroid", 0)
SetMemoryPoolSize("EntityFlyer", 10) -- to account for 5 chewbaccas
SetMemoryPoolSize("EntityLight", 80,80) -- stupid trickery to actually set lights to 80
SetMemoryPoolSize("EntityPortableTurret", 40) -- nobody has autoturrets AFAIK - MZ
SetMemoryPoolSize("EntitySoundStream", 10)
SetMemoryPoolSize("EntitySoundStatic", 45)
SetMemoryPoolSize("FLEffectObject::OffsetMatrix", 120)
SetMemoryPoolSize("MountedTurret", 46)
SetMemoryPoolSize("Navigator", 63)
SetMemoryPoolSize("Obstacle", 667)
SetMemoryPoolSize("Ordnance", 80) -- not much ordnance going on in the level
SetMemoryPoolSize("OrdnanceTowCable", 40)
SetMemoryPoolSize("ParticleEmitter", 512)
SetMemoryPoolSize("ParticleEmitterInfoData", 512)
SetMemoryPoolSize("PathFollower", 63)
SetMemoryPoolSize("RedOmniLight", 240)
SetMemoryPoolSize("PathNode", 268)
SetMemoryPoolSize("ShieldEffect", 0)
SetMemoryPoolSize("TentacleSimulator", 24)
SetMemoryPoolSize("TreeGridStack", 329)
SetMemoryPoolSize("UnitAgent", 63)
SetMemoryPoolSize("UnitController", 63)
SetMemoryPoolSize("Weapon", 269)

ReadDataFile("TAT\\tat2.lvl", "tat2_tdm")

SetSpawnDelay(10.0, 0.25)
SetDenseEnvironment("false")
SetDefenderSnipeRange(170)

-- Sound Stats

ScriptCB_EnableHeroMusic(0)
ScriptCB_EnableHeroVO(0)

voiceSlow = OpenAudioStream("sound\\global.lvl", "all_unit_vo_slow")
AudioStreamAppendSegments("sound\\global.lvl", "imp_unit_vo_slow", voiceSlow)
AudioStreamAppendSegments("sound\\global.lvl", "global_vo_slow", voiceSlow)

voiceQuick = OpenAudioStream("sound\\global.lvl", "all_unit_vo_quick")
AudioStreamAppendSegments("sound\\global.lvl", "imp_unit_vo_quick", voiceQuick)

OpenAudioStream("sound\\global.lvl", "gcw_music")
OpenAudioStream("sound\\tat.lvl", "tat2")
OpenAudioStream("sound\\tat.lvl", "tat2")
-- OpenAudioStream("sound\\global.lvl", "global_vo_quick")
-- OpenAudioStream("sound\\global.lvl", "global_vo_slow")

SetBleedingVoiceOver(ALL, ALL, "all_off_com_report_us_overwhelmed", 1)
SetBleedingVoiceOver(ALL, IMP, "all_off_com_report_enemy_losing", 1)
SetBleedingVoiceOver(IMP, ALL, "imp_off_com_report_enemy_losing", 1)
SetBleedingVoiceOver(IMP, IMP, "imp_off_com_report_us_overwhelmed", 1)

SetLowReinforcementsVoiceOver(ALL, ALL, "all_off_defeat_im", .1, 1)
SetLowReinforcementsVoiceOver(ALL, IMP, "all_off_victory_im", .1, 1)
SetLowReinforcementsVoiceOver(IMP, IMP, "imp_off_defeat_im", .1, 1)
SetLowReinforcementsVoiceOver(IMP, ALL, "imp_off_victory_im", .1, 1)

SetOutOfBoundsVoiceOver(1, "Allleaving")
SetOutOfBoundsVoiceOver(2, "Impleaving")

SetAmbientMusic(ALL, 1.0, "gen_amb_celebDeathmatch", 0,1)
-- SetAmbientMusic(ALL, 0.9, "all_tat_amb_middle", 1,1)
-- SetAmbientMusic(ALL, 0.1, "all_tat_amb_end", 2,1)
SetAmbientMusic(IMP, 1.0, "gen_amb_celebDeathmatch", 0,1)
-- SetAmbientMusic(IMP, 0.9, "imp_tat_amb_middle", 1,1)
-- SetAmbientMusic(IMP, 0.1, "imp_tat_amb_end", 2,1)

SetVictoryMusic(ALL, "all_tat_amb_victory")
SetDefeatMusic (ALL, "all_tat_amb_defeat")
SetVictoryMusic(IMP, "imp_tat_amb_victory")
SetDefeatMusic (IMP, "imp_tat_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")

SetAttackingTeam(ATT)

-- Camera Stats
--Tat2 Mos Eisley
AddCameraShot(0.974338, -0.222180, 0.035172, 0.008020, -82.664650, 23.668301, 43.955681);
AddCameraShot(0.390197, -0.089729, -0.893040, -0.205362, 23.563562, 12.914885, -101.465561);
AddCameraShot(0.169759, 0.002225, -0.985398, 0.012916, 126.972809, 4.039628, -22.020613);
AddCameraShot(0.677453, -0.041535, 0.733016, 0.044942, 97.517807, 4.039628, 36.853477);
AddCameraShot(0.866029, -0.156506, 0.467299, 0.084449, 7.685640, 7.130688, -10.895234);
end
[/code]

Re: Adding Wampa to Hero Assault Crashes

Posted: Tue Feb 02, 2016 4:26 pm
by DylanRocket
I believe you've loaded too many units with unique animations. You'll have to remove some units like General Grievous.

Re: Adding Wampa to Hero Assault Crashes

Posted: Tue Feb 02, 2016 7:15 pm
by yonilerner
That worked, thank you. I had to remove a bunch of characters, not just GG, unfortunately, but it does work. I really appreciate the help.

Re: Adding Wampa to Hero Assault Crashes

Posted: Tue Feb 02, 2016 10:14 pm
by jedimoose32
Dang, what an unfortunate engine limitation. Sometimes (aka at least once every day) ZeroEngine frustrates me.

Re: Adding Wampa to Hero Assault Crashes

Posted: Wed Feb 03, 2016 2:26 am
by AceMastermind
Yeah I didn't realize how low the animation memory was in this game compared to SWBF1 until I was trying to help with the conversion of Sereja's Otoh Gunga map. There must be a way to increase those numbers in the exe somehow, maybe someone could hook it up to Ollydbg and find the address.