ADRIFT Forum


The place to discuss the ADRIFT Interactive Fiction toolkit

getting an erorr, but not sure how to solve it...

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.

getting an erorr, but not sure how to solve it...

Postby gnbannister » Sun Dec 11, 2016 3:09 pm

Hi everyone,

I am getting an error come up when I enter a room in my game. (It has been a while since i have worked on this so have no idea what the last things i changed were!)

the error shows up, i click okay and i get two more of the same before it loads into the room with seemingly no problems (or at least non that i have found at the moment)

Any help in how to read the error notes or if there is a way to solve this would be great. I have removed all the objects in the room as it mentions object reference, but that did nothing, i also removed all character held objects and that didnt help either. The error occurs each time i enter that room, all other rooms have no error.


The error log reads as follows:

[Reveal] Spoiler:
ReplaceFunctions Error: Object Reference not set to an instance of an object

at ADRIFT.frmError..ctor(String sErrorMessage, Exception ex)
at ADRIFT.SharedModule.ErrMsg(String sMessage, Exception ex)
at ADRIFT.SharedModule.ReplaceFunctions(String sText, Boolean bExpression, Boolean bAllowOO)
at ADRIFT.RunnerSession.AttemptToExecuteSubTask(String sTaskKey, String[] sReferences, Boolean bCalledFromEvent, Boolean bChildTask, String[] sReferenceCommands, Boolean& bTaskHasOutputNew, Boolean bPassingOnly)
at ADRIFT.RunnerSession.ExecuteSubTasks(String sTaskKey, Boolean bCalledFromEvent, Boolean bChildTask, clsNewReference[] InReferences, Int32 iRefIndex, String[] sReferenceKeys, String[] sReferenceCommands, Boolean& bTaskHasOutputNew, Boolean bPassingOnly)
at ADRIFT.RunnerSession.AttemptToExecuteTask(String sTaskKey, Boolean bCalledFromEvent, Boolean bSkipRestrictionsTest, Boolean bChildTask, Boolean& bContinue, Boolean& bTaskHasOutputNew, Boolean bEvaluateResponses, Boolean bPassingOnly, Boolean bAssignSpecificRefs)
at ADRIFT.RunnerSession.ExecuteSingleAction(clsAction actx, String sTaskCommand, clsTask task, Boolean bCalledFromEvent, Boolean& bTaskHasOutputNew)
at ADRIFT.RunnerSession.ExecuteActions(clsTask task, Boolean bCalledFromEvent, Boolean& bTaskHasOutputNew)
at ADRIFT.RunnerSession.AttemptToExecuteSubTask(String sTaskKey, String[] sReferences, Boolean bCalledFromEvent, Boolean bChildTask, String[] sReferenceCommands, Boolean& bTaskHasOutputNew, Boolean bPassingOnly)
at ADRIFT.RunnerSession.ExecuteSubTasks(String sTaskKey, Boolean bCalledFromEvent, Boolean bChildTask, clsNewReference[] InReferences, Int32 iRefIndex, String[] sReferenceKeys, String[] sReferenceCommands, Boolean& bTaskHasOutputNew, Boolean bPassingOnly)
at ADRIFT.RunnerSession.ExecuteSubTasks(String sTaskKey, Boolean bCalledFromEvent, Boolean bChildTask, clsNewReference[] InReferences, Int32 iRefIndex, String[] sReferenceKeys, String[] sReferenceCommands, Boolean& bTaskHasOutputNew, Boolean bPassingOnly)
at ADRIFT.RunnerSession.AttemptToExecuteTask(String sTaskKey, Boolean bCalledFromEvent, Boolean bSkipRestrictionsTest, Boolean bChildTask, Boolean& bContinue, Boolean& bTaskHasOutputNew, Boolean bEvaluateResponses, Boolean bPassingOnly, Boolean bAssignSpecificRefs)
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)


__________________________________

