textadventures / quest

Create text adventure games
http://textadventures.co.uk/quest
MIT License
301 stars 70 forks source link

Program softlocked #1110

Open sensho88 opened 3 years ago

sensho88 commented 3 years ago

I was trying to create a system whereby there were three different text descriptions each time you entered the room. I did this by using a script and clicking the first time option. Then on the else section I clicked the first time option again. And so on.

I started my program and it worked fine, the first time I entered the room I got description 1. The second time I entered the room I got description 2. And so on.

However, upon trying to delete the third 'first time' script, I got this error brought up

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.MultiControl.Save() at TextAdventures.Quest.EditorControls.ElementEditor.Save() at TextAdventures.Quest.WPFElementEditor.SaveData() at TextAdventures.Quest.Editor.Undo() at TextAdventures.Quest.Controls.Menu.Menu_Click(Object sender, EventArgs e) at System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e) at System.Windows.Forms.ToolStripMenuItem.OnClick(EventArgs e) at System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e) at System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e) at System.Windows.Forms.ToolStripItem.FireEventInteractive(EventArgs e, ToolStripItemEventType met) at System.Windows.Forms.ToolStripItem.FireEvent(EventArgs e, ToolStripItemEventType met) at System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea) at System.Windows.Forms.ToolStripDropDown.OnMouseUp(MouseEventArgs mea) at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks) at System.Windows.Forms.Control.WndProc(Message& m) at System.Windows.Forms.ScrollableControl.WndProc(Message& m) at System.Windows.Forms.ToolStrip.WndProc(Message& m) at System.Windows.Forms.ToolStripDropDown.WndProc(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

The program has now completely softlocked. It won't let me undo, it just brings up this error. It won't let me delete the script, again I just get this error. Completely stuck.

JustaTypeWriter commented 3 years ago

I am far from an expert. But incrementing your text through a switch command would have probably been easier Example: Have each room have the variable "time" Switch(this.time){ Case (0){ msg("first message") } Case (1){ msg("second message") } Default{ msg("etc...") } }

As for recovering your game file you might be able to un-lock it by editing out the firsttime script in another text editor and reopening it in quest... If that doesn't work you could copy the code from the other editor into a new game file with code view to try and save it. I had something very similar happen before and this worked. Hope this helps.