Changing unit count mid-way through a script?

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
sampip
General
General
Posts: 792
Joined: Mon Mar 16, 2009 12:08 pm
Projects :: Something big. And exciting.
Games I'm Playing :: Battlefield 3
xbox live or psn: masowner66
Location: Zebra

Changing unit count mid-way through a script?

Post by sampip »

I know that SetUnitCount(?, ?) sets the amount of units on the battlefield, so I tried putting it in a script, to change the unit count around a bit. For instance, you could start off with a unit count of 5 for a team and then go straight to 20 after the first objective. Problem is, it doesn't work because this:
Hidden/Spoiler:
cis = {
team = CIS,
reinforcements = -1,
units = 5,<======
soldier = { "cis_inf_marine",9, 25},
assault = { "cis_inf_rocketeer",1, 4},
engineer = { "cis_inf_engineer",1, 4},
sniper = { "cis_inf_sniper",1, 4},
officer = {"cis_inf_rifleman",1, 4},
special = { "cis_inf_droideka",1, 4},
sets it as a default. I can't get rid of that line because it crashes the map. I also tried changing the unit count to -1 but that also crashes the map.
I know there are work-arounds but I was wondering if this method was possible at all?
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: Changing unit count mid-way through a script?

Post by [RDH]Zerted »

It should work... Are you sure your script was working?
User avatar
ThePanda
Private Second Class
Posts: 74
Joined: Sat Dec 20, 2008 4:22 pm

Re: Changing unit count mid-way through a script?

Post by ThePanda »

Have you got SetUberMode (correct me if wrong) in your LUA?
I read somewhere that it breaks SetUnitCount.
User avatar
sampip
General
General
Posts: 792
Joined: Mon Mar 16, 2009 12:08 pm
Projects :: Something big. And exciting.
Games I'm Playing :: Battlefield 3
xbox live or psn: masowner66
Location: Zebra

Re: Changing unit count mid-way through a script?

Post by sampip »

[RDH]Zerted wrote:It should work... Are you sure your script was working?
I'll give it another go just to check, I might have forgotten to do something.
ThePanda wrote:Have you got SetUberMode (correct me if wrong) in your LUA?
I read somewhere that it breaks SetUnitCount.
SetUberMode breaks the max unit count on the battlefield, it just means you can have over 32 units on the battlefield.
User avatar
ThePanda
Private Second Class
Posts: 74
Joined: Sat Dec 20, 2008 4:22 pm

Re: Changing unit count mid-way through a script?

Post by ThePanda »

sampip wrote:
ThePanda wrote:Have you got SetUberMode (correct me if wrong) in your LUA?
I read somewhere that it breaks SetUnitCount.
SetUberMode breaks the max unit count on the battlefield, it just means you can have over 32 units on the battlefield.
Yeah I know that :), it's just I thought I read somewhere that SetUberMode also prevents SetUnitCount from working correctly too for some reason.

I also have this problem with changing the unit count, so any help would be gold.
User avatar
sampip
General
General
Posts: 792
Joined: Mon Mar 16, 2009 12:08 pm
Projects :: Something big. And exciting.
Games I'm Playing :: Battlefield 3
xbox live or psn: masowner66
Location: Zebra

Re: Changing unit count mid-way through a script?

Post by sampip »

If you read what I did in my first post, Zerted said that should work. Presumably you are doing this for a campaign?
Post Reply