at ADRIFT.frmError..ctor(String sErrorMessage, Exception ex)
at ADRIFT.SharedModule.ErrMsg(String sMessage, Exception ex)
at ADRIFT.SharedModule.ReplaceFunctions(String sText, Boolean bExpression, Boolean bAllowOO)
at ADRIFT.RunnerSession.AttemptToExecuteSubTask(String sTaskKey, String[] sReferences, Boolean bCalledFromEvent, Boolean bChildTask, String[] sReferenceCommands, Boolean& bTaskHasOutputNew, Boolean bPassingOnly)
at ADRIFT.RunnerSession.ExecuteSubTasks(String sTaskKey, Boolean bCalledFromEvent, Boolean bChildTask, clsNewReference[] InReferences, Int32 iRefIndex, String[] sReferenceKeys, String[] sReferenceCommands, Boolean& bTaskHasOutputNew, Boolean bPassingOnly)
at ADRIFT.RunnerSession.AttemptToExecuteTask(String sTaskKey, Boolean bCalledFromEvent, Boolean bSkipRestrictionsTest, Boolean bChildTask, Boolean& bContinue, Boolean& bTaskHasOutputNew, Boolean bEvaluateResponses, Boolean bPassingOnly, Boolean bAssignSpecificRefs)
at ADRIFT.RunnerSession.ExecuteSingleAction(clsAction actx, String sTaskCommand, clsTask task, Boolean bCalledFromEvent, Boolean& bTaskHasOutputNew)
at ADRIFT.RunnerSession.ExecuteActions(clsTask task, Boolean bCalledFromEvent, Boolean& bTaskHasOutputNew)
at ADRIFT.RunnerSession.AttemptToExecuteSubTask(String sTaskKey, String[] sReferences, Boolean bCalledFromEvent, Boolean bChildTask, String[] sReferenceCommands, Boolean& bTaskHasOutputNew, Boolean bPassingOnly)
at ADRIFT.RunnerSession.ExecuteSubTasks(String sTaskKey, Boolean bCalledFromEvent, Boolean bChildTask, clsNewReference[] InReferences, Int32 iRefIndex, String[] sReferenceKeys, String[] sReferenceCommands, Boolean& bTaskHasOutputNew, Boolean bPassingOnly)
at ADRIFT.RunnerSession.ExecuteSubTasks(String sTaskKey, Boolean bCalledFromEvent, Boolean bChildTask, clsNewReference[] InReferences, Int32 iRefIndex, String[] sReferenceKeys, String[] sReferenceCommands, Boolean& bTaskHasOutputNew, Boolean bPassingOnly)
at ADRIFT.RunnerSession.AttemptToExecuteTask(String sTaskKey, Boolean bCalledFromEvent, Boolean bSkipRestrictionsTest, Boolean bChildTask, Boolean& bContinue, Boolean& bTaskHasOutputNew, Boolean bEvaluateResponses, Boolean bPassingOnly, Boolean bAssignSpecificRefs)
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)
______________________________________


at ADRIFT.frmError..ctor(String sErrorMessage, Exception ex)
at ADRIFT.SharedModule.ErrMsg(String sMessage, Exception ex)
at ADRIFT.SharedModule.ReplaceFunctions(String sText, Boolean bExpression, Boolean bAllowOO)
at ADRIFT.SharedModule.ReplaceALRs(String sText, Boolean bAutoCapitalise)
at ADRIFT.RunnerSession.Display(String sText, Boolean bCommit, Boolean bAllowALR, Boolean bRecord)
at ADRIFT.RunnerSession.AttemptToExecuteTask(String sTaskKey, Boolean bCalledFromEvent, Boolean bSkipRestrictionsTest, Boolean bChildTask, Boolean& bContinue, Boolean& bTaskHasOutputNew, Boolean bEvaluateResponses, Boolean bPassingOnly, Boolean bAssignSpecificRefs)
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)
gnbannister
 
