Jump to content

Intermittent trigger problems with On Entry


elonka

Recommended Posts

Hi, I'm working on the Wherigo cartrige "WHERmIzombieGO": http://www.Wherigo.com/cartridge/details.aspx?CGUID=d8e7cad6-3eb4-41c9-bb5e-257f32f08b52

 

The bug I'm trying to figure out, is that in certain situations and on certain devices, the script isn't triggering on a zone entry, and I'm at a loss as to why.

 

The problem tends to occur at the "Office Building" zone. Up to that point, everything works fine, scripts trigger as they're supposed to when entering zones. But then at the Office zone, some devices (most notably iPhones and iPads) don't trigger. Their location menus show that they're in the zone, but the story doesn't progress. Android users with them (in the same car), have it work just fine.

 

It works perfectly in the Wherigo Builder emulator, and works perfectly on my own iPhone.

 

I've had several people test it on different devices, and it's a consistent few of the iPhone users that are having trouble, but only on that one zone. I've looked at the raw Lua code, and am not seeing anything unusual, but will paste it here in case someone else notices something:

 

function zoneOfficeBuilding:OnEnter()
-- #GroupDescription=Script --
-- #Comment=Script Comment --
if   ztaskGotoofficebuilding.Active == true then
Wherigo.PlayAudio(zmediasnd_Arrive)
zoneCemetery.Active = false
ztaskGotoofficebuilding.Active = false
Wherigo.Dialog{{Text=[[You arrive at the office building, and use your GUTS to find Patient Zero -- one of the employees. After a frantic chase around the building, you tackle Patient Zero and take a blood sample so a vaccine can be synthesized for the mutated zombie virus. You're a hero!

]],Media=zmediaimg_Dave},{Text=[[You've just saved humanity, hooray! Just one more step to complete the game: Go find the geocache!]],Media=zmediaGUTS},}
ztaskFindcachezone.Visible = true
ztaskFindcachezone.Active = true
zoneCache.Visible = true
zoneCache.Active = true
end
end

 

I'm at a loss as to how to fix this, especially since I can't duplicate it on all devices. Does anyone know of a workaround, or what might be causing this?

 

Thanks for any assistance,

 

Elonka

Link to comment

Is the zone just too small for the iPhone? What happens if you switch it to use OnProximity? If they're driving past the zone, I wonder if the iPhone just doesn't have time to update.

 

Could you post the lua code that defines the zone?

 

Hi, thanks for the help.

 

I don't think it's the zone size, since there are other zones that are only a quarter of the size, earlier in the cartridge, that triggered just fine. It's also a "pull in and park" zone (as are the others), so speed can't be the issue. I haven't tried switching to OnProximity yet.

 

Here's the zone definition:

 

zoneOfficeBuilding = Wherigo.Zone(cartWHERmIzombieGO)
zoneOfficeBuilding.Id="a70bda45-5989-4bb9-a9a2-2dc5fcd6f2cd"
zoneOfficeBuilding.Name="Office Building"
zoneOfficeBuilding.Description=[[218 Millwell Drive, just north of Dorsett. May look like it's just a typical office building, but in your augmented reality, this is the workplace of the sought-after Patient Zero, who launched the Zombie Plague!]]
zoneOfficeBuilding.Visible=true
zoneOfficeBuilding.DistanceRange = Distance(-0.999999997326336, "miles")
zoneOfficeBuilding.ShowObjects="OnEnter"
zoneOfficeBuilding.ProximityRange = Distance(200, "feet")
zoneOfficeBuilding.AllowSetPositionTo=false
zoneOfficeBuilding.Active=false
zoneOfficeBuilding.Points = {
 ZonePoint(38.717034,-90.435183,0),
 ZonePoint(38.718072,-90.436632,0),
 ZonePoint(38.71591,-90.436664,0)
}
zoneOfficeBuilding.OriginalPoint = ZonePoint(38.717477,-90.435686,0)
zoneOfficeBuilding.DistanceRangeUOM = "Miles"
zoneOfficeBuilding.ProximityRangeUOM = "Feet"
zoneOfficeBuilding.OutOfRangeName = ""
zoneOfficeBuilding.InRangeName = ""
zoneOfficeBuilding.Media=zmediaimg_simutronics

 

To see if it would help anything, I tried re-defining the zone to the following. But then when my tester ran through the game again, she got stuck in a different zone, that had worked before, and which I hadn't modified with the new version. :/

 

zoneOfficeBuilding = Wherigo.Zone(cartWHERmIzombieGO)
zoneOfficeBuilding.Id="a70bda45-5989-4bb9-a9a2-2dc5fcd6f2cd"
zoneOfficeBuilding.Name="Office Building"
zoneOfficeBuilding.Description=[[218 Millwell Drive, just north of Dorsett. May look like it's just a typical office building, but in your augmented reality, this is the workplace of the sought-after Patient Zero, who launched the Zombie Plague!]]
zoneOfficeBuilding.Visible=true
zoneOfficeBuilding.DistanceRange = Distance(-0.99999999618048, "miles")
zoneOfficeBuilding.ShowObjects="OnEnter"
zoneOfficeBuilding.ProximityRange = Distance(200, "feet")
zoneOfficeBuilding.AllowSetPositionTo=false
zoneOfficeBuilding.Active=false
zoneOfficeBuilding.Points = {
 ZonePoint(38.71751,-90.43664,0),
 ZonePoint(38.71751,-90.43528,0),
 ZonePoint(38.71645,-90.43528,0),
 ZonePoint(38.71645,-90.43664,0)
}
zoneOfficeBuilding.OriginalPoint = ZonePoint(38.71698,-90.43596,0)
zoneOfficeBuilding.DistanceRangeUOM = "Miles"
zoneOfficeBuilding.ProximityRangeUOM = "Feet"
zoneOfficeBuilding.OutOfRangeName = ""
zoneOfficeBuilding.InRangeName = ""
zoneOfficeBuilding.Media=zmediaimg_simutronics

 

If you want, I'll give you access to our dropbox folder and you can see the whole thing?

 

Elonka

Link to comment

I figured out what may be causing the problem, but am still scratching my head on a fix. It has to do with Quitting, Saving, and Resuming. What's happening is that when some folks with iOS devices save and resume while in a zone, the device saves at some sort of midway state, which then prevents further progress for some reason.

 

Example:

 

In the Wherigo cartridge, the task is "Go to cemetery"

 

Entering the cemetery zone, the "Go cemetery" task is deactivated, and a new task "Find tombstone" activates, with a tombstone visible in the zone.

 

Tapping on the tombstone brings up an action "Find tombstone" with an input option, to enter the tombstone's birth year.

 

Once the correct year is entered, the "Find tombstone" task is deactivated, and a "Go to office building" is activated.

 

At this point (call it Point A), the only task that is showing is "Go to office building"

 

When some iOS users are saving at this point, when they resume the game, instead of seeing the one "Go to office building" task, they see TWO tasks: "Go to office building" and "Find tombstone" shows up again. In the code, there's no way that both of those tasks should be active at once, but the save/resume process somehow rewinds one of them.

 

From there, going to the office building will show players as in the zone, but the "on zone entry" option doesn't trigger.

 

I was able to duplicate the save/resume rewind other places as well. It seems to boil down to:

 

* In the zone, Task A is active (working correctly)

* Task A is accomplished, de-activated, and replaced with Task B. (working correctly)

* The player saves and resumes, which causes Task A to appear again, alongside Task B. (this shouldn't happen)

 

I can think of a few ways to make my code more robust, like putting secondary objects in zones that a player can click on to continue the story, in case the "on entry" doesn't work.

 

But does anyone know of a way to prevent the problem in the first place?

 

Thanks,

 

Elonka

Link to comment

I'm not sure if this bug just applies to tasks. I do need to point out, though, that the click/tap action on a task is not supported by all Wherigo Players (those still using Garmin devices, for example, won't be able to proceed because Garmin did not build that action into their Wherigo Player).

 

What happens when someone resumes the cartridge without the first task accomplished? Will both tasks show up? If not, you could have some sort of resume code that checks for the second task's visible state. If the second task is visible, hide the first. What happens when you mark the first task as complete before you hide it?

 

I haven't heard of someone reporting this nuance. I'd like to pass this along to Groundspeak if I can get a small demo cartridge of this created, but I'd rather only give them one thing at a time to work on. I'm still prioritizing that unlock code site bug above anything else because it's supposed to be very easy to solve. (Yes, it has been five months. I'm both patient and persistent.)

Link to comment

What happens when someone resumes the cartridge without the first task accomplished? Will both tasks show up? If not, you could have some sort of resume code that checks for the second task's visible state. If the second task is visible, hide the first. What happens when you mark the first task as complete before you hide it?

 

I'd love to get you this data, but it's very cumbersome to test. The system works perfectly in the emulator, including with save/resume. So to duplicate the problem, I need to go into the field, halfway through a 12-mile 2-hour cartridge, and cause it to happen on an iOS device (Androids are all working perfectly).

 

I don't know yet if the save/resume bug is related to the "on entry" problem, but in the meantime I'm working around it by putting an extra NPC into the buggy zone. So if for some reason the "on entry" doesn't work, the player can still talk to the NPC and get the story to progress that way.

 

Next time I run a field test I'll try to check on the issues you mentioned...

 

Elonka :)

Link to comment

This probably isn't your issue, but just a thought. I had an issue because of the order in which I put my GPS coordinates that defined my zone. The Zone was more Hour glass shape verses box. The Oregon would find the zone, but the Iphone (least my 3GS) could pin point it. See Attached photo as what i'm talking about.

 

Thanks, I did check for that. I also found an issue where the zone "center point" was outside the zone, so I moved it back in. But it didn't fix the problem. You may be right though, that it's some kind of weird zone definition issue. I'll keep poking at it!

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