NoWaves Posted September 30, 2015 How would one go about making a ACS script so that if say, the 3 enemies in the room are successfully killed , a door opens? 0 Share this post Link to post
scifista42 Posted September 30, 2015 Give tag 3 to the door and TID 2 to each of the monsters. Also set Action of each of the monsters to ACS_ExecuteAlways with first parameter 1. Now put this script to SCRIPTS window:#include "zcommon.acs" script 1 (void) { if(ThingCount(T_NONE,2)==0) { Door_Open(3,16,0); } } Of course, the numbers 1, 2 and 3 in my example are arbitrary numbers, replace them with whatever numbers you want. They can even match each other, because sector tags, thing TIDs and script numbers are separate properties. Reference to used functions: http://zdoom.org/wiki/ACS_ExecuteAlways http://zdoom.org/wiki/ThingCount http://zdoom.org/wiki/Door_Open 0 Share this post Link to post
Unterspahgenzich Posted October 1, 2015 This is just the way I learnt to do stuff like this, I learned it from Chubzdoomer's Doom RPG explanation video and it's a neat way of letting me change the music or activate some other script in my wad. This might be a little over-complicated but I really like this method, here's what I wrote in a text file to help me remember how to use these sorts of scripts. You can also use this in conjunction with things like "Check_Inventory" and such, here's something I wrote in a text document to help me remember how to use these scripts. Spoiler variable scripts require a variable before any script is written e.g: ( #include zcommon.acs int quest1active = 1; int quest1kills - 0; script 1 { ) We can change the variables through using a linedef, killing a monster, etc. etc. if we set it's action to script execute (set to action 226, scrip execute always for monster death activated scripts). This script changes the music if a death count reaches its goal and reverts the variable to 0. Here's how we change the variables: e.g: ( script 1 (void) { if(quest1active==1) { quest1kills++; if (quest1kills>=GOAL) { setmusic("MUSIC",0,0); quest1kills = quest1kills - GOAL; } } } ) If you were wondering about why I had the "quest1active" at the start, for some reason the scripts don't work if I don't do have that there. For now I'm just going to stick to that until I can find out the problem, but maybe you can find a workaround. 0 Share this post Link to post
scifista42 Posted October 1, 2015 AwesomeO-789 said:Edit: The script doesn't look right on this forum, Use [code] tags like I did (quote my previous post to see the usage). 0 Share this post Link to post
Unterspahgenzich Posted October 1, 2015 scifista42 said:Use [code] tags like I did (quote my previous post to see the usage). Thanks! 0 Share this post Link to post