Jump to content

How would i make a wall lower after a monster is killed in udb


Recommended Posts

It doesn't say it all, actually. It depends on what map format you're using. If it's a Hexen based format (i.e ZDoom or UDMF), you can achieve this by writing a short script that activates upon the enemy's death. With any Boom based format, you might have to tinker with Dehacked and conveyer belts. And if you're trying to do it in Vanilla, you're limited to whatever tag 666/667 special works on any specific map. If any of these sound close to what format you're mapping in, I can elaborate further.

Share this post


Link to post
1 minute ago, JustAthel said:

It doesn't say it all, actually. It depends on what map format you're using. If it's a Hexen based format (i.e ZDoom or UDMF), you can achieve this by writing a short script that activates upon the enemy's death. With any Boom based format, you might have to tinker with Dehacked and conveyer belts. And if you're trying to do it in Vanilla, you're limited to whatever tag 666/667 special works on any specific map. If any of these sound close to what format you're mapping in, I can elaborate further.

 im using gzdoom

Share this post


Link to post
8 minutes ago, JustAthel said:

It doesn't say it all, actually. It depends on what map format you're using. If it's a Hexen based format (i.e ZDoom or UDMF), you can achieve this by writing a short script that activates upon the enemy's death. With any Boom based format, you might have to tinker with Dehacked and conveyer belts. And if you're trying to do it in Vanilla, you're limited to whatever tag 666/667 special works on any specific map. If any of these sound close to what format you're mapping in, I can elaborate further.

also how could i script that?

Share this post


Link to post

You mean UDFM format?

 

Yes, you can script that. My script example:

#include "zcommon.acs"

bool spawn1 = false;

script 666 OPEN
{
    while (true) {

        Delay(1);

        if (ThingCount(T_CYBERDEMON, 4) == 0 && spawn1 == false) {
            Delay(1);

            Door_Open(34, 32, 0);
            // or another action here

            spawn1 = true; // just for single action
        }
    }
}

As soon as a Cyberdemon with tag 4 killed (or all Cybies tagged 4) --> action will be executed once.

 

Or just attach an action for a monster -- "Action / Tag / Misc" tab in thing editor

Share this post


Link to post

In UDMF you don't even need a script - you can attach an action to a thing and it will trigger when that thing dies. I'm afraid I don't know how to do this in UDB as I don't use it, but it's pretty easy in SLADE's map editor.

 

In Doom format, if you're targeting modern Doom format ports like dsda and this particular demon is the only one of its kind, you can create Dead Simple-like actions that trigger when all demons of a type die in UMAPINFO.

Share this post


Link to post
2 hours ago, Novaseer said:

In UDMF you don't even need a script - you can attach an action to a thing and it will trigger when that thing dies. I'm afraid I don't know how to do this in UDB as I don't use it, but it's pretty easy in SLADE's map editor.

 

If there is only the one enemy of that type, then yes, using an action on a thing tagged the same number as the sector. But that method will go off if any monsters with that tag are killed. If you want the action to occur only after two or more enemies are killed, then a script is required.

Share this post


Link to post
3 hours ago, purple_ruberoid said:

You mean UDFM format?

 

Yes, you can script that. My script example:


#include "zcommon.acs"

bool spawn1 = false;

script 666 OPEN
{
    while (true) {

        Delay(1);

        if (ThingCount(T_CYBERDEMON, 4) == 0 && spawn1 == false) {
            Delay(1);

            Door_Open(34, 32, 0);
            // or another action here

            spawn1 = true; // just for single action
        }
    }
}

As soon as a Cyberdemon with tag 4 killed (or all Cybies tagged 4) --> action will be executed once.

 

Or just attach an action for a monster -- "Action / Tag / Misc" tab in thing editor

Thank you very much!

Share this post


Link to post
9 hours ago, 35thcanto said:

 im using gzdoom

 

You do not need a script.

 

Tag the sector which should lower, for example 11

Attach an action special to the monster such as, for example 20

 

z02VYXl.png

 

shooting the monster will lower the wall

Share this post


Link to post
23 minutes ago, Kappes Buur said:

 

You do not need a script.

 

Tag the sector which should lower, for example 11

Attach an action special to the monster such as, for example 20

 

z02VYXl.png

 

shooting the monster will lower the wall

aight thanks!

Share this post


Link to post
On 4/23/2024 at 3:27 PM, purple_ruberoid said:

You mean UDFM format?

 

Yes, you can script that. My script example...


There is a less brute force way to do this that doesn't require running a constant loop, and only calling the script when the relevant monster dies. Here's my script:

#include "zcommon.acs"

script 1 (void)
{
    if(ThingCount(T_none,665)==0)
    {
        Floor_LowerByValue (666,16,120);
    }
}

And here is how one of the relevant monsters is set up:
image.png.a3b9c5ecc54a64cab6df0fb4b791ef1d.png

So, for this example, any time the script is called, it checks for the count of things of any type with tag 665. Every monster with tag 665 calls the script when it dies. When the count is 0, a wall lowers to allow access to a teleporter. I don't know how much performance difference this gives in comparison to running a loop the entire time but it is also slightly more elegant in terms of script complexity, at the expense of setup complexity being a bit more involved.

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