+Delta68 Posted June 18, 2021 Share Posted June 18, 2021 How do I convert a pair of lon and lat values into a point so I can get the bearing between two points? Thanks 1 Quote Link to comment
+Hügh Posted June 19, 2021 Share Posted June 19, 2021 (edited) Use the built-in VectorToPoint function. local p1 = ZonePoint(47.6490674, -122.3479173, 0); local p2 = ZonePoint(47.6205063, -122.3492774, 0); local distance, bearing = Wherigo.VectorToPoint(p1, p2); print(distance:GetValue("m")); -- 3175.3430431868 print(bearing); -- 181.83845927044 Edited June 19, 2021 by Hügh 2 Quote Link to comment
+Forest-Ghost Posted June 21, 2021 Share Posted June 21, 2021 Does anyone know how to use the VectorToPoint function in urwigo? I am trying to build a reverse cache using just the bearing. I keep getting errors though. Quote Link to comment
+Delta68 Posted June 22, 2021 Author Share Posted June 22, 2021 I can't get it to work either. Passing a zone to a function or referencing a zone in a funtion always errors Quote Link to comment
+Hügh Posted June 22, 2021 Share Posted June 22, 2021 (edited) On 6/20/2021 at 9:00 PM, Forest-Ghost said: Does anyone know how to use the VectorToPoint function in urwigo? I am trying to build a reverse cache using just the bearing. I keep getting errors though. 14 hours ago, Delta68 said: I can't get it to work either. Passing a zone to a function or referencing a zone in a funtion always errors Can both of you post (or e-mail me) the source code of your cartridge? As of now the problem could be literally anything from "you've got a typo on line 100" to "a solar flare fried your computer"... Edited June 22, 2021 by Hügh Quote Link to comment
+Forest-Ghost Posted June 23, 2021 Share Posted June 23, 2021 (edited) I was able to get it working using Day1976's code from this post. I threw together a rough cartridge. You can download the urwigo file here: https://www.dropbox.com/s/7ezvqi5vgebwq7r/Reverse Bearing Wherigo.urwigo?dl=0 I'd be curious to see if anyone else has made a reverse bearing Wherigo and if they have any recommendations. I made a reverse Wherigo (showing only the distance) awhile back that took players to an obscure park that most people didn't know existed. The starting coordinates were almost 2 miles from the final. I would think with a bearing only Wherigo it might be better to set it up so that the player starts in a park and ends in the same park. Since there is only bearing, I could see it becoming a lot trickier to locate the cache if the starting location is really far away from the final. Edit: for anyone who wants to make a reverse bearing Wherigo without having to use code. day1976 uploaded an open source cartridge here. You can build the entire cartridge in the app. Edited June 23, 2021 by Forest-Ghost 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.