DoomeDx Posted April 25, 2017 (edited) Hey all! Basically I have this room with 4 doors. One door opens, 5 monsters come out, next door opens, repeat process. The script works, however, when multiple monsters are killed simultaneously, the script doesn't seem to register every kill. It only registers one. Here is how I did it: Every monster executes the "processingKills" script when killed (Using action 80). The script: script "processingKills" (void) { int doorDelay = 80; trapRoomKills++; print(i: trapRoomKills); if (trapRoomKills == 4) { delay(doorDelay); Door_Open(30, 64); } if (trapRoomKills == 9) { delay(doorDelay); door_open(31, 64); } How can I make it so that simultanious kills are registered properly? When I kill 3 monsters with a rocket, it should count as 3 kills rather than just 1. I have a history in programming. No need to hold back in terms of code languages. 0 Share this post Link to post
Albertoni Posted April 25, 2017 Tag monsters, use ThingCount: https://zdoom.org/wiki/ThingCount 0 Share this post Link to post
scifista42 Posted April 25, 2017 6 minutes ago, DoomeDx said: The script works, however, when multiple monsters are killed simultaneously, the script doesn't seem to register every kill. It only registers one. How can I make it so that simultanious kills are registered properly? Use ACS_ExecuteAlways on the monsters instead of ACS_Execute. 0 Share this post Link to post
DoomeDx Posted April 25, 2017 1 minute ago, Albertoni said: Tag monsters, use ThingCount: https://zdoom.org/wiki/ThingCount I officially feel dumb since I knew that function exists. Thanks a ton! 0 Share this post Link to post
leodoom85 Posted April 25, 2017 Probably this should help...https://zdoom.org/wiki/ThingCount Also using while in a script helps a lot with this function 0 Share this post Link to post
DoomeDx Posted April 25, 2017 2 minutes ago, scifista42 said: Use ACS_ExecuteAlways on the monsters instead of ACS_Execute. Done, that did the trick. Thank you 0 Share this post Link to post
Albertoni Posted April 25, 2017 2 minutes ago, scifista42 said: Use ACS_ExecuteAlways on the monsters instead of ACS_Execute. It works in this case, but it's not good practice as you could end up with thousands of scripts running at the same time if you use it carelessly. I'm not speaking from experience, oh no sir. I have never managed to grind ZDoom to a halt doing that. 0 Share this post Link to post
scifista42 Posted April 25, 2017 (edited) 22 minutes ago, Albertoni said: It works in this case, but it's not good practice I disagree. It's usually helpful and harmless. The problem of "thousands of scripts running" should be prevented by not using such design that calls so many scripts in the first place, and even that would be OK if said scripts terminated more or less immediately (instead of staying in infinite/indefinite loops). Edited April 25, 2017 by scifista42 0 Share this post Link to post