2009XboxLiveKid Posted October 24, 2020 So i want to make a room that makes the player clear the room, before making a keycard appear, but I duck ass at scripting, how would this be done? Ex. ( player fights like 15 monsters, and the last one dies, and makes the key card appaear) 0 Share this post Link to post
1 Kappes Buur Posted October 24, 2020 (edited) It's easy enough with a simple OPEN script. All you need to do is use a couple of action specials: #include "zcommon.acs" // int ThingCount (int type, int tid); // 135:Thing_Spawn (tid, type, angle, newtid) script 200 OPEN { While (ThingCount(T_NONE, 11) > 0) Delay(35); Thing_Spawn ( 10, T_REDSKULLKEY, 0, 0); } Example pwad FRAG_ALL.7z Edited October 24, 2020 by Kappes Buur 2 Share this post Link to post
0 2009XboxLiveKid Posted October 25, 2020 21 hours ago, Kappes Buur said: It's easy enough with a simple OPEN script. All you need to do is use a couple of action specials: #include "zcommon.acs" // int ThingCount (int type, int tid); // 135:Thing_Spawn (tid, type, angle, newtid) script 200 OPEN { While (ThingCount(T_NONE, 11) > 0) Delay(35); Thing_Spawn ( 10, T_REDSKULLKEY, 0, 0); } Example pwad FRAG_ALL.7z Now which part of the script would I change so that there could be more enemys than you spawned? also, how would I make a script that opens a door, after that last demon is killed, and does the same thing again? sorry if these are considered easy questions, im still semi new at mapping, and I know close to nothing with scripting 0 Share this post Link to post
0 Barry Burton Posted October 30, 2020 (edited) On 10/24/2020 at 11:28 PM, 2009XboxLiveKid said: Now which part of the script would I change so that there could be more enemys than you spawned? also, how would I make a script that opens a door, after that last demon is killed, and does the same thing again? sorry if these are considered easy questions, im still semi new at mapping, and I know close to nothing with scripting That script works so that no matter how many enemies you have, it always loops to check if any are alive. In this case, it checks any monsters with a TID of 11. If it counts 0 enemies (meaning they are dead and do not have a TID) it breaks the while loop and goes on to do whatever you specify after. While (ThingCount(T_NONE, 11) > 0) This says as long as enemies with a TID of 11 are alive, do the following: Delay(35); Which is to wait. This is a loop, so it's going to constantly check to see if enemies with a TID of 11 are alive. When they are all dead, it spawns the Red Skull Key: Thing_Spawn ( 10, T_REDSKULLKEY, 0, 0); If you want a door to open, you'd need to use a Door function like Door_Open and put that at after this Thing_Spawn line. As for doing the whole process again, you could simply just call the script again at the end: ACS_Execute(200, 0); I believe that will work, but untested of course. 1 Share this post Link to post
So i want to make a room that makes the player clear the room, before making a keycard appear, but I duck ass at scripting, how would this be done?
Ex. ( player fights like 15 monsters, and the last one dies, and makes the key card appaear)
Share this post
Link to post