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

Gzdoom UDMF ACS help

Recommended Posts

Hi,

I´m currently working on a project, which requires hexen like puzzles.
By activating a switch a door will open in another map in the hub. With the help from wikipedia I created the scripts. The problem is, that the door opens even without the switch. So I don´t know what to do now. Do i missed something or everything is wrong ?

There are the scripts and integers for them:

map with the switch:

world int 0:puzzle1;

script 9 (void)
{
delay(100);
puzzle1++;
}

------------------
map with the door:

int puzzle1;

script 2 ENTER

{

{
if (++puzzle1 == 1)
{
delay(80);
Print(s:"The farm is now unlocked.");
Door_Open(11,32,0);
}
}
}

Share this post


Link to post

Try this:

map with the switch:

world int 0:puzzle1;

script 9 (void)
{
    delay(100);
    puzzle1 = 1;
}
map with the door:
world int 0:puzzle1;

script 2 ENTER
{
    if (puzzle1 == 1)
    {
        delay(80);
        Print(s:"The farm is now unlocked.");
        Door_Open(11,32,0);
    }
}
By the way, I don't understand what's the point of the "delay" in the scripts, especially in script 9, I think you'd better remove them.

Share this post


Link to post

Then at least put the line with "puzzle1 = 1;" before the line with "delay" in script 9, otherwise if the player exited the map before the delay was finished, the script would be interrupted (I think? Maybe even halted forever, even if the map was re-entered?) and the door wouldn't open even though the switch was pressed.

Share this post


Link to post
scifista42 said:

Then at least put the line with "puzzle1 = 1;" before the line with "delay" in script 9, otherwise if the player exited the map before the delay was finished, the script would be interrupted (I think? Maybe even halted forever, even if the map was re-entered?) and the door wouldn't open even though the switch was pressed.



Of course the script will continue if the map gets revisited in a hub.

BTW, Hexen has such a situation in the second hub: One of the puzzle switches is directly next to a level exit so it is very easy to leave the level before the script is done showing its messages, after which it flags the puzzle.

I have run into this multiple times already, and each time had to revisit the map, just to wait for the script to run its course and leave again.

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
×