Posts: 16
Joined: Tue Oct 13, 2015 3:21 pm

Re: getting an erorr, but not sure how to solve it...

Postby ElliotM » Mon Dec 12, 2016 3:11 am

Can you replicate the problem in a new demo file? Do you have any custom tasks that trigger when you enter that room? Any objects that reference that room?
ElliotM
 
Posts: 1227
Joined: Tue Apr 17, 2007 8:04 pm
Location: The Midwest in the USA
Points: 13

Re: getting an erorr, but not sure how to solve it...

Postby saabie » Mon Dec 12, 2016 4:22 am

That error means that you are using a reference like %object%, but it has not been set to anything.
It looks like when you enter the room you are triggering a specific task that uses an action to run another task?
Somewhere there is an %object% reference that is not being set or it has %object% and %objects% mixed up.
That stack dump does not really tell us much. You should activate the debugger and have it set to high-detail mode before you enter the room. That will tell you which tasks it is trying to run.
saabie
 
Posts: 884
Joined: Fri Aug 12, 2011 2:07 am
Location: Adelaide, South Australia
Points: 10

Re: getting an erorr, but not sure how to solve it...

Postby gnbannister » Mon Dec 12, 2016 5:23 am

saabie wrote:That error means that you are using a reference like %object%, but it has not been set to anything.
It looks like when you enter the room you are triggering a specific task that uses an action to run another task?
Somewhere there is an %object% reference that is not being set or it has %object% and %objects% mixed up.
That stack dump does not really tell us much. You should activate the debugger and have it set to high-detail mode before you enter the room. That will tell you which tasks it is trying to run.

ElliotM wrote:Can you replicate the problem in a new demo file? Do you have any custom tasks that trigger when you enter that room? Any objects that reference that room?




Thanks for the response guys!

I ended up rebuilding the room from scratch, which has cleared the problem. I did have a save with the error though, so ran the debugger and have the results here. There are three times the error screen shows, and you can see them clearly with the jumps in time as I waited each time before clicking continue. Only problem is, im no good at deciphering the problem from this. I am, however, super curious as to the cause and how to avoid it in the future, so any insight would be great. for now though, problem avoided.

I should also add, rebuilding the room stopped the error, so the demo is not going to work, and as you'll see, there are a few specific checks ive created for room movement, but non specific to this room. for my rebuild i didnt edit anything, just rebuilt it to what i thought was identical (clearly not though, as no errors now!)

