ADRIFT Forum


The place to discuss the ADRIFT Interactive Fiction toolkit

Location Exit Restriction Bug

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.

Location Exit Restriction Bug

Postby Lazzah » Tue Sep 15, 2020 10:41 am

Hi Campbell,

I don't know if any other Drifter has experienced this but if I have TWO restrictions for any location exit, if both restrictions are passed then when you try to go in the referenced direction, the runner will throw up an error, as per this image:

Movement bug.jpg
Movement bug.jpg (49.71 KiB) Viewed 105 times


As you can see, when you click on OK, ADRIFT responses with "Sorry, I didn't understand that command." If I then remove one of the restrictions then I am able to go north when that restriction is passed.

The stack trace for the error is:

at ADRIFT.frmError..ctor(String sErrorMessage, Exception ex)
at ADRIFT.SharedModule.ErrMsg(String sMessage, Exception ex)
at ADRIFT.RunnerSession.GetGeneralTask(String sInput, Int32 iMinimumPriority, Boolean bSecondChance)
at ADRIFT.RunnerSession.EvaluateInput(Int32 iMinimumPriority, Boolean bPassingOnly)
at ADRIFT.RunnerSession.Process(String sCommand)
at ADRIFT.frmRunner.SubmitCommand()
at ADRIFT.frmRunner.txtInput_KeyDown(Object sender, KeyEventArgs e)
at System.Windows.Forms.KeyEventHandler.Invoke(Object sender, KeyEventArgs e)
at System.Windows.Forms.Control.OnKeyDown(KeyEventArgs e)
at System.Windows.Forms.Control.ProcessKeyEventArgs(Message& m)
at System.Windows.Forms.Control.WmKeyChar(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.RichTextBox.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at ADRIFT.frmRunner.Main()
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at R.P.Main(String[] args)
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
Lazzah
Moderator
 
Posts: 2392
Joined: Thu Mar 31, 2011 4:54 am
Location: Clacton-on-Sea, Essex
Points: 65

Re: Location Exit Restriction Bug

Postby Denk » Tue Sep 15, 2020 11:46 am

Lazzah wrote:I don't know if any other Drifter has experienced this but if I have TWO restrictions for any location exit, if both restrictions are passed then when you try to go in the referenced direction, the runner will throw up an error, as per this image
I tried to reproduce it, but I couldn't. It works fine on my PC and I am using v.5.0.36.4 (both developer and runner).

Perhaps it only happens for certain restrictions or perhaps the chosen restriction has a problem. I tested with very simple restrictions, i.e. expressions like:
1=0 (always negative)
2=1 (always negative)
or
1=1 (always positive)
2=2 (always positive)

Perhaps you can reproduce the problem in a new taf-file, and attach it here?
----------------------------------------------------------------------
The Bash Saga:
1. The Dragon Diamond 2. The Way Home 3. Stone of Wisdom
----------------------------------------------------------------------
User avatar
Denk
 
Posts: 539
Joined: Mon Feb 22, 2016 6:21 pm
Location: Hjørring, Denmark
Points: 251

Re: Location Exit Restriction Bug

Postby Lazzah » Tue Sep 15, 2020 2:23 pm

I just tried to reproduce the bug in a new file, but it worked OK. In my WIP I had changed the locations around a bit so maybe this has something to do with the bug occurring. It has happened to me so many times I now no longer put more than one restriction in any location exit.

Note: One restriction was to check the Open Status of the door object, the other checked a variable which checked if a part of the door had been repaired or not.

Perhaps Campbell can look at the stack trace and figure out what is happening?
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
Lazzah
Moderator
 
Posts: 2392
Joined: Thu Mar 31, 2011 4:54 am
Location: Clacton-on-Sea, Essex
Points: 65

Re: Location Exit Restriction Bug

Postby Denk » Tue Sep 15, 2020 4:25 pm

I looked more into it. Attached is a small demo demonstrating a bug/limitation in ADRIFT.

1. Try to go east, you will get an error. (activates the standard Player Movement task, which has been modified)

2. Try to type: test east (activates the "test direction" task)

Again you will get an error.

It is good to be aware of this limitation, so you know how to work around it.

The bug occurs, whenever a few things are present:

A. A general task with a command containing %direction% must have the restriction "The Player Character must have a route available to the Referenced Direction" [this is the case for e.g. the Player Movement task in Standard library]
B The same task must have one more restriction
C. The referenced direction must have two or more restrictions on the "direction"-pane of the player's location.
D. All restrictions mentioned above must be fulfilled

So if you get this problem, you can either:
1. Limit restrictions on direction pane to 1 per direction
OR
2. Avoid having any other restrictions in the relevant task (e.g. Player Movement) than "The Player Character must have a route available to the Referenced Direction"

I guess the explanation is, that the restriction "The Player character must have a route available to the Referenced Direction" is a very special restriction, which works best alone, but if it is used together with other restrictions, you will get errors if there are more than 1 relevant direction pane restriction.
Attachments
RestrictionLimitations.taf
(23.57 KiB) Downloaded 6 times
----------------------------------------------------------------------
The Bash Saga:
1. The Dragon Diamond 2. The Way Home 3. Stone of Wisdom
----------------------------------------------------------------------
User avatar
Denk
 
Posts: 539
Joined: Mon Feb 22, 2016 6:21 pm
Location: Hjørring, Denmark
Points: 251


Return to ADRIFT 5.0

Who is online

Users browsing this forum: No registered users and 16 guests

cron