Page 1 of 1

ACS Scripting Help for Explosions and Variables

Posted: Mon Sep 04, 2017 12:04 am
by taylorm7cl
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.

Re: ACS Scripting Help for Explosions and Variables

Posted: Mon Sep 04, 2017 3:41 am
by RaveYard
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

Re: ACS Scripting Help for Explosions and Variables

Posted: Mon Sep 04, 2017 2:48 pm
by taylorm7cl
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!

Re: ACS Scripting Help for Explosions and Variables

Posted: Tue Sep 05, 2017 4:24 am
by Nevander
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 here.