Local sides not spawning more than one unit [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

THEWULFMAN
Space Ranger
Posts: 5557
Joined: Tue Aug 17, 2010 3:30 pm
Projects :: Evolved 2
Location: Columbus, Ohio
Contact:

Re: local sides not spawning more than one unit

Post by THEWULFMAN »

ZoomV wrote:I had already figured out the acklays.

I know you had. :P I was merely showing why using Notepad++ is so great.
Anakin wrote:@THEWULFMAN: I always like your gifs :D everytime you post a picture i wait for it to do something.
Image
ZoomV
Rebel Warrant Officer
Rebel Warrant Officer
Posts: 308
Joined: Thu Aug 15, 2013 11:27 am
Projects :: Old Republic Map pack
Games I'm Playing :: BF2 SWTOR and GW2
xbox live or psn: No gamertag set
Location: Belsavis, Maximum Security Ward

Re: local sides not spawning more than one unit

Post by ZoomV »

Does Notepad++ also hold the secrets to why my local sides aren't working properly?
THEWULFMAN
Space Ranger
Posts: 5557
Joined: Tue Aug 17, 2010 3:30 pm
Projects :: Evolved 2
Location: Columbus, Ohio
Contact:

Re: local sides not spawning more than one unit

Post by THEWULFMAN »

ZoomV wrote:Does Notepad++ also hold the secrets to why my local sides aren't working properly?

Maybe, but it does know why kids love the taste of Cinnamon Toast Crunch.

Here's a script with two working local teams. Maybe it'll help.
Hidden/Spoiler:
[code]ScriptCB_DoFile("setup_teams")
ScriptCB_DoFile("ObjectiveConquest")

function ScriptPostLoad()
--This defines the CPs. These need to happen first
cp1 = CommandPost:New{name = "cp1"}
cp2 = CommandPost:New{name = "cp2"}
cp3 = CommandPost:New{name = "cp3"}

cp6 = CommandPost:New{name = "cp6"}
cp7 = CommandPost:New{name = "cp7"}
cp8 = CommandPost:New{name = "cp8"}

SetProperty("cp1", "AllyPath", "CP1_SpawnPath")
SetProperty("cp2", "AllyPath", "CP2_SpawnPath")
SetProperty("cp3", "AllyPath", "CP3_SpawnPath")
SetProperty("cp6", "AllyPath", "CP6_SpawnPath")
SetProperty("cp7", "AllyPath", "CP9SpawnPath")
SetProperty("cp8", "AllyPath", "CP8SpawnPath")




--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(cp6)
conquest:AddCommandPost(cp7)
conquest:AddCommandPost(cp8)


conquest:Start()
AddAIGoal(1, "conquest", 100)
AddAIGoal(2, "conquest", 100)
AddAIGoal(B1FODDER, "conquest", 100)
-- AddAIGoal(B1FODDER, "Follow", 100, "cis_inf_B2HA")
AddAIGoal(B1SPECIAL, "conquest", 100)

EnableSPHeroRules()

KillObject("jawa_cp")

end




function ScriptInit()

StealArtistHeap(512*2048)
SetUberMode(1);
SetPS2ModelMemory(2097152 + 65536 * 10)
ReadDataFile("..\\..\\addon\\TCW\\data\\_LVL_PC\\ingame.lvl")
ReadDataFile("ingame.lvl")
ReadDataFile("..\\..\\addon\\TCW\\data\\_LVL_PC\\ingame.lvl")

REP = 1
CIS = 2
B1FODDER = 3
B1SPECIAL = 4

ATT = 1
DEF = 2


SetTeamAggressiveness(REP, 1.00)
SetTeamAggressiveness(CIS, 0.90)

SetMaxFlyHeight(40)
SetMaxPlayerFlyHeight(40)

ReadDataFile("sound\\tat.lvl;tat2cw")
ReadDataFile("..\\..\\addon\\TCW\\data\\_LVL_PC\\SOUND\\tcw.lvl;tcwcw")
ReadDataFile("..\\..\\addon\\TCW\\data\\_LVL_PC\\SIDE\\rep.lvl",
"rep_inf_tcw_rifleman",
"rep_inf_tcw_heavy",
"rep_inf_tcw_engineer",
"rep_inf_tcw_sniper",
"rep_inf_tcw_jettrooper",
"rep_inf_tcw_medic")

ReadDataFile("..\\..\\addon\\TCW\\data\\_LVL_PC\\SIDE\\501st.lvl",
"rep_inf_tcw_rifleman_501st",
"rep_inf_tcw_rocketeer_chaingun_501st",
"rep_inf_tcw_sniper_501st",
"rep_inf_tcw_medic_501st",
"rep_inf_tcw_engineer_501st",
"rep_inf_tcw_jettrooper_501st")

ReadDataFile("..\\..\\addon\\TCW\\data\\_LVL_PC\\SIDE\\cis.lvl",
"cis_inf_B1",
"cis_inf_B2",
"cis_inf_B2HA",
"cis_inf_B2RP",
"cis_inf_IG100",
"cis_inf_sniper",
"cis_inf_BX_rifleman",
"cis_inf_BX_sniper",
"cis_inf_droideka",
"cis_inf_B1_airdroid",
"cis_inf_B1_sergeant",
"cis_inf_B1_firedroid")

ReadDataFile("..\\..\\addon\\TCW\\data\\_LVL_PC\\SIDE\\cisdesert.lvl",
"cis_sniper_camo")

SetAttackingTeam(ATT)

SetupTeams{
rep = {
team = REP,
units = 28,
reinforcements = 300,
class1 = { "rep_inf_tcw_rifleman",6, 10},
class2 = { "rep_inf_tcw_heavy",4, 6},
class3 = { "rep_inf_tcw_sniper",2, 4},
class4 = { "rep_inf_tcw_engineer",3, 4},
class5 = { "rep_inf_tcw_medic",3, 4},
class6 = { "rep_inf_tcw_jettrooper",4, 4},

},
cis = {
team = CIS,
units = 18,
reinforcements = 300,
class1 = { "cis_inf_BX_rifleman",2, 3},
class2 = { "cis_inf_BX_sniper",0, 2},
class3 = { "cis_inf_B2HA",2, 3},
class4 = { "cis_inf_B2",4, 5},
class5 = { "cis_inf_B2RP",2, 3},
-- class6 = { "cis_inf_B1_sergeant",1, 3},
class7 = { "cis_inf_droideka",1, 2},
class8 = { "cis_inf_IG100", 0, 2},
-- class9 = { "",1, 1},
}
}

-- SetHeroClass(CIS, "cis_hero_darthmaul")
-- SetHeroClass(REP, "rep_hero_obiwan")

SetTeamName(B1FODDER, CIS)
SetTeamIcon(B1FODDER, "cis_icon")
SetUnitCount(B1FODDER, 10)
AddUnitClass(B1FODDER, "cis_inf_B1", 10)


SetTeamName(B1SPECIAL, CIS)
SetTeamIcon(B1SPECIAL, "cis_icon")
SetUnitCount(B1SPECIAL, 6)
AddUnitClass(B1SPECIAL, "cis_inf_B1_firedroid", 1, 2)
AddUnitClass(B1SPECIAL, "cis_inf_B1_sergeant", 1, 2)
AddUnitClass(B1SPECIAL, "cis_inf_sniper", 1, 2)
AddUnitClass(B1SPECIAL, "cis_inf_B1_airdroid", 1, 2)



SetTeamAsEnemy(REP,B1FODDER)
SetTeamAsEnemy(B1FODDER,REP)
SetTeamAsFriend(CIS,B1FODDER)
SetTeamAsFriend(B1FODDER,CIS)
SetTeamAsFriend(B1FODDER,B1SPECIAL)
SetTeamAsFriend(B1SPECIAL,B1FODDER)
SetTeamAsEnemy(REP,B1SPECIAL)
SetTeamAsEnemy(B1SPECIAL,REP)
SetTeamAsFriend(CIS,B1SPECIAL)
SetTeamAsFriend(B1SPECIAL,CIS)

-- Level Stats
ClearWalkers()
AddWalkerType(0, 3) -- 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)

