stickguy5000 Posted November 17, 2009 i need the level to end when all the enemies are dead and i cant find the code on zdoom's wiki so can anyone help. 0 Share this post Link to post
gggmork Posted November 17, 2009 for a doom in hexen map, click scripts and paste: #include "zcommon.acs" script 1 OPEN { while(1){ if(ThingCountName("doomimp", 0) == 0 && thingcountname("archvile",0) == 0){ Exit_Normal(0); } delay(1); } } Only add additional similar '&&' lines for every single monster type in your map listed here: http://zdoom.org/wiki/Category:Monster 0 Share this post Link to post
sonic_13 Posted November 17, 2009 It's all ways been mysterious to me how almost every wad I've ever played, map07 is the only map to ever be finished when all enemies are killed. Was wondering if people knew how to make this available to any level and were just sticking to the Dead Simple tradition, or if no body had figured it out yet. I can't remember the last wad I've played (aside from map07 wannabes) that requires you to kill all the baddies to finish (map 30ish wads excluded too). For this alone, I'm interested in whatever it is you're doing, hope you figure it out. 0 Share this post Link to post
Vermil Posted November 17, 2009 The "triggers" attached to the Mancunus and Aracnotron mobjs, that are used on Map07 are hardcoded to that map in the original Dos engine. However, the "trigger" attached to the Keen mobj that opens a door can work on any map. Using Dehacked, it is possible to move the "triggers" to other bad guys. But then Dehacked patches were much more difficult to apply to the Dos engine than source ports these days. 0 Share this post Link to post
DuckReconMajor Posted November 18, 2009 gggmork said:for a doom in hexen map, click scripts and paste: #include "zcommon.acs" script 1 OPEN { while(1){ if(ThingCountName("doomimp", 0) == 0 && thingcountname("archvile",0) == 0){ Exit_Normal(0); } delay(1); } } Only add additional similar '&&' lines for every single monster type in your map listed here: http://zdoom.org/wiki/Category:Monster Would it be okay to have the monsters trigger the check? I tried that the other day and it seemed to work. 0 Share this post Link to post
gggmork Posted November 18, 2009 They sort of do in that code I guess (when the total number of imps (and all other monster types) becomes 0, then the 'if' condition is met to exit the level, so the monsters kinda triggered it by dying unless you meant something else). But there might be some other way to do it (using 'thingcount' instead of 'thingcountname' should work. I'm not really familiar with any other easy method/built in function if there is another). 0 Share this post Link to post
andrewj Posted November 18, 2009 I think DuckReconMajor means you can give the monsters a certain special and TID, and the script will only run each time one of them dies (instead of running all the time). Also, thingCountName() may be an expensive function to call (especially if the map has huge numbers of things in it), so it may be better to use a delay longer than 1 tic. 0 Share this post Link to post
gggmork Posted November 18, 2009 That sounds a lot better/more efficient. First I gave all monsters thing action 80 (script execute) with script parameter = 1 (so any monster death triggers the script) Then: #include "zcommon.acs" script 1(void) { print(d: thingcountname("doomimp",0), s: " imps left\n", d:thingcountname("archvile",0), s: "viles left"); if(ThingCountName("doomimp", 0) == 0 && thingcountname("archvile",0) == 0){ delay(100); Exit_Normal(0); terminate; } } 0 Share this post Link to post