Jump to content

Signal Strength?


Delta68

Recommended Posts

Accuracy is important for a Play Anywhere cartridge since you don't want to create a dynamic zone if the accuracy is terrible. Here's the code we use in that cartridge. Really there is only one line to focus on:

 

local accuracy = Player.PositionAccuracy:GetValue('ft')

 

 
function zitemSpacesuit:OnWear()
local accuracy = Player.PositionAccuracy:GetValue('ft')
if accuracy > 0 and accuracy < 150 then
	Wherigo.MessageBox{Text=[["Great job. You have successfully completed the first task by wearing the Spacesuit."]],Media=zmediacaptainjonmsg, Callback=cartWherigoTutorial.MsgBoxCBFuncs.MsgBoxCB2}
	ztaskTakeSpacesuit.Complete = true
else
	Wherigo.MessageBox{Text=[["Your GPS signal is not optimal. Try moving around to get better reception. You may have to change your GPS settings if you do not get a signal."]], Media=zmediacaptainjonmsg}
end
end

Link to comment

Accuracy is important for a Play Anywhere cartridge

 

So gather from that, that if we're using zones this shouldn't be a problem... ;)

 

Handy bit of code to know though! :)

 

Thanks

 

It shouldn't. I think it can also be used to check whether the user is in the emulator. I'm almost positive that accuracy is 0 in the emulator which is why we check for > 0 and < 150 for accuracy. This may be a better way to see if a user is using the emulator instead of checking altitude.

Link to comment

It shouldn't. I think it can also be used to check whether the user is in the emulator. I'm almost positive that accuracy is 0 in the emulator which is why we check for > 0 and < 150 for accuracy. This may be a better way to see if a user is using the emulator instead of checking altitude.

 

How do I check the accuracy and/or altimeter in Wherigo?

 

I have a completed cartidge and people have gotten word out that you can do it in the emulator.

 

Does anyone have some sample code I could use to check the altimeter reading?

Edited by kvhollis
Link to comment

It shouldn't. I think it can also be used to check whether the user is in the emulator. I'm almost positive that accuracy is 0 in the emulator which is why we check for > 0 and < 150 for accuracy. This may be a better way to see if a user is using the emulator instead of checking altitude.

 

Ok, ok... gotcha!

Tomorrow I'll update my cart with the new check.

 

Thanks for the note !!!

 

Kazuma, geocaching-italia

Link to comment

It shouldn't. I think it can also be used to check whether the user is in the emulator. I'm almost positive that accuracy is 0 in the emulator which is why we check for > 0 and < 150 for accuracy. This may be a better way to see if a user is using the emulator instead of checking altitude.

 

Ok, ok... gotcha!

Tomorrow I'll update my cart with the new check.

 

Thanks for the note !!!

 

Kazuma, geocaching-italia

Just a note: the accuracy in the emulator right now is always 1 and the altitude is always 0. This may change in the future as we try to more accurately emulate real-world gps.

 

David.

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