HyperLuke Posted April 11, 2017 How do you tie events such as opening a door to killing the entirety of a group of monsters. Currently in the GZDoom Builder editor, I can only make it so that when any one of the group members is killed, the door opens. 0 Share this post Link to post
1 scifista42 Posted April 12, 2017 (edited) #include "zcommon.acs" script 12 (void) { if(ThingCount(T_NONE,34)==0) { Door_Open(56,16); } } In thing properties of monsters belonging to the group, set a Tag "34" and an Action "ACS_ExecuteAlways" with Argument1 "12". Then, in the game, once the last one of these monsters dies, a door with Tag "56" will open with speed "16". Of course, the numbers 12, 34, 56 and 16 are arbitrary, change them to whatever numbers suit your map. Your map must be in Hexen format or UDMF for this to be possible, not in Doom format, in which you can't assign Tags and Actions to things (in your case, to monsters). And of course, a modern ZDoom-based port (or whatever port that supports both the map format and ACS scripts) will be required to play the map, classic ports tend to only support the Doom map format and not support ACS at all. Edited April 12, 2017 by scifista42 1 Share this post Link to post
0 scifista42 Posted April 11, 2017 Give all monsters in the group a specific tag and an ACS_ExecuteAlways action to execute a script that uses ThingCount to count the number of living monsters with said specific tag and opens a door if the number is 0. 0 Share this post Link to post
0 HyperLuke Posted April 11, 2017 Do i need to use a script? Because there are many times in the original doom games where id did that. Or am I an idiot because they did use scripts? 0 Share this post Link to post
0 scifista42 Posted April 11, 2017 (edited) Scripts didn't exist when the original games were made. Whenever an original game has a sector action take effect after a group of monsters is killed, it's actually an action hardcoded (unchangeably) into the engine for the specific map slot and/or specific monster type and specific sector action. In ports that don't support scripts, the only way of having sector action take effect after a group of monsters is killed is to make a map for the same specific map slot and use the same specific monster type as in the original games, and then the same specific sector action will take effect. In ports that support scripts, scripting allows making this a lot more flexible. Edited April 11, 2017 by scifista42 1 Share this post Link to post
0 everennui Posted April 11, 2017 (edited) Which levels did Doom do this in the original game? Addendum: ...and Doom II? 0 Share this post Link to post
0 scifista42 Posted April 11, 2017 Doom 1: E1M8: All Barons killed -> Floor tagged 666 lowers. E2M8: All Cyberdemons killed -> Level exited. E3M8: All Spider Masterminds killed -> Level exited. E4M6: All Cyberdemons killed -> Door tagged 666 opens. E4M8: All Spider Masterminds killed -> Floor tagged 666 lowers. Doom 2: MAP07: All Mancubi killed -> Floor tagged 666 lowers. MAP07: All Arachnotrons killed -> Floor tagged 667 raises by lowest texture height. 4 Share this post Link to post
0 scifista42 Posted April 11, 2017 That's something different, it's not hardcoded in the engine to the map slot, but the Keen death action opens 666-tagged doors on any map. 1 Share this post Link to post
0 Nevander Posted April 11, 2017 You can also just give all the monsters a TID and then do an OPEN script to do While(ThingCount(0, tid) > 0) Delay(tics); and then do the door open stuff after this line. Now if the monsters spawn in first you will need to do your monster spawn action like Thing_SpawnFacing or whatever, then give a new TID in that. I like to use a 1-tic delay between that and the ThingCount so the game has time to register that a thing with a TID of whatever exists on the map. I've had problems before where spawning then and doing a while in the same tic caused unpredictable results. 0 Share this post Link to post
0 HyperLuke Posted April 12, 2017 Can someone give me a screenshot of an example script which would do such a thing? Sorry, haven't touched the script editor. 0 Share this post Link to post
0 HyperLuke Posted April 12, 2017 What do I do once I have the script compiled? 0 Share this post Link to post
0 Nevander Posted April 12, 2017 Also forgot to mention, a Boom compatible way to do a timed door is purely by guessing and using a voodoo doll. Have your monsters in the room, then upon entering the room trigger a scroller or door to open to allow a voodoo doll to pass and make the corridor it travels down long enough so that you would have killed all the monsters by the time it would open. Might need to do it about 5 times and get an average time. skillsaw does this quite a bit, that is I think this is the method he uses. 0 Share this post Link to post
0 scifista42 Posted April 12, 2017 18 minutes ago, HyperLuke said: What do I do once I have the script compiled? Playtest the map to see if it works? 0 Share this post Link to post
0 HyperLuke Posted April 12, 2017 (edited) Yes, it worked, thank you for the help. 0 Share this post Link to post
0 HyperLuke Posted April 16, 2017 Having another dumb issue, I did the same thing, except with the Lower Floor by Value Command, with a different group of monsters, and it did not work. 0 Share this post Link to post
0 Kappes Buur Posted April 16, 2017 (edited) are you sure that you tagged everything properly? try this #include "zcommon.acs" script 13 open // 20:Floor_LowerByValue ( tag, speed, height ); { While ( ThingCount ( T_NONE, 4 ) > 0 ) Delay(35); Floor_LowerByValue ( 11, 16, 192 ); } TAG4.7z Edited April 16, 2017 by Kappes Buur : use a while loop 0 Share this post Link to post
0 HyperLuke Posted April 16, 2017 Yep that worked, I Think I also forgot to include a Execute always action in the monsters. Thanks. 0 Share this post Link to post
0 Ani Posted May 25, 2022 (edited) Hey, I know this thread is like 2 years old and what not but I'm having trouble here. I got 4 hell knights and a baron set up, there are 3 separate doors I have set as well. I got the baron to open one door fine but when I kill one hellknight, the other two doors open which I don't want. I want the 2 doors to open only you kill all 4 hellknights. Am I missing something? I got the two doors set as tag 23 and I used the script you provided as reference and slightly modified it but something didn't go the way I intended. Think you can help me out a bit? Scripting isn't my strongest understanding as a beginner. Aside from printing messages but that's another story. Edited May 25, 2022 by Ani 0 Share this post Link to post
0 Nevander Posted May 29, 2022 First thing is check your code (post it, whole script file) and check ALL your tags. 0 Share this post Link to post
0 CatWithAComputer Posted October 26, 2022 Does the text in slade must have a specific name? 0 Share this post Link to post
How do you tie events such as opening a door to killing the entirety of a group of monsters.
Currently in the GZDoom Builder editor, I can only make it so that when any one of the group members is killed, the door opens.
Share this post
Link to post