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

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

Local sides not spawning more than one unit [Solved]

Post by ZoomV »

So I have been using multiple locals sides on this map, but none of the sides are spawning more than one unit at a time.

Code: Select all

---[[ Acklays
    ReadDataFile("SIDE\\geo.lvl",
                             "geo_inf_acklay")
	SetTeamName(3, "locals")
	AddUnitClass(3, "geo_inf_acklay",1)
	SetUnitCount(3, 1)
	SetTeamAsEnemy(3, ATT)
	SetTeamAsEnemy(3, DEF) 
	SetTeamAsEnemy(ATT, 3)
	SetTeamAsEnemy(DEF, 3)
	AddAIGoal(3,"Deathmatch",100)
	--]]  

	SetTeamName(4, "prisoners")
	AddUnitClass(4, "pri_inf_bothan",5)
	AddUnitClass(4, "pri_inf_warrior",5)
	SetUnitCount(4, 10)
	SetTeamAsEnemy(4, ATT)
	SetTeamAsEnemy(4, DEF) 
	SetTeamAsEnemy(ATT, 4)
	SetTeamAsEnemy(DEF, 4)
	SetTeamAsEnemy(3, 4)
	SetTeamAsEnemy(4, 3)
	AddAIGoal(4,"conquest",100)

	SetTeamName(5, "guards")
	AddUnitClass(5, "pub_inf_guard",10)
	SetUnitCount(5, 10)
	SetTeamAsEnemy(5, ATT)
	SetTeamAsFriend(5, DEF) 
	SetTeamAsEnemy(ATT, 5)
	SetTeamAsEnemy(3, 5)
	SetTeamAsEnemy(4, 5)
	SetTeamAsEnemy(5, 3)
	SetTeamAsEnemy(5, 4)
	SetTeamAsFriend(DEF, 5)
	AddAIGoal(5,"Deathmatch",100)
Last edited by ZoomV on Wed Mar 04, 2015 12:19 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: local sides not spawning more than one unit

Post by Anakin »

no idea. have you set variables for the locals??
ATT = 1
DEF = 2
GUARDS = 3
PRISONERS = 4
ACKLAY = 5

or something like that??
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 »

To my knowledge you don't have to set the variable for the locals. None of the stock scripts do it. And the sides are working to some degree because they are spawning *one* unit each.
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: local sides not spawning more than one unit

Post by Anakin »

Do you want the acklays to be in the game??
Becasue they actualy are not uncommend. Maybe you should try to move them under your custom locals if you want them to be in place
---[[ Acklays
ReadDataFile("SIDE\\geo.lvl",
"geo_inf_acklay")
SetTeamName(3, "locals")
AddUnitClass(3, "geo_inf_acklay",1)
SetUnitCount(3, 1)
SetTeamAsEnemy(3, ATT)
SetTeamAsEnemy(3, DEF)
SetTeamAsEnemy(ATT, 3)
SetTeamAsEnemy(DEF, 3)
AddAIGoal(3,"Deathmatch",100)
--]]
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 acklay *is* already in the game, running around just fine. Comments only affect one line not what is between the comments.
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:Comments only affect one line not what is between the comments.

False. That's exactly what --[[ and --]] does.

Image


Green is commented out lines.
razac920
2nd Lieutenant
2nd Lieutenant
Posts: 365
Joined: Sun Jan 16, 2011 12:42 am

Re: local sides not spawning more than one unit

Post by razac920 »

Why don't you post your full script?
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: local sides not spawning more than one unit

Post by Anakin »

THEWULFMAN wrote:
ZoomV wrote:Comments only affect one line not what is between the comments.

False. That's exactly what --[[ and --]] does.

Image


Green is commented out lines.
i thought block comments look like that:
begin: --[[
end: ]]--
and not
end: --]]
razac920
2nd Lieutenant
2nd Lieutenant
Posts: 365
Joined: Sun Jan 16, 2011 12:42 am

Re: local sides not spawning more than one unit

Post by razac920 »

