Kloki38 Posted July 1, 2016 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); } } } 0 Share this post Link to post
scifista42 Posted July 1, 2016 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. 0 Share this post Link to post
scifista42 Posted July 1, 2016 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. 0 Share this post Link to post
Graf Zahl Posted July 1, 2016 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. 0 Share this post Link to post