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!
Object Invincibility Issue
28 Dec 2019, 21:02 PM
#1
Posts: 2
29 Dec 2019, 13:27 PM
#2
5
Posts: 3421 | Subs: 11
Make a copy of the _ID.scar file and remove the _ID part from its name so that the new .scar file matches the name of your .sgb file.
Open the .scar file you just created and replace all of its content with this code:
Save the map in the World Builder and export package.
This way you don't have to re-add the code to the _ID.scar file as its automatically generated by World Builder and shouldn't be edited by hand anymore (this used to be a workaround a long time ago that is no longer necessary - <map name>.scar works now).
Open the .scar file you just created and replace all of its content with this code:
function Map_OnInit()
EGroup_SetInvulnerable(eg_invincible, true)
end
Scar_AddInit(Map_OnInit)
Save the map in the World Builder and export package.
This way you don't have to re-add the code to the _ID.scar file as its automatically generated by World Builder and shouldn't be edited by hand anymore (this used to be a workaround a long time ago that is no longer necessary - <map name>.scar works now).
29 Dec 2019, 19:23 PM
#3
Posts: 2
This worked perfectly! Thank you very much!
PAGES (1)
1 user is browsing this thread:
1 guest
Livestreams
32 | |||||
9 | |||||
1 | |||||
230 | |||||
19 | |||||
11 | |||||
6 | |||||
2 | |||||
2 | |||||
1 |
Ladders Top 10
-
#Steam AliasWL%Streak
- 1.831222.789+37
- 2.34957.860+14
- 3.589215.733+4
- 4.1099614.642-1
- 5.280162.633+8
- 6.305114.728+1
- 7.916405.693-2
- 8.271108.715+22
- 9.721440.621+3
- 10.1041674.607-2
Replay highlight
VS
- cblanco ★
- 보드카 중대
- VonManteuffel
- Heartless Jäger
Einhoven Country
Honor it
9
Download
1231
Board Info
403 users are online:
403 guests
1 post in the last 24h
7 posts in the last week
39 posts in the last month
7 posts in the last week
39 posts in the last month
Registered members: 49063
Welcome our newest member, jennifermary
Most online: 2043 users on 29 Oct 2023, 01:04 AM
Welcome our newest member, jennifermary
Most online: 2043 users on 29 Oct 2023, 01:04 AM