Scavenger Hunt Bot

Download the scavenger hunt files here.

Creating your own Scavenger Hunt game is easy, using this Magsbot program.

PLEASE DO NOT TELEGRAM ME WITH QUESTIONS or asking me to explain everything that is already explained below! If you have problems with setting up the game, then EMAIL ME and I'll be glad to help as soon as I can! :)

Version

Make sure you are using Magsbot 3.1.11 or later.

How the Game Works

Players talk to the bot who tells them the list of objects to find, somewhere in the world. The bot will also give hints to the players when they ask for them. When a player finds one of the objects, they click on it to "pick it up."  When any player successfully finds and returns all the objects to the bot, that player is the winner.

The Story

An interesting game depends a lot on the story you create for the game. The original scavenger hunt in A'tuin was a Halloween-themed game in which players collected items for Hagsbot the witch to make her Halloween brew. Her invisible familiar Tickles supervised the hunt and told players when they picked up the right object. To return a found item to Hags, players clicked on her cauldron.  The next version of the scavenger hunt was the Treasure Hunt 2 in A'tuin, where players searched for keys with which to open the fabled Twelve Lock Box of pirate treasure. In that game, Long John Silver was the "referee" that gave clues and his parrot Polly was the "monitor" bot that told players when they found a key.

In the simpler version here, only one bot is needed but ideally runs in "global" mode, in which case the bot owner must have world caretaker rights. (Or, you can just keep the hunt within a smaller area so that a non-global bot can detect all the player clicks on items.) Also in this version, there is no "dropoff" object that players need to click to deliver items; instead a player only needs to collect all the items in order to win immediately.

However, some new features have been added, as explained below, that will allow you to add complexity to the game if desired. Future versions will add even more capabilities.

Installation

Download the latest Magsbot from my web site and unzip it into a new folder. You can then unzip the scavenger hunt files into the same folder, OR (recommended for easier upgrading in the future) unzip the scavenger hunt files into a different folder, then right click and drag MBot.exe from the Magsbot folder into the scavenger hunt folder to create a shortcut. Right click on the new shortcut and edit the Properties so that the "Start In" path points to the scavenger hunt folder instead of the Magsbot folder. Now when you click the shortcut to run Magsbot, it will run MBot.exe from the Magsbot folder but use the files in the scavenger hunt folder. When you upgrade in the future, you can unzip new versions of Magsbot into the Magsbot folder without overwriting your scavenger hunt files.

If you put the scavenger hunt files in their own folder, also copy behavior.beh, buttons.btn, userdefs.udf and magsbot.ini from the Magsbot folder into the scavenger hunt folder.

Next you need to edit userdefs.udf using notepad, in order to customize your game. Add the following lines to userdefs.udf:

; put the name that you will give the bot here
$referee="YourBotName"

; if you're able to run in global mode,
; define the color to use for console messages here:
@aclr=@dec["008888"]

