ADRIFT Forum


The place to discuss the ADRIFT Interactive Fiction toolkit

Execute task on restriction fail?

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.

Execute task on restriction fail?

Postby an73hh » Mon Jul 30, 2018 11:21 pm

Is there a way to execute a task when a you fail a restriction, I could not find a "else statement" under it, just the display message for it. Is there a workaround that I'm not aware of?
an73hh
 
Posts: 2
Joined: Mon Jul 30, 2018 11:15 pm

Re: Execute task on restriction fail?

Postby Lazzah » Tue Jul 31, 2018 8:43 am

an73hh wrote:Is there a way to execute a task when a you fail a restriction, I could not find a "else statement" under it, just the display message for it. Is there a workaround that I'm not aware of?

You could create a second task where if the restriction fails then it will execute. For example, let's say the first task has a variable restriction where it must be equal to 1 to pass. In the second task you create a restriction where the variable is equal to 0 to pass.

Thinking about it, an ELSE restriction/action of some kind would be VERY useful. I suppose I could add an enhancement request but with the current situation with Campbell being AWOL again, I doubt very much if it would be implemented even if it was possible.
OUT NOW: Run, Bronwynn, Run!
Current W.I.P.: Magnetic Moon
Also available: The Axe of Kolt, The Spectre of Castle Coris, The Fortress of Fear, Die Feuerfaust - The Fist of Fire and The Lost Children
User avatar
Lazzah
Moderator
 
Posts: 2131
Joined: Thu Mar 31, 2011 4:54 am
Location: London, England
Points: 17

Re: Execute task on restriction fail?

Postby ralphmerridew » Tue Jul 31, 2018 4:27 pm

That will work, provided the tasks don't change the variable involved. (It's a bit trickier if they do.)
Bloodhounds can make you laugh and cuss in the same breath. They are endearing, faithful, and can sling drool ten feet in any direction. -- Virginia Lanier
User avatar
ralphmerridew
 
Posts: 2547
Joined: Fri Dec 13, 2002 11:56 pm
Location: Missouri
Points: 10

Re: Execute task on restriction fail?

Postby an73hh » Wed Aug 01, 2018 5:01 am

You could create a second task where if the restriction fails then it will execute. For example, let's say the first task has a variable restriction where it must be equal to 1 to pass. In the second task you create a restriction where the variable is equal to 0 to pass.


I'm using that now. seems to work well enough.

I doubt very much if it would be implemented even if it was possible.


I was taking a look at the source code, I think it is possible, I'm surprised it isn't a thing yet. However I don't think it's worth the effort trying to understand how the program work to add it considering that the workaround works.

Thank you for the reply.
an73hh
 
Posts: 2
Joined: Mon Jul 30, 2018 11:15 pm


Return to ADRIFT 5.0

Who is online

Users browsing this forum: No registered users and 2 guests