Jump to content
  • 0

Zdoom script help: How do I setup ACS_ExecuteAlways on a monster spawned from a script


Barbeerian

Question

Hello, I'm having a problem setting up an encounter with scripts. Here's what I'm trying to do:

 

-The player flips a switch in the level which opens a locked door and spawns monsters in the previously locked part of the room.

Note: These spawns need to happen via script because you can access part of the room earlier, so the first set of monsters is setup in the editor. The second set of monsters needs to be spawned in after the door is unlocked.

 


script 3 (void)
{
    Door_Raise(7, 32, 0, 0);
    Thing_SpawnFacing(100, 3, 1, 254);
    Thing_SpawnFacing(101, 5, 1, 255);
    Thing_SpawnFacing(102, 5, 1, 255);

    if (GameSkill() >= 1)
    {
        Thing_SpawnFacing(103, 1, 1, 255);
        Thing_SpawnFacing(104, 1, 1, 255);
    }

    if (GameSkill() >= 2)
    {
        Thing_SpawnFacing(106, 28, 1, 255);
    }

    if (GameSkill() >= 3)
    {
        Thing_SpawnFacing(105, 20, 1, 255);
    }

    delay(1);
    //Set all the spawned monsters to Ambush
    SetActorProperty(255, APROP_Ambush, 1);
    SetActorProperty(254, APROP_Ambush, 1);
    //Set just the Baron to execute script 5 when it dies
    SetActorProperty(254, ACS_ExecuteAlways, 5);
}

 

-Once the player kills the Baron (who is part of the group of monsters spawned) another door unlocks.

 


script 5 (void)
{
    //open door when the baron dies
    //if (ThingCount(T_NONE, 254) == 0)
    //{
    //}
    Door_Raise(6, 32, 0, 0);
}

 

I can't figure out how to setup ACS_ExecuteAlways on a monster I spawn in via script though, so my second door opening script never gets executed when the Baron dies. I know the last line of Script 3 is wrong, ACS_ExecuteAlways isn't an actor property but I can't figure out which command I need to use to set an actors death special to call a script.

Edited by Barbeerian

Share this post


Link to post

2 answers to this question

Recommended Posts

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