Broke Game, Can't Edit Room Anymore

Started by mastastealth, Tue 14/09/2010 18:43:12

Previous topic - Next topic

mastastealth

I was trying to add a room hotspot that detected in the AnyClick function if mouse.eMode was on Walk To, for the player to say something. When trying to run the game, it froze AGS, and now I can't edit the room anymore. :( I get:

Error: LoadRoom: unexpected end of file while loading room
Version: AGS 3.2.0.103

AGS.Types.AGSEditorException: LoadRoom: unexpected end of file while loading room
   at ThrowManagedException(SByte* message)
   at load_room_file(SByte* )
   at load_crm_file(UnloadedRoom roomToLoad)
   at AGS.Native.NativeMethods.LoadRoomFile(UnloadedRoom roomToLoad)
   at AGS.Editor.Components.RoomsComponent.LoadNewRoomIntoMemory(UnloadedRoom newRoom, CompileMessages errors)
   at AGS.Editor.Components.RoomsComponent.LoadDifferentRoom(UnloadedRoom newRoom)
   at AGS.Editor.Components.RoomsComponent.LoadRoom(String controlID)
   at AGS.Editor.Components.RoomsComponent.CommandClick(String controlID)
   at AGS.Editor.ProjectTree.ProcessClickOnNode(String nodeID, MouseButtons button)
   at AGS.Editor.ProjectTree.projectTree_NodeMouseDoubleClick(Object sender, TreeNodeMouseClickEventArgs e)
   at System.Windows.Forms.TreeView.OnNodeMouseDoubleClick(TreeNodeMouseClickEventArgs e)
   at System.Windows.Forms.TreeView.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)

Please tell me there's a way to save most of what I have already (everything else works. Room script, objects, etc.) or better yet, a way to fix whatever I did? T_T

cianty

Usually you get "Unexpected end of file" errors when you forgot to put a closing brace or a closing ". Like this:

player.Say("Hi);

Because of the missing " the code doesn't compile properly. Errors like these are kinda hard to detect sometimes.

If everything fails, try cutting out segements of code (putting comments around it) until you have narrowed down the code to the section that causes the error. If you have a long room script this may be a little effort (although you should be able to easily "comment out" the entire bodies of room functions such as OnLoad, etc until there is nigh to nothing left.

I hope you get what I try to say. :)

If you don't have anything in your room script then I am clueless but I would assum that some broken code in the room script is what causes you problem and thus should be able to be fixed with a bit of searching.
ca. 70% completed

mastastealth

Thanks. I did just that (and in the global script) but couldn't seem to find anything. Fortunately, I'm working on a very small game so I just copied the old room's actions, deleted room and created a new one with all the objects/hotspots again (which I would've needed to do any since I was redoing all the graphics). I'll definitely keep an eye out for those tiny mistakes from now on though!

cianty

Well, glad it's working and wasn't too much effort. Sometimes you just can't find it... That's part of why I do backups on an almost daily basis.
ca. 70% completed

SMF spam blocked by CleanTalk