Jump to content
  • 0

ACS Floor Raise / Lower from Switch


rockyroadn

Question

Hello everyone!

Started playing around the past few days with ultimate doom builder and am trying learn how to use ACS scripting.
With the script below I am able to raise and lower a sector from a single switch.  What I'm having trouble with is getting that switch to be more reactive and instantly start lowering or raising the sector once its in motion, and not have to wait for the sector to fully reach the floor or ceiling height to be able to be activated again?

bool isMovingUp = FALSE;
script 2 (void)
{
    if (isMovingUp) {
        isMovingUp = FALSE;
        ACS_NamedTerminate("setFloorToCeiling", 0);
        ACS_NamedExecute("setFloorToFloor", 0, 1);

    } else {
        isMovingUp= TRUE;
        ACS_NamedTerminate("setFloorToFloor", 0);
        ACS_NamedExecute("setFloorToCeiling", 0, 1);
    }
}

script "setFloorToCeiling" (int sectorNumber)
{
    Floor_MoveToValue(sectorNumber, 10, 128, 0);
}

script "setFloorToFloor" (int sectorNumber)
{
    Floor_MoveToValue(sectorNumber, 10, 0, 0);
}

 

Edited by rockyroadn

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