Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
hardcore_gamer

Making monsters trigger things

Recommended Posts

So I am making a level with Doom Builder 64 for Doom 64 EX. In the main game I can see things happening as a result of monsters getting killed. For example you kill certain monsters and then something triggers in the level. How do I do this? Is this done via macros or in some other way? I can't figure this one out :/

Share this post


Link to post

It depends on what you want to do specifically. What would you like to happen and what would you like to be the cause of it happening?

Share this post


Link to post
everennui said:

It depends on what you want to do specifically. What would you like to happen and what would you like to be the cause of it happening?


Well to give a simplistic example:

1. Player enters a room. Crosses a linedef that lowers some bars thus blocking the doors.

2. A bunch of monsters appear out of monster closets.

3. Once each monster has been killed the bars raise again allowing the player to leave.

Example B:

Share this post


Link to post

In vanilla the answer is you can't. People get around this by hiding a switch in the monster closet, but in zDoom you have to use a not very complicated scripting function but honestly I haven't done it in so long I forget, look up chubzdoomer he is amazing in scripting in zdoom

Share this post


Link to post

I figured it out. It's fairly simple actually. You make a lindef with a certain action and a tag, and then give another sector that same tag like you would usual. Then you place some monsters and give them the same tag as well as the "trigger on death" tag. Then once all the monsters sharing the tag are dead the linedef fires triggering the effect.

Share this post


Link to post

Set the linedef to action #80 (ACS execute script) and give ig a unique script number (probably 1 if this is your first script. if the linedef is to be triggered by a monster, select, "monster walk over" in the checkboxes. You will then need to make a script in ACS. This is done by opening the script editor in GZDB. First you add this line, #include "zcommon.acs"

That line will tell your compiler (?) that you are using zcommon.ACS as a library of preset/predefined actions. If you are placing an actor (sprites of any kind (key, monster, candle etc.) You will need to place a map spot (which can be found under zdoom in the list of items) you will need to assign the map spot a unique thing Id (tid). After this you will continue your script like:

Script 1 (void)
{
Thing_spawnfacing(1, ....);
}
Look at the wiki for thingspawnfacing. The numbers in the parenthesis correspond to, 1.) The unique tid. 2.)which item will spawn (2 is chaingunner I think (check zdoom spawn numbers)) and 3.) I don't remember off the top of my head. ...oh yeah. If you want it to spawn with the green teleport animation (spawn fog) 1 will turn it off. Sperate the numbers by commas like this (1, 2, 0); and be sure to add a semicolon so the computer knows that the operation is over.

That should work... I'm on my phone now, but I can be more specific if this doesn't help.

To lower some bars use, floor_lowerbyvalue and ambientsound to make it wait add a delay. Look up these terms on the wiki to know how to use them.

I'm not entirely sure how to make the bars lower when the monsters are dead.

I would assume you'd need to define a variable value equal to the number of monsters you placed and have an if statement which checks the value and performs an action when the variable is equal to zero.

I don't know how to make the monsters effect the variable though.

hardcore_gamer said:

I figured it out. It's fairly simple actually. You make a lindef with a certain action and a tag, and then give another sector that same tag like you would usual. Then you place some monsters and give them the same tag as well as the "trigger on death" tag. Then once all the monsters sharing the tag are dead the linedef fires triggering the effect.

Guess we were posting at the same time. Glad you figured it out.

Share this post


Link to post

I'm not familliar with doom 64 mapping but in zdoom and derivatives (gzdoom, etc...), this is how I do it. I basically use ACS scripting so, in our case, you would want something like that:

Let's say you want a door to open after a certain number of let's say, imps are killed.

You would place these imps and give them a thing tag [available on zdoom(doom in hexen format), zdoom(doom in UDMF), etc...].

In this case, we shall give them a tag of i dunno, 1. Then, give your door sector a tag too (let's say 2).

You would then need to program your script as follow:

Script 999 (can be any number from 1 to 999 I think) OPEN [this will execute at the start of the level without having the player activate a linedef, you can use (void) but for simplistic reasons, I left it to OPEN]
{
 while(thingcount(0,1) > 0) // 

1 is the tag you gave your imps, 0 is to specify that any actor can activate the script I think and the second 0 (after the ">") is to specify that once the tagged imps reach that number (i.e, die), x action will triger. 

delay(35); //

You don't need to add a delay but, I always do. It's up to you really.

door_open(2,64); // 

"2" is your door tag and 64 is the speed I think. You can set the speed yourself (from 1 to 255 I believe). 
}
Here would be a more clean version of the script:
Script 999 OPEN
{
 while(thingcout(0,1) > 0)
 delay(35);
 door_open(2,64);
}
Hope that helps.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×