local weaponCnt = 230
SetMemoryPoolSize("Aimer", 23)
SetMemoryPoolSize("AmmoCounter", weaponCnt)
SetMemoryPoolSize("BaseHint", 325)
SetMemoryPoolSize("EnergyBar", weaponCnt)
SetMemoryPoolSize("EntityCloth", 19)
SetMemoryPoolSize("EntityFlyer", 6) -- to account for rocket upgrade
SetMemoryPoolSize("EntityHover", 1)
SetMemoryPoolSize("SoldierAnimation", 400)
SetMemoryPoolSize("EntitySoundStream", 2)
SetMemoryPoolSize("EntitySoundStatic", 43)
SetMemoryPoolSize("MountedTurret", 15)
SetMemoryPoolSize("Navigator", 50)
SetMemoryPoolSize("Obstacle", 667)
SetMemoryPoolSize("PathFollower", 50)
SetMemoryPoolSize("PathNode", 256)
SetMemoryPoolSize("TreeGridStack", 325)
SetMemoryPoolSize("UnitAgent", 50)
SetMemoryPoolSize("UnitController", 50)
SetMemoryPoolSize("Weapon", weaponCnt)

SetSpawnDelay(10.0, 0.25)
ReadDataFile("TAT\\tat2.lvl", "tat2_con")
SetDenseEnvironment("false")


