ADRIFT Forum


The place to discuss the ADRIFT Interactive Fiction toolkit

Which tasks are executed first?

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.

Which tasks are executed first?

Postby P/o Prune » Sat Aug 17, 2019 8:33 am

I am having a little trouble with a task in my game and I wonder if it could have something to do with the order tasks are executed.
So in what order are tasks executed?
D-Day in progress 86Kb (Slowly drifting)
Just a Fairy Tale: 60Kb
User avatar
P/o Prune
Site Admin
 
Posts: 4389
Joined: Mon Jun 24, 2002 8:18 am
Location: Denmark
Points: 58

Re: Which tasks are executed first?

Postby saabie » Sun Aug 18, 2019 4:00 pm

There is a description of how it works in the wiki.
The runner debugger will show you which tasks are being executed when in your own game.
saabie
 
Posts: 973
Joined: Fri Aug 12, 2011 2:07 am
Location: Adelaide, South Australia
Points: 25

Re: Which tasks are executed first?

Postby Lazzah » Sun Aug 18, 2019 5:27 pm

saabie wrote:There is a description of how it works in the wiki.

Could we have all that in English please?! :haha: :?
WIP: The Lost Labyrinth of Lazaitch
ALSO AVAILABLE: The Axe of Kolt, The Spectre of Castle Coris, The Fortress of Fear, Die Feuerfaust, The Lost Children, Run, Bronwynn, Run!

COMING SOON: Magnetic Moon, Starship Quest & Revenge of the Space Pirates
User avatar
Lazzah
Moderator
 
Posts: 2221
Joined: Thu Mar 31, 2011 4:54 am
Location: London, England
Points: 17

Re: Which tasks are executed first?

Postby saabie » Mon Aug 19, 2019 4:41 am

I know, I should have drawn a diagram instead of trying to write it out linearly.
There are so many options and ways to override tasks that override other tasks that it is hard to explain every possibility.
But basically general tasks have restrictions checked in priority order, and then the restrictions of overriding specific tasks are checked in their priority order.
Whichever overriding task passes restrictions wins and the tasks are executed in the order specified by the specific task.
Run before = The specific tasks displays its message and runs its actions first, then optionally displays the general task message and/or runs its actions.
Override = Only the specific task runs.
Run After = The general task runs first and then the specific task.

Then there are the "Advanced" options that let multiple tasks run, and the global "Task execution logic" setting in the advanced options that controls what happens if multiple general tasks match the entered command, but most people should never need to touch these.

P/O Prune: If you can give me an example of how those particular tasks are arranged then I will explain why they are running in the order they are.
saabie
 
Posts: 973
Joined: Fri Aug 12, 2011 2:07 am
Location: Adelaide, South Australia
Points: 25

Re: Which tasks are executed first?

Postby P/o Prune » Mon Aug 19, 2019 9:14 am

@Saabie: Thanks for the explanation. It cleared my "problem"

What I was trying to do was the following:
Sometimes I want to add a little atmosphere when the player moves from on location to another.
If I only use the direction in the location description, I get the default: "You move …"
So if I want to write something in the lines of: "As you continue north, in amongst the trees, you get an uneasy feeling of immediate danger" I will have to create a task. Either a general task, or a specific task overriding the default player movement task.
Sometimes it is really a pain in the butt to get the task you want, to execute.
(am I making any sense at all here? :? )
D-Day in progress 86Kb (Slowly drifting)
Just a Fairy Tale: 60Kb
User avatar
P/o Prune
Site Admin
 
Posts: 4389
Joined: Mon Jun 24, 2002 8:18 am
Location: Denmark
Points: 58

Re: Which tasks are executed first?

Postby Denk » Mon Aug 19, 2019 10:26 am

P/o Prune wrote:I will have to create a task. Either a general task, or a specific task overriding the default player movement task.
Don't forget that besides override, a specific task can Run Before and Run After player movement. In your example, I would personally choose Run Before but it is a matter of taste. It is just good to be aware of those options too.
----------------------------------------------------------------------
The Bash Saga:
1. The Dragon Diamond 2. The Way Home 3. Stone of Wisdom
----------------------------------------------------------------------
Denk
 
Posts: 249
Joined: Mon Feb 22, 2016 6:21 pm
Location: Hjørring, Denmark
Points: 31

Re: Which tasks are executed first?

Postby P/o Prune » Mon Aug 19, 2019 1:38 pm

Denk wrote:
P/o Prune wrote:I will have to create a task. Either a general task, or a specific task overriding the default player movement task.
Don't forget that besides override, a specific task can Run Before and Run After player movement. In your example, I would personally choose Run Before but it is a matter of taste. It is just good to be aware of those options too.

I get the same result if I use "Run before" :(
D-Day in progress 86Kb (Slowly drifting)
Just a Fairy Tale: 60Kb
User avatar
P/o Prune
Site Admin
 
Posts: 4389
Joined: Mon Jun 24, 2002 8:18 am
Location: Denmark
Points: 58

Re: Which tasks are executed first?

Postby Denk » Mon Aug 19, 2019 3:43 pm

If you use "Run Before", the specific task should not have any actions, since the parent task (Player Movement) takes care of the movement and executes Look. To get rid of the sentence "You move North." you must untick "Display Parent Message". I attach a small demo showing how it can be done.
Attachments
RunBeforeMessage.taf
(14.96 KiB) Downloaded 7 times
----------------------------------------------------------------------
The Bash Saga:
1. The Dragon Diamond 2. The Way Home 3. Stone of Wisdom
----------------------------------------------------------------------
Denk
 
Posts: 249
Joined: Mon Feb 22, 2016 6:21 pm
Location: Hjørring, Denmark
Points: 31

Re: Which tasks are executed first?

Postby P/o Prune » Mon Aug 19, 2019 4:13 pm

Denk wrote:If you use "Run Before", the specific task should not have any actions, since the parent task (Player Movement) takes care of the movement and executes Look. To get rid of the sentence "You move North." you must untick "Display Parent Message". I attach a small demo showing how it can be done.

Thanks.. I'll have a look at it when tomorrow... (I'm at work now)
D-Day in progress 86Kb (Slowly drifting)
Just a Fairy Tale: 60Kb
User avatar
P/o Prune
Site Admin
 
Posts: 4389
Joined: Mon Jun 24, 2002 8:18 am
Location: Denmark
Points: 58

Re: Which tasks are executed first?

Postby saabie » Thu Aug 22, 2019 2:13 pm

You can do several messages in one task using alternate descriptions, ie. one task per location with an alternate description for each direction, but if you want to be able to have lots of different movement descriptions then it is easier to create properties for these and have a task per direction that prints the property text if it exists.
In this demo I have created tasks and properties for north, south, west and east only, but you can easily add more for the other directions.

MovementDescriptions.taf
(23.58 KiB) Downloaded 6 times
saabie
 
Posts: 973
Joined: Fri Aug 12, 2011 2:07 am
Location: Adelaide, South Australia
Points: 25


Return to ADRIFT 5.0

Who is online

Users browsing this forum: Google [Bot] and 4 guests