+JJG10101 Posted April 23, 2008 Share Posted April 23, 2008 (edited) So.. I spent about 10 minutes creating a new cartridge, saved my work, and came back to it later. When I tried to open the saved file, this is the message I got: Error Reading Cartridge System.ApplicationException: Exception of type 'System.ApplicationException' was thrown. at Groundspeak.Wherigo.ZonesEngine.ZOnesEngineDll.LuaDoFile(String filename) at ZonesAuthor.LuaFunctions.ReadLuaCartridge(String luaFileName) at ZonesAuthor.frmMain.OpenCartridgeFile() (BTW, I re-typed the above rather than do a screen capture.) Any ideas what caused this? Edited April 23, 2008 by JJG10101 Quote Link to comment
Ranger Fox Posted April 23, 2008 Share Posted April 23, 2008 Something is messed up with the lua file the builder generated. The message shows when the builder can't parse the file. Open the file in notepad and scroll down to the "Builder generated functions" section. Look for odd stuff in quotes and such. If you want, either post the file or email me and I'll fix you up. I'll post the offending line to the forum so people can see what to look for the next time this happens. If the line tells too much about your cartridge, I'll anonymize it. Quote Link to comment
+JJG10101 Posted April 23, 2008 Author Share Posted April 23, 2008 Sorry, I think I cried "wolf" a bit too soon. To me, using quotes is an everyday thing. An example: I created a character, and the description went something like this... Standing in the corner of the room is your assistant. A tall fellow by the name of Ellsworth, he's been with you for a few years now. "Always happy to help," he often repeats. That's the kind of thing that caused the builder to freak out. To me, it's perfectly logical. To the builder, it's perfectly illogical. Builder wins... this time. Quote Link to comment
Ranger Fox Posted April 23, 2008 Share Posted April 23, 2008 There has to be some sort of escape character for including strings. In C#, you can just put a backslash in front of the character to escape. You could also make a string a literal by putting an "@" symbol before the quoted string and use two quotes. I checked elsewhere online and it looks like the backslash would allow for quotes in lua. I changed my cartridge's code and was able to load it into the builder after that. Therefore: Standing in the corner of the room is your assistant. A tall fellow by the name of Ellsworth, he's been with you for a few years now. \"Always happy to help,\" he often repeats. Quote Link to comment
+davidloew Posted April 24, 2008 Share Posted April 24, 2008 There has to be some sort of escape character for including strings. In C#, you can just put a backslash in front of the character to escape. You could also make a string a literal by putting an "@" symbol before the quoted string and use two quotes. I checked elsewhere online and it looks like the backslash would allow for quotes in lua. I changed my cartridge's code and was able to load it into the builder after that. Therefore: Standing in the corner of the room is your assistant. A tall fellow by the name of Ellsworth, he's been with you for a few years now. \"Always happy to help,\" he often repeats. The builder descriptions for characters etc, supports embedded quotes. I just created a character and in the description, I copied and pasted the above description (without the escape characters). If you look at the lua code that the builder generates, descriptions are wrapped with [[ ]]. This block quote allows for characters to be included inside. So, the description looks like this: zcharacterChar.Description=[[standing in the corner of the room is your assistant. A tall fellow by the name of Ellsworth, he's been with you for a few years now. "Always happy to help," he often repeats. ]] If you created the description without the builder and didn't wrap it with the block quotes[[]], then the builder will blow up with a lua parsing error. David. Quote Link to comment
+Folshen Posted May 24, 2008 Share Posted May 24, 2008 Just doing my first Wherigo and ran into the same error. I've no idea what I did or how to fix it but if anyone would care to look at the file I would most greatly appreciate it. Its taken me nearly a whole day to get it as far as I did and now, I'm ready to toss the laptop out the window at the thought of starting over... Quote Link to comment
+Folshen Posted May 24, 2008 Share Posted May 24, 2008 Cancel that...I found it to be easier and quicker to just redo the entire thing. After spending the whole day learning the program it wasn't as bad as I thought it would be. Actually probably better in the long run as maybe I'll retain some of it now. Quote Link to comment
Ranger Fox Posted May 25, 2008 Share Posted May 25, 2008 I found it to be easier and quicker to just redo the entire thing That usually happens with any type of software design and programming: after completing it, you usually find a way you could have better written it. Some times it's easier to toss the whole thing. Have fun with it! Quote Link to comment
+dgreno Posted July 6, 2008 Share Posted July 6, 2008 Ranger Fox, I've got exactly the same problem as reported by JJG10101 above. Can't open a cartridge file that I've been working on for a couple of days. I looked through the raw LUA file and didn't see anything obviously ugly in the Builder Generated Functions per your suggestion. Can I take you up on your offer and PM you the file to see if you can figure out what's keeping this one from loading? Let me know. I took this one out this morning for a full field test on my Ique M5 and brought along forman and his Colorado and everything worked fine. Then I came home to "prettify" the dialogs and add graphics and the like. I was making incremental changes and testing each one in the emulator, but then got the dreaded error messages as listed above. Any help appreciated. I'd hate to abandon this one and start over at this point. Thanks in advance, Dave Quote Link to comment
+dgreno Posted July 6, 2008 Share Posted July 6, 2008 Ranger Fox, I've got exactly the same problem as reported by JJG10101 above. Can't open a cartridge file that I've been working on for a couple of days. I looked through the raw LUA file and didn't see anything obviously ugly in the Builder Generated Functions per your suggestion. Can I take you up on your offer and PM you the file to see if you can figure out what's keeping this one from loading? Let me know. I took this one out this morning for a full field test on my Ique M5 and brought along forman and his Colorado and everything worked fine. Then I came home to "prettify" the dialogs and add graphics and the like. I was making incremental changes and testing each one in the emulator, but then got the dreaded error messages as listed above. Any help appreciated. I'd hate to abandon this one and start over at this point. Thanks in advance, Dave On closer inspection, my error message is slightly different than the one mentioned earlier. Mine is... System.ApplicationException: Exception of type 'System.ApplicationException' was thrown. at ZonesAuthor.LuaFunctions.ReadLuaCartridge(String luaFileName) at ZonesAuthor.frmMain.OpenCartridgeFile() My error message is missing this element... at Groundspeak.Wherigo.ZonesEngine.ZOnesEngineDll.LuaDoFile(String filename) Still no luck in finding the problem. Dave Quote Link to comment
Ranger Fox Posted July 7, 2008 Share Posted July 7, 2008 Can I take you up on your offer and PM you the file to see if you can figure out what's keeping this one from loading? Let me know. Any help appreciated. Sure, you can send it. I'll look at the code. After I find out what's going wrong, I'll send you the edited code and post an explanation to the thread. Quote Link to comment
Ranger Fox Posted July 7, 2008 Share Posted July 7, 2008 The problem has to do with a rule most programming languages enforce. Declared variables cannot begin with a number. In your code, I saw these lines: zcharacterGeocache.Commands = { 3Clickwhenyoufindit = Wherigo.ZCommand{Text="3. Click when you find it", CmdWith=false, Enabled=true}, 2Spoiler = Wherigo.ZCommand{Text="2. Spoiler", CmdWith=false, Enabled=true, EmptyTargetListText="Nothing available"}, 1Hint = Wherigo.ZCommand{Text="1. Hint", CmdWith=false, Enabled=true, EmptyTargetListText="Nothing available"}, } zcharacterGeocache.Commands.3Clickwhenyoufindit.Custom = true zcharacterGeocache.Commands.3Clickwhenyoufindit.Id="395fb81f-1d01-463f-8c8d-c97675c9e573" zcharacterGeocache.Commands.3Clickwhenyoufindit.WorksWithAll = true zcharacterGeocache.Commands.2Spoiler.Custom = true zcharacterGeocache.Commands.2Spoiler.Id="54abca38-2913-4241-be10-c99591099df5" zcharacterGeocache.Commands.2Spoiler.WorksWithAll = true zcharacterGeocache.Commands.1Hint.Custom = true zcharacterGeocache.Commands.1Hint.Id="7af54332-615e-4aaa-b549-ff2512699337" zcharacterGeocache.Commands.1Hint.WorksWithAll = true The command names begin with a number. Because of this, the cartridge will not load. I removed the numbers from the beginning of the command names and the cartridge was able to load: zcharacterGeocache.Commands = { Clickwhenyoufindit = Wherigo.ZCommand{Text="3. Click when you find it", CmdWith=false, Enabled=true}, Spoiler = Wherigo.ZCommand{Text="2. Spoiler", CmdWith=false, Enabled=true, EmptyTargetListText="Nothing available"}, Hint = Wherigo.ZCommand{Text="1. Hint", CmdWith=false, Enabled=true, EmptyTargetListText="Nothing available"}, } zcharacterGeocache.Commands.Clickwhenyoufindit.Custom = true zcharacterGeocache.Commands.Clickwhenyoufindit.Id="395fb81f-1d01-463f-8c8d-c97675c9e573" zcharacterGeocache.Commands.Clickwhenyoufindit.WorksWithAll = true zcharacterGeocache.Commands.Spoiler.Custom = true zcharacterGeocache.Commands.Spoiler.Id="54abca38-2913-4241-be10-c99591099df5" zcharacterGeocache.Commands.Spoiler.WorksWithAll = true zcharacterGeocache.Commands.Hint.Custom = true zcharacterGeocache.Commands.Hint.Id="7af54332-615e-4aaa-b549-ff2512699337" zcharacterGeocache.Commands.Hint.WorksWithAll = true I couldn't run a full cartridge test after I loaded it because I didn't have the media you were using. Once you make the changes to the lua source (I'll email you the changed file), you will need to test selecting one of these commands from your geocache character. If it works, you're fine. If not, just take the number, period, and space off the command's text so it matches the actual command's variable name. Since the text isn't your command's name, it should be fine as is. I'm mentioning this only because I don't want surprises. Tell me if that works out for you. As I said, I didn't have the media, so I couldn't make sure everything else worked out. Quote Link to comment
+dgreno Posted July 7, 2008 Share Posted July 7, 2008 Ranger Fox -- that did it. Something to note in the future. Much thanks, Dave (dgreno) Quote Link to comment
+Cach-U-Nuts Posted July 17, 2008 Share Posted July 17, 2008 So.. I spent about 10 minutes creating a new cartridge, saved my work, and came back to it later. When I tried to open the saved file, this is the message I got: Error Reading Cartridge System.ApplicationException: Exception of type 'System.ApplicationException' was thrown. at Groundspeak.Wherigo.ZonesEngine.ZOnesEngineDll.LuaDoFile(String filename) at ZonesAuthor.LuaFunctions.ReadLuaCartridge(String luaFileName) at ZonesAuthor.frmMain.OpenCartridgeFile() (BTW, I re-typed the above rather than do a screen capture.) Any ideas what caused this? I find myself facing this same problem. I have worked several days putting a game together and then last night I wanted to try adding some sounds. The first test worked ok so I added beep sounds when all the zones were entered. That's when the error showed up. I closed the Builder program and now I get the above mentioned error when I try to open the file. I removed the sound files and all references to them to no avail. I checked for the problem characters and the variables that begin with a number but couldn't find anything. Here is a link to my lua file. oquirrhlake.lua Any help will be greatly appreciated. Quote Link to comment
Ranger Fox Posted July 17, 2008 Share Posted July 17, 2008 So.. I spent about 10 minutes creating a new cartridge, saved my work, and came back to it later. When I tried to open the saved file, this is the message I got: Error Reading Cartridge System.ApplicationException: Exception of type 'System.ApplicationException' was thrown. at Groundspeak.Wherigo.ZonesEngine.ZOnesEngineDll.LuaDoFile(String filename) at ZonesAuthor.LuaFunctions.ReadLuaCartridge(String luaFileName) at ZonesAuthor.frmMain.OpenCartridgeFile() (BTW, I re-typed the above rather than do a screen capture.) Any ideas what caused this? I find myself facing this same problem. I have worked several days putting a game together and then last night I wanted to try adding some sounds. The first test worked ok so I added beep sounds when all the zones were entered. That's when the error showed up. I closed the Builder program and now I get the above mentioned error when I try to open the file. I removed the sound files and all references to them to no avail. I checked for the problem characters and the variables that begin with a number but couldn't find anything. Here is a link to my lua file. oquirrhlake.lua Any help will be greatly appreciated. You created a zone called "Test" and deleted it. The builder did not delete the zone's OnEnter function from the code. Therefore, when you open the cartridge in the builder, it sees the OnEnter function and has a fit it can't find the zone it's referencing. To fix the problem, open your lua file in notepad and delete lines 1017-1020: function zoneTest:OnEnter() -- #GroupDescription=Script -- -- #Comment=Script Comment -- end After that, save the file and you're good to go. Have fun! Quote Link to comment
+Cach-U-Nuts Posted July 17, 2008 Share Posted July 17, 2008 Wow! You are fast and you are good! How in the world did you figure that out so fast? Well now I can try putting the sound back in, after making a backup copy of the file first. Thank you very much Ranger Fox. Quote Link to comment
Ranger Fox Posted July 17, 2008 Share Posted July 17, 2008 How in the world did you figure that out so fast? It's the same way I use for most cases with cartridges not opening. I remove the last few builder functions and see if it makes a difference. In your case, it did. I put them back one to three at a time, saving and opening the file in the builder until it produced the error again. The last function made the builder error, so I looked for the zoneTest object and found it wasn't elsewhere in the source. That, therefore, was the problem. Doing it this way means I don't have to know anything about the cartridge before I begin, which also means it's the fastest way to come up with a solution. Quote Link to comment
+henty Posted July 17, 2008 Share Posted July 17, 2008 I just trying how to make Wherigo cartridge, so this wouldnt be w-cache. I made this and saved it, but when I tried to open it, it failed: pokus.lua i got only error message : Error Reading CartridgeSystem.ApplicationException: Exception of type 'System.ApplicationException' was thrown. at ZonesAuthor.LuaFunctions.ReadLuaCartridge(String luaFileName) at ZonesAuthor.frmMain.OpenCartridgeFile() where is the problem? Quote Link to comment
Ranger Fox Posted July 17, 2008 Share Posted July 17, 2008 where is the problem? Well, this is interesting. I can open your cartridge just fine with my (current) version of the builder. What's the date of the builder version you're using? (It's in Help: About) Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.