Jump to content

Zones, characters, and crashes?


ModelCitizen

Recommended Posts

I'm working on my second Wherigo cartridge and am using characters in this one. I'm concerned that I may need to be very careful how I implement the zones and characters so that I don't introduce situations that may cause certain GPS devices (Garmins in particular) to crash or shut down.

 

In my first cartridge I learned that I needed to deactivate zones as soon as the OnEnter or OnProx event fires, before putting up a message box. Otherwise, the GPS device may recalculate its position, decide that it has moved back out of the zone, then recalculate again and determine it has re-entered the zone, firing the OnEnter event again (possibly multiple times) and crashing the device. So in my first cartridge I deactive the zone as the first command in the OnEnter or OnProx script. That made a big difference in the stability and playability of the cartridge on Garmin devices. Much better now.

 

However, in my second cartridge I'll have characters in the zones. It appears that I MUST leave the zone active in order for the character to be visible to the player so that the player can interact with the character. What I want to do is show a message to the player when they enter a zone, activate the character in that zone, and end the OnEnter script, leaving the zone active the whole time. Seems like the OnEnter could then trigger multiple times as the GPS recalculates. I searched the forum, but didn't find any threads indicating that other people are concerned about this situation. In fact, the Wherigo Builder Tutorial describes using characters in this way.

 

For now, I came up with a work-around. I set up a zone with an OnEnter event. The OnEnter script immediately disables the zone, then activates another zone that is centered on the first zone, but is larger. So the player is already inside the second zone when it is activated. The second zone doesn't have an OnEnter or OnProx event. It doesn't have any events that could fire multiple times. The second zone just contains the character. This should allow the player to interact with the character without worrying about the zone events retriggering and messing things up.

 

Has anyone else had these type of issues with characters in zones causing problems in a cartridge? Or am I worrying about nothing? I'm trying to make my cartridges very stable and tolerant of any GPS device, even Garmins.

 

Thanks!

Blue skies!

Model Citizen - Zero Discipline

Link to comment

You could have also used a variable to denote whether the message box has fired: if not this value, show a message, end, set the value. Or if the character isn't shown until OnEnter, you could have the character set to invisible, show the message if the character is invisible, then make the character visible. Stuff like that.

 

I haven't heard of problems regarding characters other than not to use the OnClick event. Not as many people use custom/item-specific commands with their characters, so I don't hear as much about that. I have used item-specific commands on two of my cartridges and haven't heard of any problems.

 

(Skydiving is a hobby not like the others: you're much closer to the ground on the others.)

Link to comment

I have one where I do a variation of the workaround Model Citizen described. The entire Wherigo takes place in a park. I have one large zone which is always active once you enter it for the game. It is actually larger than the park so you will never go out of it in normal play. Then I have more normal zones as well. The characters and items are always in the larger "game" zone.

Link to comment

Thanks for the help. I wonder which method would involve less additional overhead on the Player...

- adding an additional zone that would require the Player to evaluate positional information with respect to the zone, or

- allowing the OnEnter event to fire potentially multiple times, checking a flag and then exiting the event script each time.

 

Sounds like either should work.

 

Blue skies!

Model Citizen - Zero Discipline

Edited by ModelCitizen
Link to comment

Thanks for the help. I wonder which method would involve less additional overhead on the Player...

- adding an additional zone that would require the Player to evaluate positional information with respect to the zone, or

- allowing the OnEnter event to fire potentially multiple times, checking a flag and then exiting the event script each time.

 

Sounds like either should work.

 

Blue skies!

Model Citizen - Zero Discipline

 

Interesting question - I don't know.

 

When I implemented an additional "mega zone" I was not aware of or considering issues caused by multiple OnEnter fire. What I was worried about was drifting out of the zone and as such no longer being able to interact with the characters and items. Having the large additional zone solves this, the other solution does not.

Link to comment
Thanks for the help. I wonder which method would involve less additional overhead on the Player...

- adding an additional zone that would require the Player to evaluate positional information with respect to the zone, or

- allowing the OnEnter event to fire potentially multiple times, checking a flag and then exiting the event script each time.

I'd imagine having an additional active zone would involve more overhead due to the cost of calculating the player's distance to the zone each cycle. OnEnter won't fire near as much as that and, when it does, it's cheap to check true/false logic.
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...