Jump to content

all monster killed enables event


Recommended Posts

I am trying to make it so when all monsters in a room are killed, an event is activated (monster spawn, door open, lift activates) etc

how can i do that ?

Share this post


Link to post

 

script 1 ENTER

{

 while (ThingCount(T_NONE, TID) > 0)

  Delay(35);

  

   Door_Open(1, 16, 0); //EVENT TRIGGERED BY KILLING ALL MONSTERS WITH THAT TID

}

 

 

 

 

Share this post


Link to post
4 hours ago, SOF2Fragger said:

 

script 1 ENTER

{

 while (ThingCount(T_NONE, TID) > 0)

  Delay(35);

  

   Door_Open(1, 16, 0); //EVENT TRIGGERED BY KILLING ALL MONSTERS WITH THAT TID

}

 

 

 

 

do i need to put all of the monsters tag to 16 ?

Share this post


Link to post
21 minutes ago, NoNameIdeas784 said:

do i need to put all of the monsters tag to 16 ?

You can use any available TID for the monsters. The 16 in the sample is for the action after killing them.

 

You can also use any action, not just the one I used, which does nothing.

Share this post


Link to post
17 hours ago, SOF2Fragger said:

 

script 1 ENTER

{

 while (ThingCount(T_NONE, TID) > 0)

  Delay(35);

  

   Door_Open(1, 16, 0); //EVENT TRIGGERED BY KILLING ALL MONSTERS WITH THAT TID

}

 

 

 

 

i tested it, script has error i cant compile it

Share this post


Link to post
7 hours ago, NoNameIdeas784 said:

i tested it, script has error i cant compile it

 

Because it is Wrong with a capital W

 

script 1 ENTER
{
	while (ThingCount(T_NONE, 2) > 0)
		Delay(35);
  
  	Door_Open(1, 16, 0);
}

Take note of what the script is actually doing: It counts the number of things with the type T_NONE (so any Thing), and with TID = 2. If it counts at least 1 of those, then it will wait 1 second (35 tics) and count again. Once it hits a count of 0, it stops performing the stuff inside the "while" loop (delay) and moves on to the next line, Door_Open.

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...