Well I looked and found that they begin with --[[ and end with ]] (so you could put two dashes before but you don't need to). I think it would help to see your full script though
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 »

THEWULFMAN wrote:
ZoomV wrote:Comments only affect one line not what is between the comments.

False. That's exactly what --[[ and --]] does.



Green is commented out lines.
Then how on earth is the acklay showing up? I'm literally looking at it in game right now.
razac920 wrote:Why don't you post your full script?
Hidden/Spoiler:
[code]--
-- Copyright (c) 2005 Pandemic Studios, LLC. All rights reserved.
--

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

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

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"}
cp5 = CommandPost:New{name = "cp5"}
cp6 = CommandPost:New{name = "cp6"}
cp7 = CommandPost:New{name = "cp7"}



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


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("dc:Load\\BVS_TOR.lvl")

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



SetMaxFlyHeight(40)
SetMaxPlayerFlyHeight(40)


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\\fel.lvl;fel1cw")
ReadDataFile("dc:Sound\\rcw.lvl;dc17")
ReadDataFile("dc:sound\\BVS.lvl;BVScw")
ReadDataFile("dc:SOUND\\tor.lvl;tor_1")
ReadDataFile("dc:SIDE\\clonewar.lvl",
"tur_bldg_laser",
"pub_inf_guard",
"pri_inf_side",
"pub_inf_rocketeer",
"pub_inf_rifleman",
"pub_inf_officer",
"pub_inf_engineer",
"pub_hover_speederbike",
"imp_hover_speederbike",
"pub_inf_sniper",
"pub_inf_commando",
"all_hover_combatspeeder",
"imp_inf_side",
"imp_inf_officer",
"tur_bldg_tower")
-- "rep_walk_atte")

ReadDataFile("SIDE\\imp.lvl",
"imp_hero_bobafett",
"imp_fly_destroyer_dome" )


---[[ Acklays
ReadDataFile("SIDE\\geo.lvl",
"geo_inf_acklay")
SetTeamName(3, "locals")
AddUnitClass(3, "geo_inf_acklay",1)
SetUnitCount(3,1)
SetTeamAsEnemy(3, ATT)
SetTeamAsEnemy(3, DEF)
SetTeamAsEnemy(ATT, 3)
SetTeamAsEnemy(DEF, 3)
AddAIGoal(3,"Deathmatch",100)
--]]

SetTeamName(4, "prisoners")
AddUnitClass(4, "pri_inf_bothan",5)
AddUnitClass(4, "pri_inf_warrior",5)
SetUnitCount(4,10)
SetTeamAsEnemy(4, ATT)
SetTeamAsEnemy(4, DEF)
SetTeamAsEnemy(ATT, 4)
SetTeamAsEnemy(DEF, 4)
SetTeamAsEnemy(3, 4)
SetTeamAsEnemy(4, 3)
AddAIGoal(4,"conquest",100)

SetTeamName(5, "guards")
AddUnitClass(5, "pub_inf_guard",10)
SetUnitCount(5,10)
SetTeamAsEnemy(5, ATT)
SetTeamAsFriend(5, DEF)
SetTeamAsEnemy(ATT, 5)
SetTeamAsEnemy(3, 5)
SetTeamAsEnemy(4, 5)
SetTeamAsEnemy(5, 3)
SetTeamAsEnemy(5, 4)
SetTeamAsFriend(DEF, 5)
AddAIGoal(5,"Deathmatch",100)

SetTeamAggressiveness(IMP, 0.95)
SetTeamAggressiveness(REP, 1.0)


SetupTeams{
rep = {
team = REP,
units = 68,
reinforcements = 650,
soldier = { "pub_inf_rocketeer",2,10},
assault = { "pub_inf_engineer",2,8},
engineer = { "pub_inf_sniper",9,15},
sniper = { "pub_inf_officer",2,6},
officer = { "pub_inf_commando",2,4},
special = { "pub_inf_vanguard",2,5},
AddUnitClass (2, "pub_inf_rifleman", 25, 57)

},
imp = {
team = IMP,
units = 68,
reinforcements = 650,
soldier = { "imp_inf_rocketeer",4,10},
assault = { "imp_inf_engineer",2,8},
engineer = { "imp_inf_sniper",9,15},
sniper = { "imp_inf_officer",2,6},
officer = { "imp_inf_blackops",2,5},
special = { "imp_inf_hunter",1,4},
AddUnitClass (1, "imp_inf_rifleman",25, 57)
},
}

