+Afterburned Posted October 8, 2012 Share Posted October 8, 2012 I class myself as fairly tech savvy and quite logical. Why on earth can I not get an IF expression that fires when the player is within proximity of a zone? I have tried with Wherigo Builder and Urwigo, and neither one will fire in the Emulator. Basically I have characters and items that I want to perform differently when in different zones. I am using Proximity as I know that some Garmin's have problems with being 'In' the zone (onEntry not working etc). I have attached the test.lua but here is the relevant code: function zitemItem:OnCommand() -- #GroupDescription=Script -- -- #Comment=Script Comment -- if zoneZone.ZoneState == "Proximity" then Wherigo.MessageBox{Text=[[inProximity]],} else Wherigo.MessageBox{Text=[[Not InProximity]],} end end So tell me - is it just me? Test.zip Quote Link to comment
+MightyReek Posted October 9, 2012 Share Posted October 9, 2012 I class myself as fairly tech savvy and quite logical. Why on earth can I not get an IF expression that fires when the player is within proximity of a zone? I have tried with Wherigo Builder and Urwigo, and neither one will fire in the Emulator. Basically I have characters and items that I want to perform differently when in different zones. I am using Proximity as I know that some Garmin's have problems with being 'In' the zone (onEntry not working etc). I have attached the test.lua but here is the relevant code: function zitemItem:OnCommand() -- #GroupDescription=Script -- -- #Comment=Script Comment -- if zoneZone.ZoneState == "Proximity" then Wherigo.MessageBox{Text=[[inProximity]],} else Wherigo.MessageBox{Text=[[Not InProximity]],} end end So tell me - is it just me? Nop, me too. I didn't manage a way to make that work. The only thing I managed to do is with Zone's OnProximity/OnRange/OnEnter commands... Quote Link to comment
+charlenni Posted October 9, 2012 Share Posted October 9, 2012 You did a proximity of 2 m. Is this right? If yes, it's to tiny. You should use a 20 m proximity for tests. I think, you didn't manage to get in the proximity zone because of unstable coordinates. Garmin didn't have problems to get 'in' a zone. The problem is, that players stop at the edge of the zone. And with unstable coordinates you didn't have to move one step to go in and out of the zone. You should resize your zones (about 20 m x 20 m at minimum) and encourage the players to walk to the center of the zone (a special point in real world). Quote Link to comment
+MightyReek Posted October 9, 2012 Share Posted October 9, 2012 Just for clearing, I changed the proximity value to 20 meters for testing... Quote Link to comment
+charlenni Posted October 9, 2012 Share Posted October 9, 2012 Did you tried to use OnProximity as event? Quote Link to comment
+MightyReek Posted October 9, 2012 Share Posted October 9, 2012 Using the Zone's OnProximity event it's possible to change variable values, but it won't change when you exit the proximity... Quote Link to comment
+charlenni Posted October 9, 2012 Share Posted October 9, 2012 Than the event OnDistant is fired. But I did some testing. The property "ZoneState" of the zone object is allways nil (it's not defined). You should use the property "State" to get "Proximity", "Distant", "Inside" and so on. That should solve your problem. Quote Link to comment
+Afterburned Posted October 9, 2012 Author Share Posted October 9, 2012 Than the event OnDistant is fired. But I did some testing. The property "ZoneState" of the zone object is allways nil (it's not defined). You should use the property "State" to get "Proximity", "Distant", "Inside" and so on. That should solve your problem. Thanks for the response - from my testing this means that I cannot do this with Urwigo as it must use the wrong property. Earwigo again then....! Quote Link to comment
+jonny65 Posted October 10, 2012 Share Posted October 10, 2012 I'm using a similary thing, which shows the player the remaining distance to a zone POINT (a zone with 3 EQUAL coords), where he has to place a bomb It can be used for "proximity events" too. In the example after each second or 2 or 3 a countdown timer checks whether the player is in a certain range (<=20 meters). If so, an event can be fired (here a simple message). If not the countdown starts again. Have had some problems with timers of typ interval, thats why I only use countdown timer. Quote Link to comment
+Afterburned Posted October 10, 2012 Author Share Posted October 10, 2012 Hmm, this is again going from the centre point of the zone rather than the actual zone dimensions, so has to assume that the zone is round. Try this with a rectangular zone and you will get very odd results! Ah well, we have to work with what we have - many thanks for the suggestion! (I will probably still use your code in another part of the cart anyway ) Quote Link to comment
+jonny65 Posted October 12, 2012 Share Posted October 12, 2012 Yes, of course the "zonepoint" is a special thing, but I think this works for a "normal" zone with 4 points too...or not ? In both cases the "distance to a zone" applies to a point (in 1st case really to 1 point and in 2nd case to a point from the border line of the zone) But I haven't checked it out. I wrote it because I thought this could be a possibility. Quote Link to comment
+Afterburned Posted October 14, 2012 Author Share Posted October 14, 2012 Nope, the behaviour is the same no matter how many points - it works it out from the zones centre. It does mean if you have a long thin zone this will trigger if you are near the centre but outside the zone, and not if you are in the zone but at one end. In my case I could solve it with placing the zone well, just about get away with a 140m distance from centre that hits all the right points but misses the wrong ones. Thanks for the input, I really need every bit of help building these things. Quote Link to comment
Recommended Posts
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.