I am a long time user of Gravity Forms and various add-ons. A pet project has come across my desk to see how far I can push the plugin.
I am creating a team-based adventure race using WordPress and Gravity Forms. (and yes I know there are lots of ready made treasure hunt / scavenger hunt apps out there - but this is more of a project to see what can be done with these systems).
I am after ideas! (Please note, I am not wanting to hire a custom coder - thats not what this is about).
Game: A team registers and is given map coordinates to start. Once there there will be a question about their location which triggers a evergreen countdown timer. They then have that amount of time to complete the race. They will be given two clues to two different locations (their choice). When they get to one of the locations again they confirm with a checkbox, then answer a question about the location. Only then do they get the next clues.
All of this I have built using basic conditional logic, pages and sections and a timer plugin.
Now - here is where I need the brains trust (you)! Hit me with some cool ideas of what we could do and how. I would love to include geolocation triggers. I would love to have them upload a photo of and auto check the location or match against an existing one.
I have thought about using hidden QR codes to trigger certain things and this is a possibility but what else?
Over to you - I will post updates on the project as it develops.
HTML Geolocation API Have them click a “check in” button, then use a little .js and php to populate your hidden lat and long field’s value, if they match the required numbers of conditional logic, display the rest of the form. Leaving in 3-4 decimal places should require them to be close to your determined place while allowing some ‘roaming’ space for the device location triangulation. 00.0001 to 00.0002 is about 11 meters apart.
What should happen - use the check in button and if the phone is in the correct position the next section appears using conditional logic.
I can generate the long and lat and use the conditional logic: if [long] starts with …
If I type in the lat and long directly then it works, bit by generating it using the button it doesnt work until you refresh or click into it.
Generating code:
Click the button to confirm your entire team are standing at the correct position. You may be asked for location permission on your device. Please allow this.
UPDATE: OK, so here is the project so far. its developed into a city wide game of monopoly using geo locations, tracking devices and a web app.
Players race to locations on a huge customised monopoly board in teams. When the team reaches a location (with specific location instructions) they use a check in button to check their latitude and longitude - if they are in the right position a file upload button appears with instructions to take a photo, upload it and submit. It gets sent immediately to a dedicated mailbox. Once the moderator running the race checks the photo they reply on the on page chat box to say they are either there first and have purchased the property or its already bought and they owe rent.
There is also a triggered popup box showing a Chance or community chest card at set times and a 2 hour countdown. Lots of other things. I would love to have a facility to overlay a photo so when they switch to their camera an outline overlays they have to match and take a photo. Can’t find a way though am trying.
OK, am getting somewhere with this project. SO far I have the above all tested and implemented. I am playing with WebAR and looking at having the contestants getting to the location and looking for a AR spinning Race card infront of the location.
Two issues: 1: I have a section that shows only when the contestants are in a certain position (checks long and lat to 4 places) but I also want a section that appears if they are NOT in position. But the there is no conditional logic that says “Does not start with…” - How do I go about this?
Next thing is I want it to score itself eventually so that a moderator doesn’t have to sit and keep score and communicate this back.
This is new territory for me but I guess as each form relates to one property, I could put a cost price against each form and using zapier alter an excel sheet keeping score, however how do I get it to check to see if the property has already been sold?
This is a really interesting project. Kudos on bringing it along as far as you have and sharing the progress.
Rather than altering an excel sheet, what if each property was a separate entry in a different “property” form. In that way, either the Gravity Forms Rest API could be used with a field that ensures unique by field value/validation to have one owner. And you could use the GFAPI to get entries to make a shortcode that displays the board/scores/etc.
Adding real-time data to the challenges so that if someone were playing the same board/game twice they might get different answers/experience?
Adding a roaming piece/player to the board that they need to find/avoid depending on consequences. Sort of a Where’s Waldo that could send them directly to jail or jackpot?
Depending on the complexity of your conditional logics, timers, etc. the way Gravity Flow allows you to limit display of fields or which are editable may be of value as the game scales up. Like, if you want to retro-fit the game to a different city/theme/group, how much rework will be involved? The Form Connector extension Update An Entry step type in particular as a way to have submission/events in one form trigger value updates in others. The Create New Entry step type would also let that conditional activity spawn new details the users need to respond to.
I will explore the first suggestion about GFAPI - that might solve a couple of issues.
As for the roaming piece - I like it. However we have a popup trigger that is activated by the moderators to popup a chance or community chest card at various times during the race which could be a Go To Jail or something.
I have used Gravity Flow before but what you mention is interesting. I’ll do some playing around and then come back with an update.
I must admit I am stumped by the API - not something I have ever used and I dont know where to start. Reading the documentation it looks like it can do things that make my life easier. Is there a step by step beginners guide?
Hi Jonathan. The GFAPI exposes functions on the same site as your Gravity Forms installation, and provides you with simple functions to access Gravity Forms data that are future proof (unlike direct database calls.)
There is not much more to getting entries than this which Jamie linked to previously: