Is there a Player movement priority?

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: 4827
Joined: Mon Jun 24, 2002 9:18 am
Points: 133
Location: Denmark

Is there a Player movement priority?

Post by P/o Prune »

Is there any (valid) reason why a (Down) movement will not run unless its priority is higher than the other movement (West) priority? :?

Explanation:
Location Kitchen has a door leading down (or west) to a cellar.
The door needs to be unlocked before the PC can walk through. When the door is unlocked, the action will set it to state Open.

I have made to directions in the location directions. West to cellar (restriction: door must be in state open.) And Down (restriction: door must be in state open.)

I have made two specific tasks overriding Player movement. One for each possibility. Priorities are set higher than the general Player movement task.
In my first attempt, the Specific task, West, had a higher priority than the Down task. And when I ran the game, and >down, I got the message: You can't do that. (If I used >west the game reacted as is should, moving the player to the new location.)

After having spent some (a loooong) time trying to figure out what was wrong, I, for some obscure reason, tried to set the Down task priority higher than the West priority, and now it works like a charm.
Why wouldn't it work the other way around? :anyone:
D-Day in progress 86Kb (Slowly drifting)
October 31st: 93Kb (possible entry for IFComp 2021 :wink: )
User avatar
Denk
Posts: 748
Joined: Mon Feb 22, 2016 6:21 pm
Points: 291
Location: Hjørring, Denmark

Re: Is there a Player movement priority?

Post by Denk »

Without looking at your taf-file,my best bets are:
1. You may have more than one door in the game and are using the wrong door in one of the restrictions
2. You have a message in one of the restrictions when the restriction message should be empty (depends on the restriction)

It is hard to say anything more precise without looking at your taf-file.
----------------------------------------------------------------------
The Bash Saga:
1. The Dragon Diamond 2. The Way Home 3. Stone of Wisdom
----------------------------------------------------------------------
User avatar
P/o Prune
Site Admin
Posts: 4827
Joined: Mon Jun 24, 2002 9:18 am
Points: 133
Location: Denmark

Re: Is there a Player movement priority?

Post by P/o Prune »

I'll send you the taf, if it's ok with you?
But in regards to your bets:
1: I do have more than one door in the game. But this particular door is named an iron clad door, and is the only such door in the game.
2: I have removed all messages in restrictions and still ends up with the same result.
:?
D-Day in progress 86Kb (Slowly drifting)
October 31st: 93Kb (possible entry for IFComp 2021 :wink: )
User avatar
Denk
Posts: 748
Joined: Mon Feb 22, 2016 6:21 pm
Points: 291
Location: Hjørring, Denmark

Re: Is there a Player movement priority?

Post by Denk »

Ok, I found the problem:
In another location you have the task "Moving down from top landing". It also overrides player-movement when the direction is Down. This task requires that the player is in location "top landing" which is fine, but the problem is, that this restriction has a restriction message: "You can't do that."

Thus, instead of looking for the next specific task with fulfilled restrictions, it stops and prints the restriction message. If you delete the restriction message it works as intended.

In general, you can use different tasks to handle different situations by using different restrictions, but if you include restriction messages, ADRIFT will stop looking for other matching tasks and just print that message. Thus the priorities become important.
----------------------------------------------------------------------
The Bash Saga:
1. The Dragon Diamond 2. The Way Home 3. Stone of Wisdom
----------------------------------------------------------------------
User avatar
P/o Prune
Site Admin
Posts: 4827
Joined: Mon Jun 24, 2002 9:18 am
Points: 133
Location: Denmark

Re: Is there a Player movement priority?

Post by P/o Prune »

Thanks a million, Denk. You're a lifesaver :D

My problem is that I sometimes use restriction comments to see if a task is run at the correct time. If I forget to delete that comment, things like this will happen.
Note to self:
When using restriction comments as tests. be sure to write the task name in the comment. This way you will always know which task is executed. :wink:
D-Day in progress 86Kb (Slowly drifting)
October 31st: 93Kb (possible entry for IFComp 2021 :wink: )
Post Reply