Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

relative geotriggers

Hi everyone,

In an earlier thread, I received some great advice and help about how to build geotriggers for passages. In that case, the triggers were absolute (and tripped when I had the player 'rescan', rather than constantly checking for position; a constant check might be a better approach, but I'll leave that to someone else to explore).

Now, I'm wondering about relative geotriggers. I'm an archaeologist. What I have in mind is say a game played in a big empty field (a local park, say). The story would load and take the player's initial position as the benchmark. Then, passages would trigger relative to that original benchmark. The game would tell the story of a particular excavation, so moving around the field would move the player around a relative version of the excavation's original layout. (A number of excavations have APIs for their databases, so someday in the future I'd like to generate the story drawing directly from the API, but that's a task beyond me at the moment).

So using the geotrigger javascript from the previous thread, I'm thinking of this flow to set up relative triggers

1. at story initialization, pass the player's latitude, longitude to a 'benchmark' variable
2. in the story initialization, have my points of interest set up with latitude and longitude values that are x and y metres plus / minus from the benchmark:
<<set $atriumlat = 0.000551>>
<<set $atriumlong = -0.000910>>
3. then a code block that would create the relative geotrigger by adding $benchmarklat to $atriumlat to create $atriumlattrigger, and ditto for longitude

... and then progress as per normal, comparing the player's position to $atriumlattrigger etc to reveal the passage (with audio, embedded 3d files, what-have-you).

I think this should work?
Sign In or Register to comment.