Jump to content
  • 0

Script help: Monster death lowers floor


Cacodoomonic

Question

I'm pretty sure this is a simple oversight on my part. I have a boss fight that is supposed to work like this:

 

NORMAL DIFFICULTY

Boss is killed, it lowers a wall revealing the exit.

 

HARD DIFFICULTY

Two Boss Monsters are killed, it lowers a wall revealing the exit.

 

Easily achieved on NORMAL difficulty.

 

This is the script I used.

#include "zcommon.acs"
Script 1 (void)
{
	Floor_LowerToLowest (30, 8);
}

The wall that lowers is tagged 30, at a speed of 8, and the script is set to activate within the boss monsters properties. 

The issue I'm having is getting this same script to work but for the higher difficulty that requires the death of TWO boss monsters.

 

Killing only one activates the exit wall to lower, because of how this is set up. Any advice on how to set it up so that it requires all monsters with a certain tag (in this case 31) in order for the script to activate? 

 

I set both monsters as tag 31, both with this script in their properties. But this does not work. 

Can anyone help advise? I need a method that works differently so that the easier difficulties that require only ONE boss monster to die are not affected. So maybe something that is tied to the monsters tag? Any help is appreciated.

Share this post


Link to post

3 answers to this question

Recommended Posts

  • 1
Posted (edited)

Here how I like to do this, this is in fact from my own map I'm workings on.

 

script 1 OPEN
{
	While(ThingCount(T_NONE, 49) > 0)
	Delay(35);
	Floor_MoveToValue (46,64,24);
}

In this case my target monster have a thingId of 49, once there are no monster with said ThingID alive the floor Move.

 

The practical thing here is that it will work on every difficulty levels even when changing the number of monster based on difficulty.

 

Do note you need to have a delay at one point in the script, in this case the game perform the check every 1 seconds (there are 35 tics per seconds).

 

 

Edited by Delisk

Share this post


Link to post
  • 0
Posted (edited)

For your two monsters on hard mode I'd use a script like this -

int bossMonstersKilled = 0;

script 2 (void)

{
	bossMonstersKilled = bossMonstersKilled + 1;

	if (bossMonstersKilled == 2)
	{
		Floor_LowerToLowest (30, 8);
	}
}

And make sure to use "226 Script Execute Always" as the action on the monsters. :)
Here is an example wad. On HMP and lower there is one monster to kill and two on UV.

ScriptExample_1.zip

Edited by JaySmithen

Share this post


Link to post
  • 0

Thanks a lot, both methods work awesome. Sorry it took so long to reply, I only just got the chance to check the methods out. Love them both, both solved the problem. I'll use both methods in the future!

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
Answer this question...

×   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...