Event stopping player movement

This forum is the place to learn about and discuss ADRIFT 5. Feel free to mention any bugs you find here, but please also add these to the Bugs & Enhancements list.

Please also refer to the ADRIFT 5 Wiki for more information.
Post Reply
User avatar
P/o Prune
Site Admin
Posts: 4707
Joined: Mon Jun 24, 2002 9:18 am
Points: 93
Location: Denmark

Event stopping player movement

Post by P/o Prune »

How do I prevent the player from going in a certain direction if an event is running?
D-Day in progress 86Kb (Slowly drifting)
October 31st: 42Kb (possible entry for IFComp 2021 :wink: )
User avatar
Lazzah
Moderator
Posts: 2427
Joined: Thu Mar 31, 2011 5:54 am
Points: 65
Location: Clacton-on-Sea, Essex

Re: Event stopping player movement

Post by Lazzah »

I would create a variable which is set to 1 in the task(s) that start the event. Then add a restriction in the exits for the player's location referencing that variable. In the task that is executed when the event ends, set the variable back to zero.

Attached is a little demo.

I hope it helps.
No Go North.taf
(15.6 KiB) Downloaded 3 times
The Axe of Kolt, The Spectre of Castle Coris, The Fortress of Fear, Die Feuerfaust, The Lost Children, Run, Bronwynn, Run, The Call of the Shaman, The Lost Labyrinth of Lazaitch, Magnetic Moon, Starship Quest, Revenge of the Space Pirates
User avatar
P/o Prune
Site Admin
Posts: 4707
Joined: Mon Jun 24, 2002 9:18 am
Points: 93
Location: Denmark

Re: Event stopping player movement

Post by P/o Prune »

Interesting... Thank you, Lazzah.
What if I want the direction north to be blocked, say after a certain number of turns into the event?
D-Day in progress 86Kb (Slowly drifting)
October 31st: 42Kb (possible entry for IFComp 2021 :wink: )
User avatar
Lazzah
Moderator
Posts: 2427
Joined: Thu Mar 31, 2011 5:54 am
Points: 65
Location: Clacton-on-Sea, Essex

Re: Event stopping player movement

Post by Lazzah »

Then you simply create a specific task, in which the variable is set to 1, which is called by a sub-event "x" number of moves after the event starts.
The Axe of Kolt, The Spectre of Castle Coris, The Fortress of Fear, Die Feuerfaust, The Lost Children, Run, Bronwynn, Run, The Call of the Shaman, The Lost Labyrinth of Lazaitch, Magnetic Moon, Starship Quest, Revenge of the Space Pirates
Post Reply