Page 1 of 1

Walkers don't show up [Solved]

Posted: Sun Jan 10, 2010 11:26 pm
by genaral_mitch
My walkers in Felucia won't spawn because they're not correctly filled out in memory pools. Problem is, I don't know where the problem is.

Here's my lua
Hidden/Spoiler:
--
-- Copyright (c) 2005 Pandemic Studios, LLC. All rights reserved.
--

ScriptCB_DoFile("setup_teams")
ScriptCB_DoFile("ObjectiveConquest")

---------------------------------------------------------------------------
-- 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()
--This defines the CPs. These need to happen first
cp1 = CommandPost:New{name = "cp1-1"}
cp2 = CommandPost:New{name = "cp2-1"}
cp3 = CommandPost:New{name = "cp3-1"}
cp4 = CommandPost:New{name = "cp4-1"}
cp5 = CommandPost:New{name = "cp5-1"}
cp6 = CommandPost:New{name = "cp6-1"}
cp7 = CommandPost:New{name = "cp7"}
cp8 = CommandPost:New{name = "cp10"}
cp9 = CommandPost:New{name = "cp11"}
cp10 = CommandPost:New{name = "cp12"}


--This sets up the actual objective. This needs to happen after cp's are defined
conquest = ObjectiveConquest:New{teamATT = ATT, teamDEF = DEF, textATT = "game.modes.con", textDEF = "game.modes.con2", 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(cp5)
conquest:AddCommandPost(cp6)
conquest:AddCommandPost(cp7)
conquest:AddCommandPost(cp8)
conquest:AddCommandPost(cp9)
conquest:AddCommandPost(cp10)

conquest:Start()


SetUberMode(1);

EnableSPHeroRules()

end

function ScriptInit()
StealArtistHeap(132*1024)
-- Designers, these two lines *MUST* be first.
SetPS2ModelMemory(3200000)
ReadDataFile("ingame.lvl")

-- Republic Attacking (attacker is always #1)
local REP = 1
local CIS = 2
-- These variables do not change
local ATT = 1
local DEF = 2

SetMemoryPoolSize("Music", 39)


ReadDataFile("sound\\fel.lvl;fel1cw")
SetMaxFlyHeight(200)
SetMaxPlayerFlyHeight (200)
ReadDataFile("dc:SIDE\\rep.lvl",
"rep_inf_327th_trooper_1",
"rep_inf_327th_trooper_2",
"rep_inf_327th_trooper_3",
"rep_inf_327th_trooper_5",
"rep_inf_commander_deviss",
"rep_inf_commander_bly",
"rep_hero_aalya",
"rep_walk_oneman_atst",
"rep_hover_barcspeeder",
"rep_walk_atte")
ReadDataFile("dc:SIDE\\cis.lvl",
"cis_inf_rifleman",
"cis_inf_rocketeer",
"cis_inf_engineer",
"cis_inf_sniper",
"CIS_inf_marine",
"cis_inf_droideka",
"cis_oom_droid",
"cis_hero_jangofett",
"cis_tread_snailtank")
ReadDataFile("dc:SIDE\\dwarf.lvl",
"cis_walk_dwarfspider")

--ReadDataFile("SIDE\\geo.lvl",
--"geo_walk_acklay")

SetAttackingTeam(ATT)
SetupTeams{
rep = {
team = REP,
units = 70,
reinforcements = 330,
soldier = { "rep_inf_327th_trooper_1",25, 25},
assault = { "rep_inf_327th_trooper_2",8, 8},
engineer = { "rep_inf_327th_trooper_3",4, 4},
sniper = { "rep_inf_327th_trooper_5",4, 4},
officer = { "rep_inf_commander_deviss",2, 2},
special = { "rep_inf_commander_bly",2, 2},

},
cis = {
team = CIS,
units = 70,
reinforcements = 300,
soldier = { "CIS_inf_engineer",25, 25},
assault = { "CIS_inf_rocketeer",4, 4},
engineer = { "CIS_inf_sniper",4, 4},
sniper = { "CIS_inf_marine",4, 4},
officer = { "CIS_inf_rifleman",8, 8},
special = { "cis_inf_droideka",4, 4},

},

}
AddUnitClass(CIS, "cis_oom_droid",4,4)


SetHeroClass(REP, "rep_HERO_aalya")
SetHeroClass(CIS, "cis_hero_jangofett")


-- Level Stats
ClearWalkers()
AddWalkerType(0, 3)
AddWalkerType(2, 3) -- 2 attes with 2 leg pairs each
AddWalkerType(3, 0) -- 3 acklays with 3 leg pairs each
local weaponCnt = 260
SetMemoryPoolSize("Aimer", 20)
SetMemoryPoolSize("AmmoCounter", weaponCnt)
SetMemoryPoolSize("BaseHint", 200)
SetMemoryPoolSize("EnergyBar", weaponCnt)
SetMemoryPoolSize("EntityHover", 3)
SetMemoryPoolSize("EntityFlyer", 6)
SetMemoryPoolSize("EntitySoundStream", 1)
SetMemoryPoolSize("EntitySoundStatic", 0)
SetMemoryPoolSize("EntityWalker", 6)
SetMemoryPoolSize("CommandWalker", 1)
SetMemoryPoolSize("MountedTurret", 6)
SetMemoryPoolSize("Obstacle", 400)
SetMemoryPoolSize("PathNode", 512)
SetMemoryPoolSize("TreeGridStack", 280)
SetMemoryPoolSize("Weapon", weaponCnt)

SetSpawnDelay(10.0, 0.25)
ReadDataFile("dc:FAL\\fel1.lvl", "fel1_conquest")
SetDenseEnvironment("false")
SetAIViewMultiplier(0.65)
--AddDeathRegion("Sarlac01")

-- Birdies
SetNumBirdTypes(1)
SetBirdType(0,1.0,"bird")


-- Sound Stats

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("sound\\global.lvl", "cw_music")
OpenAudioStream("sound\\fel.lvl", "fel1")
OpenAudioStream("sound\\fel.lvl", "fel1")
-- OpenAudioStream("sound\\global.lvl", "global_vo_quick")
-- OpenAudioStream("sound\\global.lvl", "global_vo_slow")
-- OpenAudioStream("sound\\fel.lvl", "fel1_emt")

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)

SetOutOfBoundsVoiceOver(1, "Repleaving")
SetOutOfBoundsVoiceOver(2, "Cisleaving")

SetAmbientMusic(REP, 1.0, "rep_fel_amb_start", 0,1)
SetAmbientMusic(REP, 0.8, "rep_fel_amb_middle", 1,1)
SetAmbientMusic(REP, 0.2,"rep_fel_amb_end", 2,1)
SetAmbientMusic(CIS, 1.0, "cis_fel_amb_start", 0,1)
SetAmbientMusic(CIS, 0.8, "cis_fel_amb_middle", 1,1)
SetAmbientMusic(CIS, 0.2,"cis_fel_amb_end", 2,1)

SetVictoryMusic(REP, "rep_fel_amb_victory")
SetDefeatMusic (REP, "rep_fel_amb_defeat")
SetVictoryMusic(CIS, "cis_fel_amb_victory")
SetDefeatMusic (CIS, "cis_fel_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")



-- Camera Stats
AddCameraShot(0.896307, -0.171348, -0.401716, -0.076796, -116.306931, 31.039505, 20.757469)
AddCameraShot(0.909343, -0.201967, -0.355083, -0.078865, -116.306931, 31.039505, 20.757469)
AddCameraShot(0.543199, 0.115521, -0.813428, 0.172990, -108.378189, 13.564240, -40.644150)
AddCameraShot(0.970610, 0.135659, 0.196866, -0.027515, -3.214346, 11.924586, -44.687294)
AddCameraShot(0.346130, 0.046311, -0.928766, 0.124267, 87.431061, 20.881388, 13.070729)
AddCameraShot(0.468084, 0.095611, -0.860724, 0.175812, 18.063482, 19.360580, 18.178158)



end

Re: Need help with lua

Posted: Sun Jan 10, 2010 11:39 pm
by Eggman
It's probably this:

Code: Select all

AddWalkerType(0, 3)
AddWalkerType(2, 3) -- 2 attes with 2 leg pairs each
AddWalkerType(3, 0) -- 3 acklays with 3 leg pairs each
You're telling the map to load zero walkers with three leg pairs and two walkers with three leg pairs at the same time. I'd be confused too.

Re: Need help with lua

Posted: Mon Jan 11, 2010 12:00 am
by genaral_mitch
I tried that, but they still don't show up. I have 1 atte and 2 Dwarf spider droids.

Re: Need help with lua

Posted: Mon Jan 11, 2010 12:47 am
by 501st_commander
please, stop with the center hide tags.. its hard to read luas like that..

-We need the error log.
-Is the spawns set up correctly in the world?

Re: Need help with lua

Posted: Mon Jan 11, 2010 8:03 pm
by genaral_mitch
-No errors in log regarding atte
-Yes, same way I did it with speeder.

Re: Need help with lua

Posted: Mon Jan 11, 2010 8:13 pm
by Fiodis
Eggman wrote:It's probably this:

Code: Select all

AddWalkerType(0, 3)
AddWalkerType(2, 3) -- 2 attes with 2 leg pairs each
AddWalkerType(3, 0) -- 3 acklays with 3 leg pairs each
You're telling the map to load zero walkers with three leg pairs and two walkers with three leg pairs at the same time. I'd be confused too.
I think it's AddWalkerType(leg pairs, number of walkers).

In which case it ought to look like, for 1 ATTE (3 leg pairs) and 2 Dwarf Spiders:

Code: Select all

AddWalkerType(2, 2)
AddWalkerType(3, 1)
That's assuming Dwarf Spiders have four legs. I'm sketchy on the details, never used that particular model.
And I'm too lazy to look it up.
:P

Re: Need help with lua

Posted: Mon Jan 11, 2010 8:38 pm
by genaral_mitch
That didn't help. Does "ClearWalkers()" mean anything? Like clear all walkers from map?

Re: Need help with lua

Posted: Tue Jan 12, 2010 1:39 pm
by theultimat
genaral_mitch wrote:That didn't help. Does "ClearWalkers()" mean anything? Like clear all walkers from map?
That prevents any walkers spawning on the map, I believe.

Re: Need help with lua

Posted: Tue Jan 12, 2010 2:19 pm
by genaral_mitch
Okay, I solved the atte problem, but I can't figure out the mini spider problem. The atte was because I didn't even have the files in my rep side! I figured that I did that in the assets. Luckily, I have an extra copy of the modtools.

Re: Need help with lua

Posted: Tue Jan 12, 2010 2:24 pm
by MercuryNoodles
Battlefront II Mission LUA Guide.doc wrote:ClearWalkers wipes out any allocations that may have been done automatically for walkers. You’ll need to have this line in, and uncommented if you want to have walkers in your level.

-- ClearWalkers()

These next lines will add walkers to your level. The first number inside the parenthesis specifies how many leg pairs the walker type has. Droidekas are set up as a special case, with 0 leg pairs. So as you can see below, we have AddWalkerType(0,4) this specifies that we will have 4 walkers with 0 leg pairs (droidekas). 1 leg pair would specify a walker with one pair of legs, an ATST for example, or a one-man ATST from the clone wars era. So for 2 ATSTs, we would have a line that says; AddWalkerType(1, 2)
2 leg pairs would be a unit like the CIS spider walker, or an ATAT, and 3 leg pairs would be the 6-legged walker from the clone wars era.
AddWalkerType(0, 4) -- special -> droidekas
AddWalkerType(1, 0) -- 1x2 (1 pair of legs)
AddWalkerType(2, 0) -- 2x2 (2 pairs of legs)
AddWalkerType(3, 0) -- 3x2 (3 pairs of legs)
LuaNotes.txt wrote:If you have CommandWalkers in your mission, you usually have to do something like this:

ClearWalkers()
AddWalkerType(2, <count>)
SetMemoryPoolSize("CommandWalker", <count>)

This creates an unnecessary walker slot which never gets used, wasting memory.


Well, you can be clever:

ClearWalkers()
SetMemoryPoolSize("EntityWalker", -<count>)
AddWalkerType(2, <count>)
SetMemoryPoolSize("CommandWalker", <count>)

(Note the "-" in the EntityWalker pool)

This will eliminate those unused slots.
*ahem* :P

Re: Need help with lua

Posted: Tue Jan 12, 2010 3:46 pm
by DarthD.U.C.K.
ItTs unkool to lOOk in the doCS or evenREaD them LeT alone looking for FURteR docs (reading them is a total phail!)
:eek: :greeny: :amidala:
you should know that mercury!
Hidden/Spoiler:
dont take that serously please - just move on...

Re: Need help with lua

Posted: Tue Jan 12, 2010 3:49 pm
by Darth_Spiderpig
DarthD.U.C.K. wrote:ItTs unkool to lOOk in the doCS or evenREaD them LeT alone looking for FURteR docs (reading them is a total phail!) :thumbs: :greeny: :amidala:
you should know that mercury!
Hidden/Spoiler:
dont take that serously please - just move on...

:|

Ookay.

Re: Need help with lua

Posted: Tue Jan 12, 2010 5:15 pm
by genaral_mitch
Okay, put mini spider;s files in cis side, and it works now, therefore, solved.