Hi,
In the works of my unofficial Doom 2 expansion, I need some help with ACS scripting. What I need to do is I need to first have the script check if the enemies of a certain type are dead, if so, open a door with a switch. That switch then should be activated and cause a massive explosion, similar to the Icon Of Sin's death, but in all directions, not just one. After that, a floor needs to lower to provide access to the exit teleporter.
I can open a door with just basic scripting, but I don't know how to create variables testing for certain actors to be alive and create explosion effects and then lower a floor. Can anyone help on what I'd need to do exactly? It'd be highly appreciated!
Many thanks.
ACS Scripting Help for Explosions and Variables
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
-
- Posts: 21
- Joined: Thu Jul 27, 2017 11:16 am
Re: ACS Scripting Help for Explosions and Variables
To check if actors are alive (and how many):
https://zdoom.org/wiki/ThingCount
As for explosion effects, you need to dwell into Decorate (or ZScript)
https://zdoom.org/wiki/DECORATE
https://zdoom.org/wiki/ThingCount
As for explosion effects, you need to dwell into Decorate (or ZScript)
https://zdoom.org/wiki/DECORATE
-
- Posts: 21
- Joined: Thu Jul 27, 2017 11:16 am
Re: ACS Scripting Help for Explosions and Variables
There's an issue for the variable of actors, what actor I am trying to define is a custom actor in decorate. This actor is the Guardian, it has an ID of 15004, but I don't know how to make it work with the "ThingCount" script. Since the Baron of Hell is the "parent" of the Guardian, its define T_ variable should be T_Guardian as per my wish, but I don't know how to set the define tag on something, the Baron of Hell is T_BARON, how would I make the Guardian to have its own defined tag, such as T_Guardian?
As for explosions, I already know about decorate. I'm not sure how I could summon the "explosion" like from a rocket launcher or such in a script.
Thanks!
As for explosions, I already know about decorate. I'm not sure how I could summon the "explosion" like from a rocket launcher or such in a script.
Thanks!
Re: ACS Scripting Help for Explosions and Variables
Three ways to do this:
1) In your map, give the Guardian a TID. Then do ThingCount(T_NONE, tid).
2) Do the same as step 1 except don't give it a TID and instead change T_NONE to a unique spawn ID given to the Guardian in DECORATE and make tid 0.
3) If you want it to work always on every map, you can do a LOADACS with a script that does ThingCount(spawnID, 0) using the spawnID from above.
The only thing is you can't reference it as T_GUARDIAN in ACS unless you do #define T_GUARDIAN spawnID at the top of your script file.
Also 15004 is not spawnID. That is probably DoomEd number, which allows you to place it in a map. SpawnID is a separate number. You can find the list [wiki=Doom_spawn_numbers]here[/wiki].
1) In your map, give the Guardian a TID. Then do ThingCount(T_NONE, tid).
2) Do the same as step 1 except don't give it a TID and instead change T_NONE to a unique spawn ID given to the Guardian in DECORATE and make tid 0.
3) If you want it to work always on every map, you can do a LOADACS with a script that does ThingCount(spawnID, 0) using the spawnID from above.
The only thing is you can't reference it as T_GUARDIAN in ACS unless you do #define T_GUARDIAN spawnID at the top of your script file.
Also 15004 is not spawnID. That is probably DoomEd number, which allows you to place it in a map. SpawnID is a separate number. You can find the list [wiki=Doom_spawn_numbers]here[/wiki].