+Tequila Posted January 10, 2009 Share Posted January 10, 2009 I am trying to create an adventure where two geocachers will have to cooperate with each other to finish a cartridge and find a physical geocache. One will start at the south end of a 10 km trail and the other will start at the north end. For each player to move forward to the next zone, they will need to get a code from the other player. When they are finished, they can drive each other's car to the final physical cache. I can do all of that no problem. What I am trying to avoid is having future players get the codes from a previous player and bypassing the "working together" aspect. My thought is to somehow change the codes each time based on the date (or day of the month) the cartridge is played. Two questions: Is there a way of getting the date (or day of the month) from the Player/GPS? Does anyone have a better suggestion to accomplish my goal? Thanks. C Quote Link to comment
matejcik Posted January 10, 2009 Share Posted January 10, 2009 this is a wonderful idea :e) to answer your first question: yes, you can work with date/time in Wherigo, see this chapter from Programming in Lua: http://www.lua.org/pil/22.1.html about other solutions: - there's a field in the Env table, Env.Downloaded, which holds a download date (see http://wherigobuilder.wikispaces.com/Env+table+values for details). you may want to use that and only allow players to cooperate if they downloaded the cartridge on the same day. i don't think it's better, just something you might think about. - more secure, but also probably more difficult approach: you could generate a random number at start, or use the cartridge completion code, and "seed" the code for the other player with that - and on each code exchange verify that the other player's code still carries the correct seed. very simple example: let's say that codes for player one (those that he gives to player two) are AAA, BBB, CCC, and player two's codes are DDD, EEE, FFF. also, player one's completion code is X1Y2Z, and player two's completion code is M6N7O on first exchange, player one gives player two code AAAX - first three letters of the code and first letter of the completion code. on second exchange, player two gives player one code DDDXM - first three letters of the code, player one's letter back, and his own letter from completion code. now player one verifies that the letter on position 4 is really his letter, and if it isn't, then the code is considered invalid. Quote Link to comment
+Tequila Posted January 10, 2009 Author Share Posted January 10, 2009 I forgot to mention that I am not a LUA programmer. I am pretty much stuck to using the Builder or creating a simple Author script. Quote Link to comment
+Tequila Posted January 10, 2009 Author Share Posted January 10, 2009 this is a wonderful idea :e) to answer your first question: yes, you can work with date/time in Wherigo, see this chapter from Programming in Lua: http://www.lua.org/pil/22.1.html about other solutions: - there's a field in the Env table, Env.Downloaded, which holds a download date (see http://wherigobuilder.wikispaces.com/Env+table+values for details). you may want to use that and only allow players to cooperate if they downloaded the cartridge on the same day. i don't think it's better, just something you might think about. - more secure, but also probably more difficult approach: you could generate a random number at start, or use the cartridge completion code, and "seed" the code for the other player with that - and on each code exchange verify that the other player's code still carries the correct seed. very simple example: let's say that codes for player one (those that he gives to player two) are AAA, BBB, CCC, and player two's codes are DDD, EEE, FFF. also, player one's completion code is X1Y2Z, and player two's completion code is M6N7O on first exchange, player one gives player two code AAAX - first three letters of the code and first letter of the completion code. on second exchange, player two gives player one code DDDXM - first three letters of the code, player one's letter back, and his own letter from completion code. now player one verifies that the letter on position 4 is really his letter, and if it isn't, then the code is considered invalid. Nothing like walking the dog in -7 weather to clear the mind. Your idea should work. Hopefully the completion code is unique to each player. If I have the two players swap their completion codes, I can then check subsequent input against the player's code (not what they typed in - this will prevent some bright stick from faking the codes). At each stage I can generate a quasi random number by testing for the range where their completion code fits. For example if CC < 2500, use 1, if 2501 < CC < 5000 use 2.... etc. Can anyone confirm how many digits are in a completion code and is it consistent? Thanks. Quote Link to comment
matejcik Posted January 11, 2009 Share Posted January 11, 2009 from what i've seen so far, the completion code has 5 to 6 characters and that can be numbers and letters as well. i'd write a function to convert CC to number, but it's already too late 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.