Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Sign in to follow this  
Chubzdoomer

Script Execution (ACS)

Recommended Posts

I consider myself to be very familiar with ZDoom's ACS scripting language, but I do have one important question just in case anyone else has devised a solution: In the event of enemies themselves triggering scripts upon death, it's obvious that if more than one enemy is killed with a single blast (i.e. double barrel shotgun with two lined up, rocket launcher into a group, barrel exploding with enemies all around) the script they're connected to runs only once rather than as many times as there are deaths.

I've discovered through experimenting that one way to track the number of enemies killed is to use a "while" loop and constantly check the number of Things alive with a particular ID. Let's say, however, that you want every enemy killed to give your player a number of experience points or credits. If a barrel explodes and all surrounding enemies die, if they are linked to the same script it will run only once and you'll get just a single XP bonus or credit rather than the product of how many deaths that barrel resulted in.

What do you guys usually do or recommend to circumvent this? I'm sure if I pondered about it long enough I'd be able to devise some crazy solution, but I thought I'd ask here first to see if there is indeed a work-around without having to get too crazy with it.

Share this post


Link to post

You can look into using ACS_ExecuteAlways. This will allow the same script to be run several times simultaneously.

Just use 226 instead of 80 as the monsters' special.

Share this post


Link to post
Gez said:

You can look into using ACS_ExecuteAlways. This will allow the same script to be run several times simultaneously.

Just use 226 instead of 80 as the monsters' special.


That's the absolute exact solution I was looking for. I feel like a complete idiot for being unaware of that action! Thank you very much!

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  
×