Page 1 of 1
CP Number ~ Number of Units
Posted: Sat Aug 16, 2008 7:21 pm
by Chamboozer
Is there a way to link the number of CP's a faction has to the number of units it can spawn, while still allowing the player to spawn at will? In this case, to make each CP the CIS has allow them to spawn 30 units, so 5 cp's = 150 units?
Re: CP Number ~ Number of Units
Posted: Sat Aug 16, 2008 7:28 pm
by AceMastermind
You can try playing around with AISpawnWeight.
Select a CP in ZE then go to Object Instance on the right and page down to the bottom to see it.
Try it out and let us know the outcome.
Edit:
Ok nevermind this, I see what you're saying now.
Re: CP Number ~ Number of Units
Posted: Sat Aug 16, 2008 7:49 pm
by [RDH]Zerted
Listen to the CP cpature events and keep track of how many CPs each team has (read the scripting doc).
Use SetUnitCount() to change the amount of AI allowed to spawn. Note: If you recude the amount of AI allowed ingame to a number below the currectly spawned AI, the game won't automatically kill the extra bots, but it won't let any more bots spawn on that team until the extra units die.
Some SetUnitCount examples:
Code: Select all
SetUnitCount(ambushTeam4, ambushCount4)
SetUnitCount(flag_rebel, 1)
SetUnitCount(hangar_ambush, 5)
SetUnitCount(hangar_ambush, 6)
SetUnitCount(rebels1, 8)
SetUnitCount(rebels1, 80)
SetUnitCount(rebels2, 8)
SetUnitCount(rebels2, 80)
SetUnitCount(snipers, 2)
SetUnitCount(team, side.units)
SetUnitCount(4, 4)
SetUnitCount(4, 8)
SetUnitCount(5, 4)
SetUnitCount(AMBUSH1, 6)
SetUnitCount(BODYGUARDS, 5)
SetUnitCount(BOO, 9)
SetUnitCount(BOSS, 1)
SetUnitCount(DEF, 2)
Re: CP Number ~ Number of Units
Posted: Sat Aug 16, 2008 7:56 pm
by Chamboozer
AceMastermind wrote:You can try playing around with AISpawnWeight.
Select a CP in ZE then go to Object Instance on the right and page down to the bottom to see it.
Try it out and let us know the outcome.
Edit:
Ok nevermind this, I see what you're saying now.
I will get onto this after I solve the problem that came up. The game crashes after the map loads and I get this in the Bfront2.log.
Message Severity: 2
.\Memory\RedMemory.cpp(634)
Allocating -8512 bytes attempt failed - no free blocks left in Heap 5 (Runtime)
Message Severity: 3
.\Memory\RedMemory.cpp(538)
Allocating -8512 bytes failed - no free blocks left in Heap 5 (Runtime)
Is there a way to "increase" the capacity of 'Heap 5'? And what is Heap 5?
EDIT: Nvm. I accidentally told the game to spawn an infinite number of walkers. No wonder it overloaded the system. It's fixed now and I'll look into what both of you have said.
Oh, and thank you Zerted, i'll look into that too after this is fixed.
Re: CP Number ~ Number of Units
Posted: Sat Aug 16, 2008 9:27 pm
by [RDH]Zerted
AceMastermind wrote:Edit:
Ok nevermind this, I see what you're saying now.
Just look into what I said. AceMastermind thought you were asking about something else.
Re: CP Number ~ Number of Units
Posted: Sat Aug 16, 2008 9:33 pm
by Chamboozer
On a side note, do you know how to get the AI to prioritize the defense of a CP over the attack of an enemy's? Usually you'd look forward to an ATTE Spawning, but not when it means every single one of your AI teammates will run off following it while leaving your only CP, already close to being overrun, to it's fate.