Jump to content

Author Script Index


Ranger Fox

Recommended Posts

Are you looking to add some additional functionality to your cartridge? Have you created something you'd like to share with the community? Author Scripts are custom code you can add to your cartridge by hand to do things beyond the Builder. As a community, we want to increase what's possible with Wherigo. To do that, we're creating, sharing, and improving custom scripts you can use in your own cartridge.

 

Anyone can contribute to this author script effort! Obviously, if you're into programming or scripting, you can build and submit scripts and add functionality to others'. If programming isn't your style, there are other ways to contribute! Consider commenting on the submitted scripts and suggesting features or ways they can be improved. Ask questions. Suggest ideas for what you'd like to see Wherigo do in the future! Challenge your community members! Play the cartridges built with those scripts, either in the field or the Emulator. Feedback is extremely important to this process and moving Wherigo in a direction you want. With more feedback comes more entertaining, exciting, and creative cartridges. If you can draw, consider teaming up with someone who can program.

 

-----------

 

This thread is an index to author scripts posted to this forum. It is meant as a way for people to search and find links to author scripts they are interested in using in their cartridge. Author scripts both large and small are welcome. As this is only an index, please post script revisions and comments in the script's linked thread.

 

Submitting - When you have an author script you'd like to submit, please create a thread for it. Introduce your script, name it (so it's easier to tell others about), describe what it does and how to use and include it, and attach the script as a zip file (zips are the only allowed extension). Once you have posted your thread, please make a fairly short post to this Author Script Index thread so it's added to the index.

 

Posting to this thread - Since this is an index and we're trying to keep it clean, please post script commentary inside the appropriate script's thread (commentary here will be removed), including new versions, revisions, questions, comments, usage suggestions, and additional features. When announcing your author script, please follow the same posting pattern. Doing so helps others when they're scanning the posts for a script they could use. This pattern will change over time to suit community needs, so please take some time to look at the last few posts before you post to this thread. For now, this is what I'm suggesting:

Script Name: ZoneMover

Author: Ranger Fox

 

Purpose: Moves zones along a set of user-defined coordinates. Supports pausing, reversing, and looping. Object-oriented.

 

Description: Using the ZoneMover and its ZMPoint classes, you can make zones emulate objects moving in real-time, such as vehicles, people, rolling boulders, etc. It is object-oriented and the code includes constructors so you can create these objects with ease and, if needed, store them in an array. You can set functions to execute after any one move to a point is complete or even when the zone has been moved to the last coordinate.

 

