ACS Scripting Help for Explosions and Variables

Archive of the old editing forum
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.

ACS Scripting Help for Explosions and Variables

Postby taylorm7cl » Mon Sep 04, 2017 12:04 am

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.
taylorm7cl
 
Joined: 27 Jul 2017

Re: ACS Scripting Help for Explosions and Variables

Postby RaveYard » Mon Sep 04, 2017 3:41 am

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
RaveYard
 
Joined: 12 Apr 2013

Re: ACS Scripting Help for Explosions and Variables

Postby taylorm7cl » Mon Sep 04, 2017 2:48 pm

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!
taylorm7cl
 
Joined: 27 Jul 2017

Re: ACS Scripting Help for Explosions and Variables

Postby Nevander » Tue Sep 05, 2017 4:24 am

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.
Nevander
Self-Banned User
 
Joined: 06 Jan 2014


Return to Editing (Archive)

Who is online

Users browsing this forum: No registered users and 1 guest