Jump to content

Set Distance to Zone to a variable


bflentje

Recommended Posts

I've searched around and got close but it is unclear to me how to Set the value of distance to zone into a variable object. Can someone please lead me down the correct path?

 

And what is the relationship between variables and expressions? While I understand the fundamental idea of functions and expressions since I am a programmer (in another language) but there must be a disconnect somewhere in the Earwigo tool that I am trying to use.

 

Basically trying to create the classic warmer colder game, which is out there in other areas. But to determine actual warmer or colder I need to know what the "last" reading was in order to do a compare.

Link to comment

Sorry for the late answer.

 

To get the distance from your actual position to y zone, you could use

local d,b = Wherigo.VectorToZone(Player.ObjectLocation, zoneObj)

d is the distance, b is the bearing from Player ObjectLocation to zone zoneObj.

 

Expressions are comparisons between variables or variables and values. Earwigo needs this, because it uses this expressions to create the if statements.

 

To do the warmer/colder game, use a global variable (created by Earwigo), which holds the last distance. Compare than this variable with the new value.

Link to comment

Sorry for the late answer.

 

To get the distance from your actual position to y zone, you could use

local d,b = Wherigo.VectorToZone(Player.ObjectLocation, zoneObj)

d is the distance, b is the bearing from Player ObjectLocation to zone zoneObj.

 

Expressions are comparisons between variables or variables and values. Earwigo needs this, because it uses this expressions to create the if statements.

 

To do the warmer/colder game, use a global variable (created by Earwigo), which holds the last distance. Compare than this variable with the new value.

 

Thanks. But how do I implement that code to assign distance to my variable? Everything about building Wherigo makes sense to me except in how to use custom code and where I interact with it.

Link to comment

Sorry, that I don't provide a instruction, how to restore the backup file.

 

Go to Earwigos "Manage cartridges" page and select "Restore" in the "Operation" combo box. Than use "Select file to upload" button to specify, which backup file you want to restore. Than use button "Submit" to start the restore process. That's it.

 

But be carefull. This only works, if you don't reached your maximum number of allowed cartridges. If you allready have 5 cartridges, than you don't see "Restore" in the "Operation" section :(

Link to comment

Sorry, that I don't provide a instruction, how to restore the backup file.

 

Go to Earwigos "Manage cartridges" page and select "Restore" in the "Operation" combo box. Than use "Select file to upload" button to specify, which backup file you want to restore. Than use button "Submit" to start the restore process. That's it.

 

But be carefull. This only works, if you don't reached your maximum number of allowed cartridges. If you allready have 5 cartridges, than you don't see "Restore" in the "Operation" section :(

 

I think this is exactly my problem. I have exactly five carts in Earwigo. Thanks for pointing out my dunderhead move. Good thing is that one is just a junk cart and can be deleted. Will take a look at it again today.

 

You have no idea how much I appreciate the help.

Link to comment

I think this is exactly my problem. I have exactly five carts in Earwigo. Thanks for pointing out my dunderhead move. Good thing is that one is just a junk cart and can be deleted. Will take a look at it again today.

 

If it is real junk, deletion is the way to go. In general bfore you delete a cartridge, consider to backup all old finished cartridges (ManageCartridges/Backup) to your home computer to free up space. Once they are stored on your home PC delete them on Earwigo.

Link to comment

Sorry, that I don't provide a instruction, how to restore the backup file.

 

Go to Earwigos "Manage cartridges" page and select "Restore" in the "Operation" combo box. Than use "Select file to upload" button to specify, which backup file you want to restore. Than use button "Submit" to start the restore process. That's it.

 

But be carefull. This only works, if you don't reached your maximum number of allowed cartridges. If you allready have 5 cartridges, than you don't see "Restore" in the "Operation" section :(

 

Ok, now that daughter's graduation is over with from the weekend, finally had time to come look at this again. I did manage to get it into Earwigo. Thanks for pointing out the errors of my ways. I see most of the logic is in the timer. I am going to spend some time studying it and seeing how it runs. I suspect I'll have a couple of questions but thank you again so much for getting me to this point.

Link to comment

I see most of the logic is in the timer. I am going to spend some time studying it and seeing how it runs. I suspect I'll have a couple of questions but thank you again so much for getting me to this point.

 

http://earwigo.net/WWB/wiki/doku.php?id=timers this link to timer functionality in the Earwigo wiki might help to get you started with timers. The naming of the events and timers is somewhat confusing. Have a look ;-)

Link to comment

Thats easy .. see the pic below ... the numeric operation (value * 1) rounded with 0 decimal places is for better readability ... 172 m instead of 172.74623457823m

But better than a message is to change the description of an item with a timer, so you have continuous values each n seconds (depending on timer duration) ... 172m....169m....163m ....

Example in the testsuite under timer "Checkposition".

EN :
http://www.Wherigo.com/cartridge/details.aspx?CGUID=676f945a-4fb0-43da-b6d4-fc192757cb7a

DE :
http://www.Wherigo.com/cartridge/details.aspx?CGUID=9ae24abd-7e18-466f-99f8-97899f3d95e0

dist.jpg

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