Thread Link: forums.Groundspeak.com/ ... ... (You'd put the link here)

 

Discussing and Updating Scripts: Please keep discussion about scripts in that script's thread. All script authors should be open to suggestions and some form of critique. As with other areas in the forum, please be respectful in your posts! Everyone has worked hard and for hours on end to create something they believe would benefit the community and, ultimately, your Wherigo experience. Everyone is entitled to his or her own opinion as well as the respect of others. While you might not be able to use a script or feature in your cartridge, there's always some use or the author would not have put the time in to make it available.

 

All script authors should be prepared for someone in the community to make suggestions by means of updating the submitted script. Someone may like where you're going and want to add a new feature or perhaps there was a bug someone thought they'd help fix. But what if, perhaps, you posted your script as a preview, all the planned features haven't been built into it, or you'd like to be the one, for now, making all the changes? If you would rather not have others post modified versions of your script to your thread, please politely discourage it in your thread's post.

 

-----------

 

Did I miss anything in this introduction? Should I add something here? If you'd like to discuss this thread, please post here.

Link to comment

Script Name: Item Container

Author: charlenni

 

Purpose: You can put items in a container: lock, unlock, open, or close the container. If the container is moved, all items will be moved as well. This code is in a module; add it via a "require" statement in your cartridge.

 

Description: You could put item(s) or character(s) in this container and remove them. You could lock (automaticaly closed), unlock, open (only if unlocked) and close the container. You could check if an item belongs to the container, if it is visible and how much item(s) belongs to the container. If you move the container, all item(s) will be moved with the container. The item(s) in the container could be visible or not, but if the container is closed, than all item(s) belonging to the container are unvisible. If the container opens than the items will be visible if they was visible before (unvisible items are further unvisible even if the container is open) If there are any changes to the container you can get a messages: OnChanged(What), OnAddItem(Item), OnRemoveItem(Item), OnItemVisible(Item).

 

Thread Link: Module for Container, Author Script Library

Link to comment

Script Name: MessageBox/Dialog enhancement

Author: matejcik

 

Purpose: simplify a common task of "show a series of messages, then ask a question".

 

Description: Changes behavior of built-in function for showing Dialogs, so that they don't cancel each other. That means that without writing any Lua code, you can put the whole conversation ending in a question into a single script, without the tedious task of showing each message in the button script for the previous one.

There are some nuances to using it properly, see the thread for detailed description.

 

Thread Link: http://forums.Groundspeak.com/GC/index.php?showtopic=214105

Link to comment

Script Name: Default commands

Author: charlenni

 

Purpose: add default commands for items.

 

Description: the appended Lua script add functionality for normal items. Each item need scripts to add a take and a drop command with scripts. For most of this items, this script installs defaults. You could also add other commands very easy. Copy the functions to your author script section.

 

function AddDefaultCommands(CartridgeFile,OptionalItemTable)

Add the commands "Take" and "Drop" to each item in the cartridge or to each item listed in "OptionalItemTable" (example: {zitemItem1,zitemItem2}). If the item already have a command with this name, the command will not overwritten. So you can make your special "Take" and "Drop" scripts with the builder. You need also the functions "TakeItem" (called on OnTake), "DropItem" (called on OnDrop) and GetActiveZone (called from DropItem to get a zone, if you are not in a zone, you get a message, that you couldn't drop the item)

 

function AddCommand(CartridgeFile,Command,Enabled,Function,OptionalItemTable)

Add the command "Command" (example: "Lock") with state enabled as "Enabled" (true) to all items in the cartridge or to all item in OptionalItemTable (example: {zitemItem1}). If then event OnCommand (example: OnLock) occures, the function "Function (example: "LockItem", string) will be called.

 

Thread Link: http://forums.Groundspeak.com/GC/index.php?showtopic=214580

Link to comment

Script Name: ZoneListLimiter

Author: cantuland

 

Purpose: Work around the limitations of a Garmin Oregon where an Oregon won't show more than 10 active zones without crashing.

 

Description: PlayAnywhere. As the player moves around, the unit will display the NEAREST zones on the list, limiting the number of zones displayed to a pre-established number picked out by the cartridge writer. As the player moves from one zone to another, some zones will become farther away than other zones that will become closer, so the list changes to "shut off" the zones when they become farther and "turn on" the zones that become closer.

 

If the player wants to visit zones on opposite sides of the "play area", then they can go get one zone on one side of the play area, skip all the other close ones and go visit another zone clear on the other side of the play area and get that one, then maybe get another zone anywhere else as they head home and find a zone on the way. All the while, as they move around, they can see the closest zones. Although they can't really see ALL the zones at one time, they CAN deal with all of them in any order they want; they just have to deal with a "limited list of zones", hence the name ZoneListLimiter.

 

Lots of other code ideas are included to help test the ZoneListLimiter, such as showing menus with ITEM object manipulation rather than Wherigo INPUT objects. Later, I put in the INPUT objects anyway to track down a bug that ended up not being in the ITEMized options, so both methods are there for a side-by-side comparison. There is a small piece that demonstrates a possible WAIT feature, but it was commented out and replaced with different code because I suspected that it could have been causing a problem. At certain points it did work though. The main goal was the ZoneListLimiter, but other things were added here and there. Check it out, source code available for the betterment of future Wherigo cartridges everywhere.

 

Thread Link: http://forums.Groundspeak.com/GC/index.php...d=3966494

Edited by cantuland
Link to comment

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...