Jump to content

Error opening saved cartridge


JJG10101

Recommended Posts

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 by JJG10101
Link to comment

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.

Link to comment

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.

Link to comment

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.
Link to comment

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.

Link to comment

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...

Link to comment

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. :rolleyes:

Link to comment
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!

Link to comment

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

Link to comment

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

Link to comment

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.

Link to comment

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.

Link to comment

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.

Link to comment

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!

Link to comment

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.

Link to comment

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 Cartridge

System.ApplicationException: Exception of type 'System.ApplicationException' was thrown.

at ZonesAuthor.LuaFunctions.ReadLuaCartridge(String luaFileName)

at ZonesAuthor.frmMain.OpenCartridgeFile()

 

where is the problem? :D

Link to comment

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...