I am creating a trench warfare map and have hundreds of instances of the mp_trench_01 and branch_trench_wall objects laid out already. Unfortunately, if any of these are destroyed, it screws up the trench system pretty badly. I have been looking for a way to make these objects invincible and have already tried a solution I found on this forum where you do the following:
1. Create an entity group called eg_invincible and add all the objects you want to be invincible to it.
2. Open the mapname_ID.scar file and add this line of code: EGroup_SetInvulnerable(eg_invincible, true)
3. Without saving in WorldBuilder, export the package.
I have tried this to no avail, as when I start up the map it states that there was a fatal scar error.
My scar file looks like this:
function OnInitID()
-- [[ Markers ]]
-- [[ Squad Groups ]]
-- [[ Entity Groups ]]
EGroup_SetInvulnerable(eg_invincible, true)
end
And my entity group looks like this:
Name: eg_invincible
ID: 4
Num Items: 924
Owner: Team 10001
I have no idea what is wrong as I am still fairly new to map creation. Any help is greatly appreciated! |