; the number of 0's and 1's, respectively, in these lines
; must exactly match the number of items you will use in your game:
; this should be all 0's:
$items0="000000000000"
; this line defines the items that must be found to win the game:
; this would normally be all 1's:
$win="111111111111"

  • Database Files

  •  

     

    This version of the scavenger hunt game uses a database to keep track of players and also for you to set up the items, hints and other conditions for the game.  To use the database features of Magsbot, you need to have ADO installed on your computer. If you have Windows XP, then ADO is probably already installed. If not, you may need to get ADO from Microsoft's web site (don't worry, it's free!) and install it. (You can use this utility to find out what version of ADO you have on your computer, if any.)

    Once ADO is installed, edit magsbot.ini using notepad and set ADO= in the [Database] section of the file according to the version of ADO you have. (For instance, if you're using ADO 2.5 then you should have ADO=3 in magsbot.ini. The numbers to use are shown in magsbot.ini as comments.)
     

  • Behavior Table and Custom Buttons

  •  

     

    Next you should merge the scavenger hunt behavior and button files with the standard Magsbot behavior table and buttons.

    To do this, run Magsbot and click on the menu item File/Action Buttons/Merge Action Buttons... and choose scavhunt.btn on the file open dialog that appears. The scavenger hunt buttons will be added to the Actions panel as a new category tab. Press F7 to save the new buttons.

    Then use menu File/Behavior/Load Behaviors... and choose scavhunt.beh on the file open dialog.  Next add the standard behavior table back in by using the menu File/Behavior/Merge Behaviors... and choose behavior.beh from the file open dialog. Finally choose File/Behavior/Save Behaviors As... and choose behavior.beh, to save the combined behaviors.

    Now you're ready to begin creating your game.

    Setting up the game

    The scavenger hunt game uses a MS Access database, scavhunt.mdb, containing two tables, Players and QuestItems. To view either table, click either Select player database or Select items database on the ScavHunt tab or the Actions panel, then press Shift-F3 to see the database window.  Help with database navigation can be found in the main Magsbot documentation.

    The Players table contains player name, ID (citizen number) and other information recorded as an avatar arrives in the bot's vicinity. It also contains a string of 0's and 1's representing which items the player has found, and a true/false field that indicates if the person has joined the game or not.

    The QuestItems table contains all the information for the items that players will search for. It contains the following fields (double-click on a field to edit it):

    I've included the QuestItems data from the A'tuin Treasure Hunt 2 to give you an idea of what should go in each field. Once you're ready to enter your own data, you can click the "clear quest items" button on the ScavHunt tab of the Actions panel to clear the database.

    Note that item keys should be numbered starting with 0 for the first item, and so forth.

    Besides the database, you should edit two text files, Intro.txt and Help.txt, in the scavenger hunt folder. The Intro.txt folder should contain a brief introduction to the game, describing the story and what players need to do to win. The Help.txt file should contain a shorter description, just enough to give potential players an idea of what the game is about.

    Creating the objects

    Once the database is set up, you need to create the objects in your world. To tag an object as a quest item, simply put qkey=n in the action field of the object when you create it in the AW browser. The n represents the ID of the object, like qkey=12. (But sure to add the qkey tag as the last thing in the action field, to avoid interfering with normal object actions.)

    It will make your game more fun and interesting if people need to figure out some puzzle before they can grab the item. For instance, in the A'tuin Treasure Hunt 2 game, one of the keys requires the player to figure out a way to get past a barrier of flames before they can touch the key. You can set up this sort of thing using invisible objects and the usual AW commands like activate solid off and so on.

    It's a good idea to put activate visible off on quest items too, so that they disappear when the user clicks them. (You could have the bot delete the object by putting the command OBJECTDELETE @objnum @atr[object_z] @atr[object_x] in the item's action field in the database, but you will probably want the object to remain there for other players to click. Even if you do have the bot delete the object, the activate visible off is a good idea so the object will disappear instantly, before the bot actually deletes it a moment later.)

    Starting it up

    To start up the scavenger hunt bot, first delete any instance that was automatically created when you started Magsbot. Enter the desired world and location on the Location panel. Then use the menu Connection/New Instance... to create a new instance with the name you prefer (the bot should have the same name as you put for $referee= in the userdefs.udf file).  If you are a world caretaker, then check the "Global Mode" box on the New Instance dialog; that will allow the bot to detect clicks throughout the entire world, and to use color console messages. If you aren't a caretaker, then the bot will only be able to detect clicks nearby the bot, and will whisper to players instead of using console messages. Click Ok and bot instance will be created.

    Once you have the instance running and positioned properly, press Shift-F11 to save the configuration so the bot will start up in the same location next time.

    Operation

    Besides maintaining player data, the scavenger hunt bot will also respond to chat commands HELP, GAME, PLAY, LIST, HINT and WINNERS.

    HELP: Whispers a brief explanation of the game commands.
    PLAY: Non-players use this command to join the game.
    GAME: Causes the bot to repeat the game introduction.
    LIST: Players use this command to see what items they still need to find.
    HINT: Players can whisper HINT itemname to have the bot reply with the hint corresponding to the stated item.
    WINNER: Causes the bot to list the names of people who have won the game.
    Clicking on the bot itself will have the same effect as saying HELP.

    Clicking on a quest item will cause the item to be added to the player's inventory (if the item requirement is met), and the item action to be performed and item comment to be whispered or announced by the bot. If the player has all the items needed to win, the bot will announce that the player has won and add them to the winners list.

    Conclusion

    That's it! Hopefully you won't find it too difficult. I'd be very interested in hearing about the game you create with Magsbot. :) If you EMAIL me I will put you on my Scavenger Hunt mailing list and send you any information regarding updates to the Scavenger Hunt scripts.

    And remember:

    PLEASE DO NOT TELEGRAM ME WITH QUESTIONS but instead please do EMAIL ME and I'll be glad to help as soon as I can! :)

    Good luck and have fun! :)

    -Magine

    December 29, 2002