-- Sound Stats

voiceSlow = OpenAudioStream("sound\\global.lvl", "rep_unit_vo_slow")
AudioStreamAppendSegments("sound\\global.lvl", "cis_unit_vo_slow", voiceSlow)
AudioStreamAppendSegments("sound\\global.lvl", "des_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\\global.lvl", "global_vo_quick")
-- OpenAudioStream("sound\\global.lvl", "global_vo_slow")
OpenAudioStream("sound\\tat.lvl", "tat2")
OpenAudioStream("sound\\tat.lvl", "tat2")

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_tat_amb_start", 0,1)
-- SetAmbientMusic(REP, 0.8, "rep_tat_amb_middle", 1,1)
-- SetAmbientMusic(REP, 0.2,"rep_tat_amb_end", 2,1)
-- SetAmbientMusic(CIS, 1.0, "cis_tat_amb_start", 0,1)
-- SetAmbientMusic(CIS, 0.8, "cis_tat_amb_middle", 1,1)
-- SetAmbientMusic(CIS, 0.2,"cis_tat_amb_end", 2,1)

-- SetVictoryMusic(REP, "rep_tat_amb_victory")
-- SetDefeatMusic (REP, "rep_tat_amb_defeat")
-- SetVictoryMusic(CIS, "cis_tat_amb_victory")
-- SetDefeatMusic (CIS, "cis_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]
razac920
2nd Lieutenant
2nd Lieutenant
Posts: 365
Joined: Sun Jan 16, 2011 12:42 am
Games I'm Playing :: SWBF2
Location: Princeton, NJ

Re: local sides not spawning more than one unit

Post by razac920 »

In your log file I saw
Hidden/Spoiler:
[code]Message Severity: 3
C:\Battlefront2\main\Battlefront2\Source\HintManager.cpp(210)
Hint references nonexistant command post "cp5"

Message Severity: 3
C:\Battlefront2\main\Battlefront2\Source\HintManager.cpp(210)
Hint references nonexistant command post "cp5"

Message Severity: 3
C:\Battlefront2\main\Battlefront2\Source\HintManager.cpp(210)
Hint references nonexistant command post "cp5"

Message Severity: 3
C:\Battlefront2\main\Battlefront2\Source\HintManager.cpp(210)
Hint references nonexistant command post "cp5"

Message Severity: 3
C:\Battlefront2\main\Battlefront2\Source\HintManager.cpp(210)
Hint references nonexistant command post "cp5"

Message Severity: 3
C:\Battlefront2\main\Battlefront2\Source\HintManager.cpp(210)
Hint references nonexistant command post "cp5"

Message Severity: 3
C:\Battlefront2\main\Battlefront2\Source\HintManager.cpp(210)
Hint references nonexistant command post "cp5"

Message Severity: 3
C:\Battlefront2\main\Battlefront2\Source\HintManager.cpp(210)
Hint references nonexistant command post "cp5"

Message Severity: 3
C:\Battlefront2\main\Battlefront2\Source\HintManager.cpp(210)
Hint references nonexistant command post "cp5"

Message Severity: 3
C:\Battlefront2\main\Battlefront2\Source\HintManager.cpp(210)
Hint references nonexistant command post "cp5"

Message Severity: 3
C:\Battlefront2\main\Battlefront2\Source\HintManager.cpp(210)
Hint references nonexistant command post "cp5"

Message Severity: 3
C:\Battlefront2\main\Battlefront2\Source\HintManager.cpp(210)
Hint references nonexistant command post "cp5"

Message Severity: 3
C:\Battlefront2\main\Battlefront2\Source\HintManager.cpp(210)
Hint references nonexistant command post "cp4"[/code]
Check your command post names in ZeroEditor and the script for possible misspellings?
jedimoose32
Field Commander
Field Commander
Posts: 938
Joined: Thu Jan 24, 2008 12:41 am
Projects :: Engineering Degree
Location: The Flatlands of Canada

Re: local sides not spawning more than one unit

Post by jedimoose32 »

THEWULFMAN wrote: Maybe, but it does know why kids love the taste of Cinnamon Toast Crunch.
Image

ZoomV: I noticed the same thing as razac... are your CPs configured/named correctly in ZE?
ZoomV
Rebel Warrant Officer
Rebel Warrant Officer
Posts: 308
Joined: Thu Aug 15, 2013 11:27 am
Projects :: Old Republic Map pack
Games I'm Playing :: BF2 SWTOR and GW2
xbox live or psn: No gamertag set
Location: Belsavis, Maximum Security Ward

Re: local sides not spawning more than one unit

Post by ZoomV »

The hint errors are due to the hintnodes referencing a command post that only exists on the CW conquest layer and not on the TOR conquest layer.

Also I know the command posts are correct because I'm spawning 1 units per local side. If the commandposts where set up incorrectly I wouldn't be spawning any units at all.
THEWULFMAN
Space Ranger
Posts: 5557
Joined: Tue Aug 17, 2010 3:30 pm
Projects :: Evolved 2
Location: Columbus, Ohio
Contact:

Re: local sides not spawning more than one unit

Post by THEWULFMAN »

Why don't you remove all but one local team, and try to spawn multiple units from it. Just remove the extra variables, if one local team can work then others should do.
ZoomV
Rebel Warrant Officer
Rebel Warrant Officer
Posts: 308
Joined: Thu Aug 15, 2013 11:27 am
Projects :: Old Republic Map pack
Games I'm Playing :: BF2 SWTOR and GW2
xbox live or psn: No gamertag set
Location: Belsavis, Maximum Security Ward

Re: local sides not spawning more than one unit

Post by ZoomV »

I did what Anakin suggested and switched the team numbers and its working fine now.
jedimoose32
Field Commander
Field Commander
Posts: 938
Joined: Thu Jan 24, 2008 12:41 am
Projects :: Engineering Degree
Location: The Flatlands of Canada

Re: Local sides not spawning more than one unit [Solved]

Post by jedimoose32 »

I'm working with local sides right now and I'm having a similar, if not identical, problem.

I have two local teams. Team 3 is supposed to have 1 unit and Team 4 is supposed to have between 40 and 50. However, I can only get Team 4 to spawn 1 unit. But here's where it gets even stranger.
If I increase the number of units allowed on Team 3, like this:

Code: Select all

	SetTeamName (3, "target")
    AddUnitClass (3, "cis_hero_darthmaul", 1)
    SetUnitCount (3, 50) --previously SetUnitCount (3, 1)
	
	SetTeamName (4, "civilians")
    AddUnitClass (4, "cis_inf_engineer",40, 50)
    SetUnitCount (4, 50)
...then suddenly all of my Team 4 units are able to spawn. I wonder if this has something to do with ZoomV's problem? I'll post my full LUA here as well in case anyone wants to have a look. It's using a lot of code from Kill The Target. You can ignore my semi-humorous comments, they're there to remind me what each section does, and keep me sane/give me the occasional chuckle.
Hidden/Spoiler:
[code]
--
-- Copyright (c) 2005 Pandemic Studios, LLC. All rights reserved.
--

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

-- REP Attacking (attacker is always #1)
REP = 1;
CIS = 2;
TAR = 3;
CIV = 4;
-- These variables do not change
ATT = REP;
DEF = CIS;


function ScriptPostLoad()


--This defines the CPs. These need to happen first
cp1 = CommandPost:New{name = "cp1"}
cp2 = CommandPost:New{name = "cp2"}
cp3 = CommandPost:New{name = "cp3"}
cp4 = CommandPost:New{name = "cp4"}


--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:Start()


--LET'S KILL SOME TARGETS - BEGIN KTT

ForceHumansOntoTeam1() --no pesky cheaters

AICanCaptureCP("cp1", 2, false) --yeah, fairly self explanatory...
AICanCaptureCP("cp2", 2, false)
AICanCaptureCP("cp3", 2, false)
AICanCaptureCP("cp4", 2, false)
AICanCaptureCP("cp1", 3, false)
AICanCaptureCP("cp2", 3, false)
AICanCaptureCP("cp3", 3, false)
AICanCaptureCP("cp4", 3, false)
AICanCaptureCP("cp1", 4, false)
AICanCaptureCP("cp2", 4, false)
AICanCaptureCP("cp3", 4, false)
AICanCaptureCP("cp4", 4, false)

target = GetTeamMember(3,0) --set the target as the first dude on team 3
AddAIGoal(3, "deathmatch", 100) --don't get distracted by cps
AddAIGoal(4, "deathmatch", 100)
SelectCharacterClass(target, "cis_hero_darthmaul") --i'm maul about dat bass
SpawnCharacter(target, GetPathPoint("cp4_spawn", 0)) --target spawnpoint
print("Target setup complete")

--civs =
--SelectCharacterClass(civs, "cis_hero_darthmaul") --i'm maul about dat bass
--SpawnCharacter(civs, GetPathPoint("cp4_spawn", 0)) --target spawnpoint

dummy = CreateTimer("dummy") --let's give the game some time to gather its thoughts
SetTimerValue(dummy, 0.5)
StartTimer(dummy)
print("Timer dummy elapsed")

OnTimerElapse(
function(timer)
ClearAIGoals(2) --so the guards follow the target, this i will be removing/changing later
AddAIGoal(2, "follow", 1000, GetCharacterUnit(target)) --i'm watching you / excuse me??
MapAddEntityMarker(GetCharacterUnit(target), "hud_objective_icon_circle", 5, 1, "RED", true, true, true) --map marker
DestroyTimer(dummy)
print("Map marker created")
end,
dummy
)

SetTeamAsFriend(1,2) --make love not war (for now)
SetTeamAsNeutral(1,3)
SetTeamAsFriend(1,4)
SetTeamAsFriend(2,1)
SetTeamAsFriend(2,3)
SetTeamAsFriend(2,4)
SetTeamAsFriend(3,1)
SetTeamAsFriend(3,2)
SetTeamAsFriend(3,4)
SetTeamAsFriend(4,1)
SetTeamAsFriend(4,2)
SetTeamAsFriend(4,3)

print("Team diplomacy set")

tarhp = nil

onfirstspawn = OnCharacterSpawn(
function(character)
if IsCharacterHuman(character) then --fortunately no turing test needed here
ReleaseCharacterSpawn(onfirstspawn)
onfirstspawn = nil
--MoveCameraToEntity(GetCharacterUnit(target)) --so far have not discovered why this is here
--AllowAISpawn(2, false)
AllowAISpawn(3, false)
--AllowAISpawn(4, false)
tarhp = GetObjectHealth(GetCharacterUnit(target)) --not sure about this either...
--ShowMessageText("level.abc.kill")
end
end
)

deftimer = CreateTimer("deftimer") --let's give the game some time to gather its thoughts
SetTimerValue(deftimer, 1.0)


deathcheck = OnCharacterDeath( --this is a really interesting way of checking for victory/defeat
function(character, killer)
if GetNumTeamMembersAlive(1) == 0 then --if you are not alive then you are dead and therefore lose
StartTimer(deftimer)
print("Starting defeat timer...")
elseif GetNumTeamMembersAlive(3) == 0 then --this town ain't big enough for the two of us
ClearAIGoals(2) --now that the target is dead the minions must re-focus...
AddAIGoal(2, "destroy", 1000, GetCharacterUnit(killer)) --...on AVENGING HIS DEATH!!
ActivateRegion("choppa") --this is the choppa
SetTeamAsEnemy(1,2) --friends off
SetTeamAsEnemy(2,1) --likewise
MapAddRegionMarker("choppa", "hud_objective_icon_circle", 5, 1, "BLUE", true, true, true) --get to da choppa
print("Target eliminated")
print("Safe zone activated")
end
end)

OnTimerElapse(
function(timer)
MissionDefeat(1)
print("Mission defeat")
DestroyTimer(deftimer)
end,
deftimer
)

i = 1

TEAM = OnCharacterDeath(
function(character, killer)
if GetObjectTeam(killer) == 1 then --if anyone dies and the killer was on team 1?
SpawnCharacter(GetTeamMember(1,i),GetEntityMatrix(killer)) --i'm not sure who we're spawning
i = i + 1
print("LOOK AT ME EVERYONE!!")
end
end)

wincheck = OnEnterRegion(
function(region, character)
MissionVictory(1)
print("Congration you done it (victory)")
end,
"choppa"
)

state = 1

AllowAISpawn(1, false) --in space, no one can hear you... wait...

dmgcheck = OnObjectDamage(function(object, damager)
print("check damage")
if GetObjectTeam(GetCharacterUnit(damager)) == 1 and state == 1 then --if you touch anything...
ClearAIGoals(3)
--AllowAISpawn(4, false)
AddAIGoal(3, "follow", 1000, "cp4") --he'll run away
ClearAIGoals(2)
AddAIGoal(2, "destroy", 500, GetCharacterUnit(damager)) --and they'll try to kill you
AddAIGoal(2, "follow", 500, GetCharacterUnit(target))
SetTeamAsEnemy(1,2)
SetTeamAsEnemy(2,1)
state = 2
print("Damage confirmed")
end
end)

DisableAIAutoBalance()

--END KTT

SetUberMode(1);

EnableSPHeroRules()

end


---------------------------------------------------------------------------
-- 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 ScriptInit()

ReadDataFile("ingame.lvl")


SetMaxFlyHeight(30)
SetMaxPlayerFlyHeight (30)

SetMemoryPoolSize ("ClothData",20)
SetMemoryPoolSize ("Combo",50) -- should be ~ 2x number of jedi classes
SetMemoryPoolSize ("Combo::State",650) -- should be ~12x #Combo
SetMemoryPoolSize ("Combo::Transition",650) -- should be a bit bigger than #Combo::State
SetMemoryPoolSize ("Combo::Condition",650) -- should be a bit bigger than #Combo::State
SetMemoryPoolSize ("Combo::Attack",550) -- should be ~8-12x #Combo
SetMemoryPoolSize ("Combo::DamageSample",6000) -- should be ~8-12x #Combo::Attack
SetMemoryPoolSize ("Combo::Deflect",100) -- should be ~1x #combo

ReadDataFile("sound\\yav.lvl;yav1cw")
ReadDataFile("SIDE\\rep.lvl",
"rep_inf_ep3_rifleman",
"rep_inf_ep3_rocketeer",
"rep_inf_ep3_engineer",
"rep_inf_ep3_sniper",
"rep_inf_ep3_officer",
"rep_inf_ep3_jettrooper",
"rep_hero_anakin")
ReadDataFile("SIDE\\cis.lvl",
"cis_inf_rifleman",
"cis_inf_engineer",
"cis_hero_darthmaul")


ReadDataFile("SIDE\\tur.lvl",
"tur_bldg_laser",
"tur_bldg_tower")

SetupTeams{
rep = {
team = REP,
units = 20,
reinforcements = 150,
soldier = { "rep_inf_ep3_rifleman",9, 25},
assault = { "rep_inf_ep3_rocketeer",1, 4},
engineer = { "rep_inf_ep3_engineer",1, 4},
sniper = { "rep_inf_ep3_sniper",1, 4},
officer = {"rep_inf_ep3_officer",1, 4},
special = { "rep_inf_ep3_jettrooper",1, 4},

},
cis = {
team = CIS,
units = 10,
reinforcements = 150,
soldier = { "cis_inf_rifleman",9, 25},
--assault = { "cis_inf_rocketeer",1, 4},
--engineer = { "cis_inf_engineer",1, 4},
--sniper = { "cis_inf_sniper",1, 4},
--officer = {"cis_inf_officer",1, 4},
--special = { "cis_inf_droideka",1, 4},
}
}

SetTeamName (3, "target")
AddUnitClass (3, "cis_hero_darthmaul", 1)
SetUnitCount (3, 50)

SetTeamName (4, "civilians")
AddUnitClass (4, "cis_inf_engineer",40, 50)
SetUnitCount (4, 50)

SetHeroClass(CIS, "cis_inf_droideka")
SetHeroClass(REP, "rep_hero_anakin")


-- Level Stats
-- ClearWalkers()
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)
local weaponCnt = 1024
SetMemoryPoolSize("Aimer", 75)
SetMemoryPoolSize("AmmoCounter", weaponCnt)
SetMemoryPoolSize("BaseHint", 1024)
SetMemoryPoolSize("EnergyBar", weaponCnt)
SetMemoryPoolSize("EntityCloth", 32)
SetMemoryPoolSize("EntityFlyer", 32)
SetMemoryPoolSize("EntityHover", 32)
SetMemoryPoolSize("EntityLight", 200)
SetMemoryPoolSize("EntitySoundStream", 4)
SetMemoryPoolSize("EntitySoundStatic", 32)
SetMemoryPoolSize("MountedTurret", 32)
SetMemoryPoolSize("Navigator", 128)
SetMemoryPoolSize("Obstacle", 1024)
SetMemoryPoolSize("PathNode", 1024)
SetMemoryPoolSize("SoundSpaceRegion", 64)
SetMemoryPoolSize("TreeGridStack", 1024)
SetMemoryPoolSize("UnitAgent", 128)
SetMemoryPoolSize("UnitController", 128)
SetMemoryPoolSize("Weapon", weaponCnt)

SetSpawnDelay(10.0, 0.25)
--ReadDataFile("dc:JER\\JER.lvl", "JER_conquest")
ReadDataFile("dc:JER\\JER.lvl", "JER_conquest")
SetDenseEnvironment("false")

SetAttackingTeam(ATT)


-- Sound

SetSoundEffect("ScopeDisplayZoomIn", "binocularzoomin")
SetSoundEffect("ScopeDisplayZoomOut", "binocularzoomout")

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\\global.lvl", "global_vo_quick")
-- OpenAudioStream("sound\\global.lvl", "global_vo_slow")
OpenAudioStream("sound\\yav.lvl", "yav1")
OpenAudioStream("sound\\yav.lvl", "yav1")
OpenAudioStream("sound\\yav.lvl", "yav1_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(2, "cisleaving")
SetOutOfBoundsVoiceOver(1, "repleaving")

SetAmbientMusic(REP, 1.0, "rep_yav_amb_start", 0,1)
SetAmbientMusic(REP, 0.8, "rep_yav_amb_middle", 1,1)
SetAmbientMusic(REP, 0.2, "rep_yav_amb_end", 2,1)
SetAmbientMusic(CIS, 1.0, "cis_yav_amb_start", 0,1)
SetAmbientMusic(CIS, 0.8, "cis_yav_amb_middle", 1,1)
SetAmbientMusic(CIS, 0.2, "cis_yav_amb_end", 2,1)

SetVictoryMusic(REP, "rep_yav_amb_victory")
SetDefeatMusic (REP, "rep_yav_amb_defeat")
SetVictoryMusic(CIS, "cis_yav_amb_victory")
SetDefeatMusic (CIS, "cis_yav_amb_defeat")

SetSoundEffect("ScopeDisplayZoomIn", "binocularzoomin")
SetSoundEffect("ScopeDisplayZoomOut", "binocularzoomout")
--SetSoundEffect("BirdScatter", "birdsFlySeq1")
--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")


--OpeningSateliteShot
AddCameraShot(0.908386, -0.209095, -0.352873, -0.081226, -45.922508, -19.114113, 77.022636);

AddCameraShot(-0.481173, 0.024248, -0.875181, -0.044103, 14.767292, -30.602322, -144.506851);
AddCameraShot(0.999914, -0.012495, -0.004416, -0.000055, 1.143253, -33.602314, -76.884430);
AddCameraShot(0.839161, 0.012048, -0.543698, 0.007806, 19.152437, -49.802273, 24.337317);
AddCameraShot(0.467324, 0.006709, -0.883972, 0.012691, 11.825212, -49.802273, -7.000720);
AddCameraShot(0.861797, 0.001786, -0.507253, 0.001051, -11.986043, -59.702248, 23.263165);
AddCameraShot(0.628546, -0.042609, -0.774831, -0.052525, 20.429928, -48.302277, 9.771714);
AddCameraShot(0.765213, -0.051873, 0.640215, 0.043400, 57.692474, -48.302277, 16.540724);
AddCameraShot(0.264032, -0.015285, -0.962782, -0.055734, -16.681797, -42.902290, 129.553268);
AddCameraShot(-0.382320, 0.022132, -0.922222, -0.053386, 20.670977, -42.902290, 135.513001);
end
[/code]
ZoomV
Rebel Warrant Officer
Rebel Warrant Officer
Posts: 308
Joined: Thu Aug 15, 2013 11:27 am
Projects :: Old Republic Map pack
Games I'm Playing :: BF2 SWTOR and GW2
xbox live or psn: No gamertag set
Location: Belsavis, Maximum Security Ward

Re: Local sides not spawning more than one unit [Solved]

Post by ZoomV »

I'm starting to believe that for some reason the max unit count of the lowest # local side sets a limit to all later local sides.
jedimoose32
Field Commander
Field Commander
Posts: 938
Joined: Thu Jan 24, 2008 12:41 am
Projects :: Engineering Degree
Location: The Flatlands of Canada

Re: Local sides not spawning more than one unit [Solved]

Post by jedimoose32 »

That's the conclusion I've reached as well. Fortunately it's not a big problem as you can easily set the max units for the first team to a high number and then just cap the number of individual units for each subsequent side if it needs to be smaller.
THEWULFMAN
Space Ranger
Posts: 5557
Joined: Tue Aug 17, 2010 3:30 pm
Projects :: Evolved 2
Location: Columbus, Ohio
Contact:

Re: Local sides not spawning more than one unit [Solved]

Post by THEWULFMAN »

That's a really weird limitation, but at least it's easily worked around.

I never noticed because my first local team was always the largest anyway. ¯\_(ツ)_/¯
User avatar
[RDH]Zerted
Gametoast Staff
Gametoast Staff
Posts: 2982
Joined: Sun Feb 26, 2006 7:36 am
Projects :: Bos Wars AI - a RTS game
Games I'm Playing :: SWBF2 and Bos Wars
xbox live or psn: No gamertag set
Location: USA
Contact:

Re: Local sides not spawning more than one unit [Solved]

Post by [RDH]Zerted »

TMYK: Lua comments are excellent compared to some other languages. You can insert as many equal signs inside the bracket pairs (like [==[ and ]==]) as you want. That way you can comment out overtop of other block comments:

Code: Select all

local cpTimerTimes = {
--[=[
  {'CP0', 3},
--[===[
  {'CP1', 5},
--[[
--]=]
  {'CP2', 6},
  {'CP2', 7},
  {'CP2', 8},
--]]
  {'CP3', 11},
--]]===]
  {'CP4', 13},
}
Normally you wouldn't use such a feature on such a small segment of code.
THEWULFMAN
Space Ranger
Posts: 5557
Joined: Tue Aug 17, 2010 3:30 pm
Projects :: Evolved 2
Location: Columbus, Ohio
Contact:

Re: Local sides not spawning more than one unit [Solved]

Post by THEWULFMAN »

Pretty neat info Zerted. I don't know when it'll come in handy but it's nice to know.
Post Reply