Jump to content

Task Completion works in Emulator, not on device


snoyes

Recommended Posts

To complete the task, the player must carry three objects into a zone. The zone's OnEnter() method checks if the zone contains all three items. It sets the task and the cartridge to complete, and shows a message box.

 

It works fine on the emulator - as I drag the guy into the zone with the last item, I get the message and the task is marked complete.

 

On my HTC Evo running WhereYouGo, I can carry the objects into the zone, but there is no message box and the task still shows as pending.

 

I have tried building the .gwc with both the Wherigo Builder and Urwigo.

Link to comment

I'm assuming WhereYouGo doesn't have an issue marking tasks as complete (I don't own a Droid and most of the discussion concerning WhereYouGo happens on another forum, where I don't have time to keep up to date).

 

The first thing I'd like you to check is the OnEnter event itself. Are you certain that, when you play in the field, the event is firing? (Refer to the bottom of my post for why I asked as it's a bit of a tangent to include here.) To tell if the OnEnter event is firing, include a MessageBox that shows up when you enter the zone. So you don't have to collect all the items again in your game, just put the MessageBox at the top of your OnEnter event, before you test for the items' locations. Depending on what you discover, you may have to increase your zone's size or switch to using OnProximity.

 

Let us know what you find out!

 

-----------

 

Here's the full, unedited reason I ask: There are some Players where, to fire the OnEnter event, you must be zero feet/meters from the zone. This is rather difficult to accomplish, which is why I usually suggest using OnProximity and setting the zone's proximity to 12 feet / 4 meters at the smallest. On the other hand, if a Player takes a zone's size (and shape) into account and processes the OnEnter event correctly, you should just concentrate on the zone's dimensions. There's also GPS receiver inaccuracy to consider.

Link to comment

It definitely recognizes that I have entered the zone (I got the message text you said to add, and also I have prevented it from dropping an item outside of a zone.) Still didn't complete the task.

 

However, I got it to work by adding the checking for all 3 items to the zone's OnExit method, dropping the item in the zone and then walking away. So I have a hunch:

 

I'm checking for task completion via a line like:

 

if zoneB:Contains(zitem1) and zoneB:Contains(zitem2) and zoneB:Contains(zitem3) then...

 

When I walk in with item 3, it's in my inventory. Perhaps WhereYouGo doesn't consider that a zone contains an item if that item is in the player's inventory, even if the player is within the zone. The emulator considers the player's inventory to be within the zone if the player is.

Link to comment

Frankly, I'm surprised to hear any Wherigo Player includes the player's inventory when determining if an item is within a zone (as long as the player is within the zone as well). I'm surprised because that's something I haven't considered. When I create tests for your situation, I assume the player is already within the zone when the OnEnter or OnProximity event fires, and I test for if the items are in the player's inventory, not if the items are within the zone. Considering I use OnProximity for compatibility with the Garmin Players still in use in my area, I wouldn't be able to test for the items' locations within the zone, anyway.

 

As far as I know, what you want is a player to carry all three items to a zone. If the player doesn't have to drop an item, you could just test for the player's inventory when the player enters the zone. If dropping an item is part of the game or plot, you could test for if the item is either in the player's inventory or in the zone itself. This should get around any other problems you might encounter.

Link to comment

For this particular cartridge, I make the player carry only one item at a time. So I just checked for task completion each time a player drops an item, and that works fine for this one.

 

For future cartridges, I'll just remember to check both the zone and the player's inventory if that's appropriate.

 

Now on to figure out how to write functions or subroutines or whatever so I don't have to repeat the code for each item.

Link to comment

I'd love to see this spec. There had to have been one at some point for Garmin to build its Player. However, even with my level of privilege, I haven't seen such a document, nor heard much beyond its fabled existence.

Based on the behavior of the Garmin Player, I doubt there was a formal spec. More likely the programmer at Garmin just asked someone at Groundspeak "How does x work". If he didn't ask the question, he could just program it however it was convenient. There may have been some test cartridges that had to run on the Garmin Player, but these certainly didn't cover every situation.

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