--SetHeroClass(ALL, "all_hero_hansolo_tat")
--SetHeroClass(IMP, "imp_hero_bobafett")

-- Level Stats
ClearWalkers()
AddWalkerType(0, 0) -- 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", 300)
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", 155)
SetMemoryPoolSize("Obstacle", 1024)
SetMemoryPoolSize("PathNode", 1024)
SetMemoryPoolSize("SoundSpaceRegion", 64)
SetMemoryPoolSize("TreeGridStack", 1024)
SetMemoryPoolSize("UnitAgent", 155)
SetMemoryPoolSize("UnitController", 155)
SetMemoryPoolSize("Weapon", weaponCnt)
SetMemoryPoolSize("AcklayData", 1)
SetMemoryPoolSize("SoldierAnimation", 400)
SetMemoryPoolSize("Music", 40)

SetSpawnDelay(10.0, 0.25)
ReadDataFile("dc:BVS\\BVS.lvl", "BVS_TOR")
SetDenseEnvironment("false")
AddDeathRegion("adam1")
AddDeathRegion("adam2")
AddDeathRegion("adam3")


-- Sound Stats

voiceSlow = OpenAudioStream("sound\\global.lvl", "rep_unit_vo_slow")
AudioStreamAppendSegments("sound\\global.lvl", "imp_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", "imp_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")

SetBleedingVoiceOver(REP, REP, "rep_off_com_report_us_overwhelmed", 1)
SetBleedingVoiceOver(REP, IMP, "rep_off_com_report_enemy_losing", 1)
SetBleedingVoiceOver(IMP, REP, "imp_off_com_report_enemy_losing", 1)
SetBleedingVoiceOver(IMP, IMP, "imp_off_com_report_us_overwhelmed", 1)

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

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

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(IMP, 1.0, "cis_fel_amb_start", 0,1)
SetAmbientMusic(IMP, 0.8, "cis_fel_amb_middle", 1,1)
SetAmbientMusic(IMP, 0.2, "cis_fel_amb_end", 2,1)

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

--OpeningSateliteShot
AddCameraShot(0.711258, 0.002115, 0.702925, -0.002090, 56.597954, 11.018661, -84.290337);
end
[/code]
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: local sides not spawning more than one unit

Post by Anakin »

That's easy. Your munged files are not loaded. You'll see that the mod crash after you cleaned the addon folder and remunged it. Maybe there is a conflict between your mod in the virtual addon folder and the actual addon folder.

I'm pretty sure even when you remove the whole locals there will be locals in your map. You need to figure out why your scripts are not munged/copied into your addon folder/not loaded.
Best way to find this out is manuel clean and remunge
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 »

Anakin wrote:That's easy. Your munged files are not loaded. You'll see that the mod crash after you cleaned the addon folder and remunged it. Maybe there is a conflict between your mod in the virtual addon folder and the actual addon folder.

I'm pretty sure even when you remove the whole locals there will be locals in your map. You need to figure out why your scripts are not munged/copied into your addon folder/not loaded.
Best way to find this out is manuel clean and remunge
I'm not 100% sure what you mean, but I'm interpreting this to mean that the munged files in data_TOR are somehow not overwriting the BattlefrontII/gamedata/addon/TOR?

If so, then that isn't the problem due to how my munge is set up. data_TOR only munges the mission scripts, localization, and the addme script. Additionally data_TOR does not have anything in the world folder and does not copy to the gamedata/addon folder. I manually copy the files from data_TOR/lvl_pc to gamedata/addon.
I munge the Treefall world file in data_ACW which is the same directory I munge loadscreens and ingame.lvl in. Icebound's world lvl (whos mission script seen in this thread, treefall does not have issue with its locals) is munged in data_BVS. I munge my side file in a directory data_BOM, and sound files are done through data_SOUND.

