Jump to content

Crashing problem?


Plan - B

Recommended Posts

Hello all,

 

I'm having a crashing problem on my one and only cartridge "Mystery Inc". Before releasing this cart I field tested on my Colorado 4 times and 2 more time since and emulator tested in countless times. In all those tests I've never come across any crashing problems. (With the exception or trying to start a saved game in the emulator)

 

The last two people (and only people not using my GPS) to run through it have had it crash out on them right at the final location of the cart. One was using a PPC and the other a Colorado.

 

I've combed through all the code and I cannot find the problem. Worst yet it's hard to trouble shoot the problem because I can't recreate it. I was wondering if someone here would have a look at it and see if they can spot where I went wrong? I'd like to keep this cache up and running but don't want to turn people off Wherigo with a bad first experience. Thanks for any and all help.

 

Cheers,

Chris.

mysterinc.zip

Edited by Plan - B
Link to comment

I was pretty sure I attached the .lua file. Maybe that's why it won't open in the emulator? Is there another file you need so you can check the code. Just let me know and I'll be happy to attach it. I really appreciate the help with this!

Edited by Plan - B
Link to comment

Hi All,

 

I have now figured out the exact spot in the cartridge where the crash occures. It is right after a message box input. THe player can pick yes of no. If yes is picked the cartridge crashes. I have a few things fireing when yes is selected: the cart and tasks are marked complete, a diolog is presented and some other stuff. Here is the code that prompts for the input.

 

function zcharacterScooby:OnTalk()
-- #GroupDescription=Script --
-- #Comment=Script Comment --
if   Stage == 1 then
Wherigo.MessageBox{Text=[[I ROVE ROU RHAGGY!!! Hee Hee Hee Hee.]],Media=zmediamsgscoob,}
else
if   Stage == 2 then
Wherigo.MessageBox{Text=[[I RONT ROW. RASK RAGGY!]],Media=zmediamsgscoob,}
else
if   Stage == 4 then
Wherigo.MessageBox{Text=[[RAYBE RE RONTS A ROOBY RACK?]],Media=zmediamsgscoob,}
else
if   Stage == 5 then
Wherigo.MessageBox{Text=[[RO GRET A REORACHE!!!]],Media=zmediamsgscoob,}
else
if   Stage == 6 then
Wherigo.MessageBox{Text=[[RID ROU RIND IT?]],Media=zmediamsgscoob,Buttons={"YES","NO",},Callback=cartMysteryInc.MsgBoxCBFuncs.MsgBoxCB4}
else
if   Stage == 7 then
Wherigo.MessageBox{Text=[[RA'LL RISS ROU!!! ]],Media=zmediamsgscoob,}
else
end
end
end
end
if   Stage == 3 then
Wherigo.MessageBox{Text=[[RUT RAIN RIS IT?]],Media=zmediamsgscoob,}
end
end
end
end

 

Here is the script that runs after the input has be entered.

 

cartMysteryInc.MsgBoxCBFuncs.MsgBoxCB4 = function(action)
-- #GroupDescription=Script --
-- #Comment=Script Comment --
if   action == "Button1" then
Stage = 7
Wherigo.Dialog{{Text=[[SCOOBY DOOBY DOO!!!]],Media=zmediaobjscoob},{Text=[[Congrats you found the geocache. I knew we could do it if we worked as a team. Make sure you sign the log book and trade fair.]],Media=zmediamsgfred},{Text=[[You can now unlock this cartridge on Wherigo.com by uploading the mysteryinc.GWS save file created on you device.]],Media=zmediaobjfred},{Text=[[Don't forget to talk with us all and say goodbye before you end your game.]],Media=zmediagang},}
ztaskGofindthegeocache.Complete = true
cartMysteryInc.Complete = true
else
if   action == "Button2" then
Wherigo.Dialog{{Text=[[RAWH RIME RORRY!!!]],Media=zmediaobjscoob},{Text=[[Maybe it got muggled by a real life muggle monster.]],Media=zmediamsgfred},}
end
end
end

 

Anyone have any ideas as the where the problem is?

 

Thanks again for any and all help,

Chris.

Link to comment

I was quickly looking at this and noticed something; this is just a first gut feeling, but it wouldn't hurt to try. In your OnTalk() function you have a series of if else statements; right after the Stage 7 if there is an empty else, then some ends and then another if (for stage 3). What might be happening is when Stage==6 and the CB4 is called the script still has to go back and check whether or not the Stage==3 or not. This may be causing the problem. Just to clean up the code and see if it helps I would suggest the following:

 

Notice I moved the check for Stage 3 into the if else block so that once one of the conditions is met, it won't come back and try to check again. Let me know if that helps.

 

function zcharacterScooby:OnTalk()
-- #GroupDescription=Script --
-- #Comment=Script Comment --
if   Stage == 1 then
Wherigo.MessageBox{Text=[[I ROVE ROU RHAGGY!!! Hee Hee Hee Hee.]],Media=zmediamsgscoob,}
else
if   Stage == 2 then
Wherigo.MessageBox{Text=[[I RONT ROW. RASK RAGGY!]],Media=zmediamsgscoob,}
else
if   Stage == 4 then
Wherigo.MessageBox{Text=[[RAYBE RE RONTS A ROOBY RACK?]],Media=zmediamsgscoob,}
else
if   Stage == 5 then
Wherigo.MessageBox{Text=[[RO GRET A REORACHE!!!]],Media=zmediamsgscoob,}
else
if   Stage == 6 then
Wherigo.MessageBox{Text=[[RID ROU RIND IT?]],Media=zmediamsgscoob,Buttons={"YES","NO",},Callback=cartMysteryInc.MsgBoxCBFuncs.MsgBoxCB4}
else
if   Stage == 7 then
Wherigo.MessageBox{Text=[[RA'LL RISS ROU!!! ]],Media=zmediamsgscoob,}
else
if   Stage == 3 then
Wherigo.MessageBox{Text=[[RUT RAIN RIS IT?]],Media=zmediamsgscoob,}
end
end
end
end
end
end
end
end

Link to comment

Thank you so very much.

 

I will try this when I get home from work tonight. I previously tried to "clean up" the code like you stated with the builder program but was unable to move the "Stage" part of scripts up or down. I could move the message box parts.

 

If I update the code in the .lua file as you suggested will I be able to open and see these changes in the builder program? The reason I ask is currently I need to upload and update cartridges to Wherigo.com through the builder. For whatever reason, when I try to upload directly to the site my web browser crashes (IE6). I can how ever successfully upload through the builder.

 

Thanks again,

Chris.

Link to comment

Yeah you should be able to open it up in the builder without any problem (make a back up just in case though :)). I just moved the Stage 3 check into the larger if/else block. I know what you're talking about when it comes to moving lines up/down via the builder; it doesn't always workout.

Edited by Tydirium
Link to comment

I will definitely create a back up first, thanks for the heads up.

 

One other thing I just thought of. There a quite a few other places in the code where this "unclean" issue is present. Where an "else" is followed by multiple "end"s and then followed by another script like in the example above. I'm just wondering if maybe this is not the problem as the cartridge seems to power through these other cases.

 

I'll edit it all up tonight and see what happens. Thanks again for all your help.

 

Cheers,

Chris.

Link to comment

Sorry for the delay in this response Ty, but I got a bit busy. Anyway after cleaning up the code a bit I've had 4 successful runs through the cart on my Colorado. I haven't been able to test it on a PPC yet. I think you fixed my problem Ty, thank you very much. ;)

 

Cheers,

Chris.

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