<SOLVED> Error in Quest after trying to add set timeout (again)

Error in editor shows up when trying to delete or change a bit of code for one object in my game. This will not go away, meaning I cannot continue making the game until I've sussed it :(

Here's the offending bit of code:

msg ("You grasp the lever by the handle, and pull it back hard.<br/><br/>The lift begins to travel down at quite a rate...")` play sound ("Mech Lift.mp3", false, false) SetTimeout (3000)

Here's the error when I try to delete it:

System.Exception: Starting transaction when previous transaction not finished
at TextAdventures.Quest.UndoLogger.StartTransaction(String command)
at TextAdventures.Quest.EditableScripts.set_Code(String value)
at TextAdventures.Quest.EditorControls.ScriptEditorControl.Save()
at TextAdventures.Quest.EditorControls.ScriptEditorControl.set_CodeView(Boolean value)
at TextAdventures.Quest.EditorControls.ScriptEditorControl.ctlToolbar_CodeView()
at TextAdventures.Quest.EditorControls.ScriptToolbar.cmdCodeView_OnClick(Object sender, RoutedEventArgs e)
at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
at System.Windows.UIElement.RaiseEvent(RoutedEventArgs e)
at System.Windows.Controls.Primitives.ButtonBase.OnClick()
at System.Windows.Controls.Primitives.ToggleButton.OnClick()
at System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(MouseButtonEventArgs e)
at System.Windows.UIElement.OnMouseLeftButtonUpThunk(Object sender, MouseButtonEventArgs e)
at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
at System.Windows.UIElement.ReRaiseEventAs(DependencyObject sender, RoutedEventArgs args, RoutedEvent newEvent)
at System.Windows.UIElement.OnMouseUpThunk(Object sender, MouseButtonEventArgs e)
at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
at System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)
at System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted)
at System.Windows.Input.InputManager.ProcessStagingArea()
at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)
at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)

Here's the error when I try to change it to something else:

System.Exception: Starting transaction when previous transaction not finished
at TextAdventures.Quest.UndoLogger.StartTransaction(String command)
at TextAdventures.Quest.EditorController.CreateNewEditableScriptsChild(ScriptCommandEditorData parent, String attribute, String keyword, Boolean useTransaction)
at TextAdventures.Quest.EditorControls.ScriptEditorControl.set_CodeView(Boolean value)
at TextAdventures.Quest.EditorControls.ScriptEditorControl.ctlToolbar_CodeView()
at TextAdventures.Quest.EditorControls.ScriptToolbar.cmdCodeView_OnClick(Object sender, RoutedEventArgs e)
at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
at System.Windows.UIElement.RaiseEvent(RoutedEventArgs e)
at System.Windows.Controls.Primitives.ButtonBase.OnClick()
at System.Windows.Controls.Primitives.ToggleButton.OnClick()
at System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(MouseButtonEventArgs e)
at System.Windows.UIElement.OnMouseLeftButtonUpThunk(Object sender, MouseButtonEventArgs e)
at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
at System.Windows.UIElement.ReRaiseEventAs(DependencyObject sender, RoutedEventArgs args, RoutedEvent newEvent)
at System.Windows.UIElement.OnMouseUpThunk(Object sender, MouseButtonEventArgs e)
at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
at System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)
at System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted)
at System.Windows.Input.InputManager.ProcessStagingArea()
at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)
at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)


The timeout should be set to 5 seconds. I have no idea why it keeps resetting to 3000.


Whoo!!!

Quest is being unruly, I see.

Open your .aslx file in a text editor. Find that bit of code. Delete it (or fix it). Save the file. Open in Quest.


Also. . .

Your code should look (something) like this:

msg ("You grasp the lever by the handle, and pull it back hard.<br/><br/>The lift begins to travel down at quite a rate...")
play sound ("Mech Lift.mp3", false, false)
//Changed next line to 5 seconds
SetTimeout (5) {
  stop sound
}

PS

I think this happens because Quest is rewriting the game's source code each time a change is made in the editor. When the editor expects a field to exist (such as the script field for SetTimeout when there is no 2nd parameter), it gets confused and stuck in a state between editing and saving the file.

...or something like that.

Also, if you had it set to 3000 initially, then it saved that in real time. Then the editor went crazy due to the lack of a field it expects to exists, and nothing you change is getting saved (or that's my guess).


Hmm. Interesting!

I've fixed it by following your instructions... Thank you!

Is there a way to simply have the game wait for five seconds without the input command coming up?
So it writes the line of text, plays the sound (which lasts five seconds), then prints the next line of text, without anything in between?

For example, back on the C64 in BASIC V2, I'd do this with a simple FOR NEXT loop:

FORX=1TO300:NEXTX

That would cause the game to hang whilst it counted those 300 60ths of a second before continuing on.

Using the 'wait for sound to finish' check box doesn't work, as it still displays the input command but simply doesn't respond to anything you type in.


The easiest way (perhaps not the best) to do what I think you want to do would be just hide the input and the panes during the five seconds:

msg ("You grasp the lever by the handle, and pull it back hard.<br/><br/>The lift begins to travel down at quite a rate...")
play sound ("Mech Lift.mp3", false, false)
JS.uiHide("#txtCommandDiv")
JS.uiHide("#gamePanes")
SetTimeout (5) {
  stop sound
  msg("Blah blah blah")
  JS.uiShow("#txtCommandDiv")
  JS.uiShow("#gamePanes")
}

Thank you - really appreciate the help!


This topic is now closed. Topics are closed after 60 days of inactivity.

Support

Forums