It's also worthy to note that the acklay section (complete with the --[[ and --]]) is the exact same section used in the stock mission file I pulled it from and is the same exact code that was used for both the 1.0 Icebound release and the recent mappack. Of all the locals the acklay side is the only one that is actually spawning the correct number of units.
razac920 wrote:Well I looked and found that they begin with --[[ and end with ]] (so you could put two dashes before but you don't need to). I think it would help to see your full script though
This is probably why the acklays work for me. If ]] denotes the end of a comment block, but in my case its --]] then the "]]" are being commented out since "--" is a single line comment.
That might mean that I have a comment block with no set end, except that wouldn't make sense because then the map should always crash due to half the script being commented out. :?
edit: wait no that would make sense because the -- would be contained within the comment block, but now we are back to the issue of acklays working fine despite being in a comment block.
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: local sides not spawning more than one unit

Post by Anakin »

You got the problem :D
--[[ means beginn comment block. Ignor everything untill you find ]] so it doesn't matter if there is a -- somewhere in the block.

About your local problem, try to copy the part from a working script again and place it there. I had an problem with my BF1 map support too:
at the beginning of the script the unknown resolution ingame lvl was loaded, but at the end of the script the right 16:9 resolution textkill lvl. So there was no text and the HUD wasn't shown correctly (old scope, no icons,...). I couldn't find the problem. i checked each single letter. for 4:3 everything was working. Later on i recopied the if else thing from coruscant and all was working. Nothing changed, but now it worked. So give it a try and copy the treefall locals to your iceboud script.

By the way with not copied right i mean that something maybe isn't munged right, too. So try to remove everything from your data_XXX\_LVL_PC\ folder, too.
razac920
2nd Lieutenant
2nd Lieutenant
Posts: 365
Joined: Sun Jan 16, 2011 12:42 am

Re: local sides not spawning more than one unit

Post by razac920 »

For the other local sides that aren't spawning more than one unit, did you previously code them to spawn exactly 1 unit? and then raise the limit? Because if so, then Anakin's idea is probably right.

Alternatively, I like to add in local sides AI goals AFTER the objective is set, not before, but I don't know if that makes a difference.
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 »

Ok

I manually deleted mission.lvl from gamedata/addon/TOR/data/lvl_pc

I manually deleted everything from bf2_modtools/data_TOR/lvl_pc, and manually cleaned the build_pc folder as well. I ran a clean from the visual munge too. I remunged with the mission script exactly as it is above complete with the --[[ and --]].

All local sides still only spawn a single unit at a time. And yes the acklay is there in the flesh.
Hidden/Spoiler:
Image
Hidden/Spoiler:
Image
razac920 wrote:For the other local sides that aren't spawning more than one unit, did you previously code them to spawn exactly 1 unit? and then raise the limit? Because if so, then Anakin's idea is probably right.
No, other than the acklay none of the local sides where ever set to only spawn a single unit.


EDIT: oohhh I know the comment block isn't commenting out the acklays. If you look its "---[[" the first two dashes initiate a single line comment thus eliminating the remaining "-[["
Last edited by ZoomV on Mon Mar 02, 2015 2:02 pm, edited 1 time in total.
razac920
2nd Lieutenant
2nd Lieutenant
Posts: 365
Joined: Sun Jan 16, 2011 12:42 am

Re: local sides not spawning more than one unit

Post by razac920 »

Remove the entire map from your addon and check, or check the compatibility files location (usually C:\Users\User_name\AppData\Local\VirtualStore\Program Files (x86)\LucasArts\Star Wars Battlefront II\GameData\addon )

Also, run with the modtools exe and check the log. maybe there are too many units on the map/memory issues/animation bank issues?
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 »

razac920 wrote:Remove the entire map from your addon and check, or check the compatibility files location (usually C:\Users\User_name\AppData\Local\VirtualStore\Program Files (x86)\LucasArts\Star Wars Battlefront II\GameData\addon )

Also, run with the modtools exe and check the log. maybe there are too many units on the map/memory issues/animation bank issues?
Nothing for both.

I did run icebound all the way through and observed that I ran into a lot more prisoners than normal, so I'm taking that as evidence that the prisoners are spawning correctly now. However there certainly are not more than one prison guard spawning since I camped the prison guard spawn and only ever got one.

