Jump to content

Showing a series (of Dialog) messages to the Player Bug


Where I Go Again

Recommended Posts

I'm creating my first cartridge and have run into a mind blowing error. There has to be a simple solution and I'm not seeing it.

 

Here's what I'm trying to do:

 

On startup of the cartridge, the player sees a series of dialog messages with pictures, followed by the task bar screen. The initial location for the game happens to be Zone 1.

 

This should be simple: These 3 things should happen in order and with OK pauses for each screen.

 

Under Cartridge / Events / When a cartridge is started / Script reads:

Show a series of Dialog messages to the player

Show screen task screen

 

When the player enters the zone (which they begin in)

Show message to player.

 

When I play the cartridge on the emulator, the series of messages blast by without me hitting OK, the Zone 1 message appears. After I hit OK, the task bar screen comes on.

 

I've tried getting rid of the Zone 1 show message when player enters zone. And the series of Dialog messages still blasts by.

 

I have another section of the game where a player enters a zone and a series of dialog messages with pictures pops up. After each of the 3 screens, I have to hit OK. It works flawlessly.

 

For some reason however, the series of Dialog isn't working on the Cartridge is started sub menu

 

I hope all of this makes sense.

 

The interface is pretty fluid once you get into the programming mindset. Enjoying it so far.

 

Thanks,

 

CJ

Link to comment

Under Cartridge / Events / When a cartridge is started / Script reads:

Show a series of Dialog messages to the player

Show screen task screen

 

When the player enters the zone (which they begin in)

Show message to player.

 

When I play the cartridge on the emulator, the series of messages blast by without me hitting OK, the Zone 1 message appears. After I hit OK, the task bar screen comes on.

 

I've tried getting rid of the Zone 1 show message when player enters zone. And the series of Dialog messages still blasts by.

 

Hi CJ,

 

If I understand correctly what you're describing here, it sounds like you're encountering the "non-modal" aspect of the Wherigo platform. As I briefly explained over in another thread, the application does not ever "stop" to wait for user input (whether it is asking for text to be typed in, or just a button to be pressed). So, if your cartridge displays a MessageBox to the user and then tells the User Interface (UI) to display a specific screen (like the Tasks Screen) or display a different MessageBox, whatever is being displayed will be replaced with the new screen/message. In your description above, because you have an OnStart Dialog string *and* you have a MessageBox that is displayed when a user enters a zone, you will get the "odd" behaviour you are describing when the user starts the cart in the zone.

 

One solution to this is to use the MessageBox "callback" routines to only have "stuff happen" in response to the user dismissing the MessageBox. So, for example, you could put the "show task screen" in the callback for the OnStart MessageBox so that the Tasks Screen is only shown after the user has read thru the message. You could also make the initial zone start inactive so that the zone OnEnter event does not occur right after the OnStart. Then, make the zone active after all the initial OnStart display stuff is done.

 

Hope this helps some.

-peter

Link to comment

Peter,

 

I'm super confused by the MessageBox Callback function. So confused I couldn't find it.

I created another way to "skin the cat"

 

1) Create a Variable Isthisthestartup

2) Set the variable to "YES" (String=YES)

3) The player begins the game in Zone 1

4) Events ==> Script for entering Zone 1

If Isthisthestartup EQUAL YES

Show a series of Dialog Message (These explain the cartridge storyline)

else

Show another message to the player (Note: Zone 1 is a zone that the player will often enter)

Set Isthisthestartup equal to NO

5) Event = When the player Exits the zone

Set Isthisthestartup equal to NO

 

It's not the most elegant code up it gets the job done.

 

My guess is that this Dialog Message startup situation will occur in a lot of "Story" cartridges where you need to get a lot of info out to the player.

 

Thanks for getting back to us so quickly,

 

CJ

Link to comment

Hi CJ,

 

I am sorry my previous post didn't really clear up the confusion. Here's some more detail, and hopefully that will help. Of course, please do keep asking questions if you're confused or I don't do an adequate job of answering your question(s).

 

First, the scenario you are describing is essentially this (correct me if I am wrong): You have two independent, simultaneous events (ZCartridge:OnStart and Zone:OnEnter) that are both competing to display something on the screen. This is normally not a great idea; my colleague, David, has written up a document that lists some of the pitfalls and best practices of cartridge building, so perhaps I can entice him to chime in here and talk a bit about it. I understand that you have to set up the cartridge story, etc; the Village Robot cartridge does the same thing: it has an opening MessageBox that is displayed when the cartridge starts _and_ it has a MessageBox that is displayed when the user enters the first (and only active) zone. The solution that the Village Robot cartridge used was to have the cartridge starting location be _away_ from the first zone so that the user starts the cartridge, reads the intro text, and then walks into the first zone.

 

Of course, maybe you have good reasons for starting the cartridge inside the zone. If so, then the approach you described is pretty much what you'll need to do: use a variable to keep track of what event is displaying text on the screen and not allow other events to display something on the screen while another event has the screen "locked" (so to speak). Now, that leads me to your confusion with MessageBox callbacks. I call them callbacks because that is what the Wherigo Library (script code) calls them. But, the Builder calls them "Script to run when button is clicked" (which is really just saying the same thing). To further the confusion, the Builder only supports this on the "Show MessageBox to Player" action, and not on the "Show a series of Dialog messages" action. (It is possible to have a "final callback" in a Dialog API call, but you'll need to drop down to the Lua script to do this.)

 

So, at a "pseudo-code" level, this is what you need to do:

* Create a variable "Isthisthestartup" and default it to the string YES (or the boolean true)

* In the OnStart event, show a (single) messagebox to the user (I'll refer this to Msgbox A)

* For Msgbox A, create a "script to run when button is clicked" (callback) that shows the next part of the dialog string you want to show (called Msgbox B ).

* Repeat the previous step for as many parts of the Dialog string you have.

* In the callback (script to run...) for the final messagebox, set the "Isthisthestartup" variable to the string NO (or the boolean false).

* In the Zone:OnEnter event, check the Isthisthestart variable, and if it is YES (or true), do nothing.

Else, show your dialog/messagebox to the user.

 

This idea can be gernalised to any "competing" events by using a "locking" variable that all potentially "competing" events check before displaying text to the user. If the "locking" variable is false, then that event sets it to true, displays the text, and in the callback for the messagebox, sets the locking variable back to false.

 

Yes, this is somewhat difficult. The alternative approach is to just assume that, depending on how you design the cartridge, some messageboxes may get "overwritten" and always give the user a way to display the message again (by talking to a character, examine an object, etc.). You can see this style in a number of "traditional" gaming systems (like Zelda for the DS, etc).

 

Also, a key point here is that messagebox callbacks give you, the cart author, a way to "run code" only after the user has acknowledged the messagebox, rather than when an event occurs. So you can do all sorts of things with messagebox callbacks; like show a messagebox, and then show a GetInput right after the user reads the messagebox.

 

Does this help?

-peter

Edited by GeoGern
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...