[Reveal] Spoiler:
[00.02] Task 'Get off objects before moving' matches input.
[00.02] Checking scope: Applicable
[00.02] The Player Character must be on Any Object: Failed
[00.02] The Player Character must be in position Hiding: Failed
[00.02] Checking scope: Visible
[00.02] Command matches without ambiguity.
[00.02] The Player Character must be on Any Object: Failed
[00.02] The Player Character must be in position Hiding: Failed
[00.02] Task does not pass restrictions.
[00.02] Task 'Stand before moving' matches input.
[00.02] Checking scope: Applicable
[00.02] The Player Character must be in position Sitting: Failed
[00.02] The Player Character must be in position Lying: Failed
[00.02] The Player Character must be in position Hiding: Failed
[00.02] Checking scope: Visible
[00.02] Command matches without ambiguity.
[00.02] The Player Character must be in position Sitting: Failed
[00.02] The Player Character must be in position Lying: Failed
[00.02] The Player Character must be in position Hiding: Failed
[00.02] Task does not pass restrictions.
[00.02] Task 'Player Movement' matches input.
[00.02] Checking scope: Applicable
[00.02] The Player Character must have a route available to the Referenced Direction: Passed
[00.02] The Player Character must have a route available to the Referenced Direction: Passed
[00.02] The Player Character must not be a member of group 'being attacked': Passed
[00.02] Command matches without ambiguity.
[00.02] The Player Character must have a route available to the Referenced Direction: Passed
[00.02] The Player Character must not be a member of group 'being attacked': Passed
[00.02] The Player Character must be alone: Passed
[00.02] Task passes restrictions.
[00.02] Task priority: 50026
[00.02] Attempting to execute task Player Movement...
[00.02] Checking single reference task {[[go/walk/move/run]{ to{ the}}] }East
[00.02] The Player Character must have a route available to the Referenced Direction: Passed
[00.02] The Player Character must not be a member of group 'being attacked': Passed
[00.02] The Player Character must be alone: Passed
[00.02] Passed Restrictions
[00.02] Checking whether any of our child tasks should override...
[00.02] Overriding child task found: Enemy presence check
[00.02] First Reference: East(no output)
[00.02] The Player Character must not be alone: Failed
[00.02] %CharacterName% move[//s] %LCase[%direction%]%<br>
[00.03] Executing Actions...
[00.03] Executing task 'Look'.
[00.03] Attempting to execute task Look...
[00.03] Checking reference free task Look
[00.03] Passed Restrictions
[00.03] The Player Character must be at a location within group 'Dark Locations': Failed
[00.03] %Player%.Location.Description.
...............................................
[14.42] Executing Actions...
[14.42] Executing task 'Inventory Window'.
[14.42] Attempting to execute task Inventory Window...
[14.42] Checking reference free task Inventory Window
[14.42] Passed Restrictions
[14.42] Executing Actions...
[14.42] <window Inventory><cls>You are carrying:
Player.Held.List(Indefinite,Rows) <br>and are wearing Player.Worn.List(indefinite,rows)</window>
[14.42] Task passes and has output. Will not execute lower priority tasks
...............................................
[42.74] Continuing trying to execute lower priority tasks (multiple matches)
[42.74] Run After Parent
[42.74] Attempting to execute task Enemy presence check...
[42.74] Checking single reference task {[[go/walk/move/run]{ to{ the}}] }East
[42.74] Passed Restrictions
[42.74] Executing Actions...
[42.74] Executing task 'Enemy present RUNNER'.
[42.74] Attempting to execute task Enemy present RUNNER...
[42.74] Checking reference free task Enemy present RUNNER
[42.74] The Player Character must be in the same location as character 'Infected Runner': Failed
[42.74] Failed Restrictions
[42.74] (no output)
[42.74] Task does not pass and also has no output, therefore will continue to execute lower priority tasks
[42.74] Executing task 'Enemy not present'.
[42.74] Attempting to execute task Enemy not present...
[42.74] Checking reference free task Enemy not present
[42.74] The Player Character must not be in the same location as character 'Infected Runner': Passed
[42.74] Passed Restrictions
[42.74] Executing Actions...
[42.74] (no output)
[42.74] Task passes but has no output, therefore will continue to execute lower priority tasks
[42.74] (no output)
[42.74] Task passes but has no output, therefore will continue to execute lower priority tasks
[42.74] Child task passes
[42.74] Continue executing other child tasks.
...............................................
[15.23] Task passes and has output. Will not execute lower priority tasks
...............................................
gnbannister
 
Posts: 16
Joined: Tue Oct 13, 2015 3:21 pm

Re: getting an erorr, but not sure how to solve it...

Postby saabie » Mon Dec 12, 2016 6:53 am

It looks like it fails when it trys to do the actions in the "Look" task, both before and after it executes 'Inventory Window'.
If it seems to be related to a specific location then there may have been something wrong with the key of that location, such as two locations with the same key. This wont happen anymore, but if you created this room with an earlier version of ADRIFT then it was possible for keys to be duplicated.
saabie
 
Posts: 884
Joined: Fri Aug 12, 2011 2:07 am
Location: Adelaide, South Australia
Points: 10


Return to ADRIFT 5.0

Who is online

Users browsing this forum: No registered users and 3 guests