EDIT: In order to test to see if the mission file is being updated every munge I changed the script so that the republic would have a imperial heavy trooper instead of a republic heavy. I munged and yes there was the heavy trooper and there is still only one guard spawning.

I also changed the guards block to match how the wookies are setup on stock kashyyyk
here is the mission script. Changes are in red.
Hidden/Spoiler:
--
-- Copyright (c) 2005 Pandemic Studios, LLC. All rights reserved.
--

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

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

GuardTeam = 5;

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"}
cp5 = CommandPost:New{name = "cp5"}
cp6 = CommandPost:New{name = "cp6"}
cp7 = CommandPost:New{name = "cp7"}



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


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("dc:Load\\BVS_TOR.lvl")

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



SetMaxFlyHeight(40)
SetMaxPlayerFlyHeight(40)


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\\fel.lvl;fel1cw")
ReadDataFile("dc:Sound\\rcw.lvl;dc17")
ReadDataFile("dc:sound\\BVS.lvl;BVScw")
ReadDataFile("dc:SOUND\\tor.lvl;tor_1")
ReadDataFile("dc:SIDE\\clonewar.lvl",
"tur_bldg_laser",
"pub_inf_guard",
"pri_inf_side",
"pub_inf_rocketeer",
"pub_inf_rifleman",
"pub_inf_officer",
"pub_inf_engineer",
"pub_hover_speederbike",
"imp_hover_speederbike",
"pub_inf_sniper",
"pub_inf_commando",
"all_hover_combatspeeder",
"imp_inf_side",
"imp_inf_officer",
"tur_bldg_tower")
-- "rep_walk_atte")

ReadDataFile("SIDE\\imp.lvl",
"imp_hero_bobafett",
"imp_fly_destroyer_dome" )



ReadDataFile("SIDE\\geo.lvl",
"geo_inf_acklay")
SetTeamName(3, "locals")
AddUnitClass(3, "geo_inf_acklay",1)
SetUnitCount(3,1)
SetTeamAsEnemy(3, ATT)
SetTeamAsEnemy(3, DEF)
SetTeamAsEnemy(ATT, 3)
SetTeamAsEnemy(DEF, 3)
AddAIGoal(3,"Deathmatch",100)


SetTeamName(4, "prisoners")
AddUnitClass(4, "pri_inf_bothan",5)
AddUnitClass(4, "pri_inf_warrior",5)
SetUnitCount(4,10)
SetTeamAsEnemy(4, ATT)
SetTeamAsEnemy(4, DEF)
SetTeamAsEnemy(ATT, 4)
SetTeamAsEnemy(DEF, 4)
SetTeamAsEnemy(3, 4)
SetTeamAsEnemy(4, 3)
AddAIGoal(4,"conquest",100)

--SetTeamName(5, "guards")
--AddUnitClass(5, "pub_inf_guard",10)
--SetUnitCount(5,10)
--SetTeamAsEnemy(5, ATT)
--SetTeamAsFriend(5, DEF)
--SetTeamAsEnemy(ATT, 5)
--SetTeamAsEnemy(3, 5)
--SetTeamAsEnemy(4, 5)
--SetTeamAsEnemy(5, 3)
--SetTeamAsEnemy(5, 4)
--SetTeamAsFriend(DEF, 5)
--AddAIGoal(5,"Deathmatch",100)


SetTeamName(5, "guards")
--SetTeamIcon(5, "all_icon")
AddUnitClass(5, "pub_inf_guard",10)


SetUnitCount(5, 10)
AddAIGoal(GuardTeam, "Deathmatch", 100)
SetTeamAsFriend(DEF,5)
SetTeamAsFriend(5,DEF)
SetTeamAsEnemy(ATT,5)
SetTeamAsEnemy(5, ATT)
SetTeamAsEnemy(3, 5)
SetTeamAsEnemy(4, 5)
SetTeamAsEnemy(5, 3)
SetTeamAsEnemy(5, 4)



SetTeamAggressiveness(IMP, 0.95)
SetTeamAggressiveness(REP, 1.0)


