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)
0 user is browsing this thread:
Livestreams
42 | |||||
143 | |||||
6 | |||||
3 | |||||
2 |
Ladders Top 10
-
#Steam AliasWL%Streak
- 1.831222.789+37
- 2.35057.860+15
- 3.1110614.644+11
- 4.921405.695+5
- 5.634229.735+8
- 6.276108.719+27
- 7.306114.729+2
- 8.262137.657+3
- 9.1045675.608+3
- 10.722440.621+4
Replay highlight
VS
- cblanco ★
- 보드카 중대
- VonManteuffel
- Heartless Jäger
Einhoven Country
Honor it
9
Download
1237
Board Info
924 users are online:
924 guests
1 post in the last 24h
6 posts in the last week
34 posts in the last month
6 posts in the last week
34 posts in the last month
Registered members: 49187
Welcome our newest member, manclubgayote
Most online: 2043 users on 29 Oct 2023, 01:04 AM
Welcome our newest member, manclubgayote
Most online: 2043 users on 29 Oct 2023, 01:04 AM