I am working on a geo-referenced tour project that lets travelers see the various facets (wildlife, ecology, etc.) of a location as they walk a trail.
The overall goal is for the interpreter to automatically update the user’s session when their position (rounded to two decimal places) matches the coordinates listed as TADS3 rooms (probably defined as a ‘case statement’).
Here’s the pseudo code:
switch position case(lat = -122.65 && lon = 45.63) me.scriptedTravelTo(room_one); case(lat = -122.78 && lon = 45.72) me.scriptedTravelTo(room_two); ...
So far the project is going well but I’m having trouble passing regular GPS position updates to TADS3 for processing.
Here’s what the GPS daemon file looks like (I’m using the DefineAction simply for testing, this will, of course, be a daemon in the production version):
Your current position is:
Latitude : 44.53651190000001
More or less 1449513 meters.
(The ‘1449513 meters’ accuracy is as a result of the position getting taken by my IP address rather than an actual GPS fix)
There are, however, a couple of problems with this approach.
First, there seems to be no way that I can see to pass the position to TADS3 by any means as a) the ‘crd.latitude’ and ‘crd.longitude’ variables are local, not global for use in other functions.
Overall, either using webscrptres or not (though I confess that I like the elegance of using this method), how can I have TADS3 monitor geolocation objects and act to move the interactor to the appropriate location accordingly?