SetupTeams{
rep = {
team = REP,
units = 68,
reinforcements = 650,
--soldier = { "pub_inf_rocketeer",2,10},
soldier = { "imp_inf_rocketeer",2,10},
assault = { "pub_inf_engineer",2,8},
engineer = { "pub_inf_sniper",9,15},
sniper = { "pub_inf_officer",2,6},
officer = { "pub_inf_commando",2,4},
special = { "pub_inf_vanguard",2,5},
AddUnitClass (2, "pub_inf_rifleman", 25, 57)

},
imp = {
team = IMP,
units = 68,
reinforcements = 650,
soldier = { "imp_inf_rocketeer",4,10},
assault = { "imp_inf_engineer",2,8},
engineer = { "imp_inf_sniper",9,15},
sniper = { "imp_inf_officer",2,6},
officer = { "imp_inf_blackops",2,5},
special = { "imp_inf_hunter",1,4},
AddUnitClass (1, "imp_inf_rifleman",25, 57)
},
}

--SetHeroClass(ALL, "all_hero_hansolo_tat")
--SetHeroClass(IMP, "imp_hero_bobafett")

-- Level Stats
ClearWalkers()
AddWalkerType(0, 0) -- 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", 300)
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", 155)
SetMemoryPoolSize("Obstacle", 1024)
SetMemoryPoolSize("PathNode", 1024)
SetMemoryPoolSize("SoundSpaceRegion", 64)
SetMemoryPoolSize("TreeGridStack", 1024)
SetMemoryPoolSize("UnitAgent", 155)
SetMemoryPoolSize("UnitController", 155)
SetMemoryPoolSize("Weapon", weaponCnt)
SetMemoryPoolSize("AcklayData", 1)
SetMemoryPoolSize("SoldierAnimation", 400)
SetMemoryPoolSize("Music", 40)

SetSpawnDelay(10.0, 0.25)
ReadDataFile("dc:BVS\\BVS.lvl", "BVS_TOR")
SetDenseEnvironment("false")
AddDeathRegion("adam1")
AddDeathRegion("adam2")
AddDeathRegion("adam3")


-- Sound Stats

voiceSlow = OpenAudioStream("sound\\global.lvl", "rep_unit_vo_slow")
AudioStreamAppendSegments("sound\\global.lvl", "imp_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", "imp_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")

SetBleedingVoiceOver(REP, REP, "rep_off_com_report_us_overwhelmed", 1)
SetBleedingVoiceOver(REP, IMP, "rep_off_com_report_enemy_losing", 1)
SetBleedingVoiceOver(IMP, REP, "imp_off_com_report_enemy_losing", 1)
SetBleedingVoiceOver(IMP, IMP, "imp_off_com_report_us_overwhelmed", 1)

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

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

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(IMP, 1.0, "cis_fel_amb_start", 0,1)
SetAmbientMusic(IMP, 0.8, "cis_fel_amb_middle", 1,1)
SetAmbientMusic(IMP, 0.2, "cis_fel_amb_end", 2,1)

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

--OpeningSateliteShot
AddCameraShot(0.711258, 0.002115, 0.702925, -0.002090, 56.597954, 11.018661, -84.290337);
end
Here is the logfile.
Last edited by ZoomV on Mon Mar 02, 2015 2:49 pm, edited 1 time in total.
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 »

Thanks for remembering to use code tags.

You really should start using Notepad++

It makes stuff like this easy to see.

Image
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: local sides not spawning more than one unit

Post by Anakin »

OK now we know why there are acklays :D For the other problem you should try to swap the order. So first the prisoners than guards and at last the acklays.

@THEWULFMAN: I always like your gifs :D everytime you post a picture i wait for it to do something.
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 had already figured out the acklays
ZoomV wrote:EDIT: oohhh I know the comment block isn't commenting out the acklays. If you look its "---[[" the first two dashes initiate a single line comment thus eliminating the remaining "-[["
Anakin, I'll poke at it tonight if I get the time, I'd rather not change the team numbers because it means I have to crack open BVS and edit all of the CPs.
Post Reply