Entity limit?

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
Dasher
Private Third Class
Posts: 49
Joined: Fri Aug 04, 2017 1:46 pm
Projects :: Loronar Jade Moon
xbox live or psn: No gamertag set

Entity limit?

Post by Dasher »

I was wondering whether there is a possible code that could limit the number of entities being on a map, e.g. I don't want more than one shield on my map, so can I set a maximum count in my LUA script? I'm having the problem that the game ignores the if statement if GetCommandPostTeam("cp3") == 1.
Here's my code:
Hidden/Spoiler:
ActivateShield = OnFinishCapture(function(post,holding)
if GetCommandPostTeam("cp3") == 1 then
ShieldSpawn = GetPathPoint("shield_spawn", 0)
CreateEntity("dur1_shield",ShieldSpawn,"shield")
end
end
)
However the entity gets created everytime a commandpost is captured by team 1, regardless which one it is and I only want the entity to be created if cp3 gets captured.
Post Reply