This is a template script to help people create their scripts for tag based items when only item activation needs custom behavior (a fairly common case). The template includes all the necessary interface instructions (like finding the item in question and setting the executed script return value), allowing the scripter to focus on what needs to be done. This is a simplified version of my Tag-based Template, with the events other than activation removed and the remaining code merged into the main() function. This should make the template less intimidating for beginning scripters who are only interested in handling the OnActivate event anyway.
The basic way to use this is to copy it to your script (named for the item's tag), then add your code where indicated (near the bottom of the script, but before the closing curly brace). Variables representing the item activated, the character activating the item, the object targeted, and the location targeted are defined at that point so you do not have to worry about how to find them.
The primary intended audience for this are those who are have taken a step beyond the script generator, or at least are willing to take that step. (A "step" would include just being able to copy the insides of a generated script into another script and deal with resolving variable names as needed.) An understanding of what variables are and how they are used would be useful, but the ability to write a script from scratch is not strictly necessary.
It occurred to me that my full-blown template might be intimidating to some and that the vast majority of tag-based items probably only handle activation, so I thought I would post this in case someone might find it helpful.
Nov 13, 2010 -- renamed the "oTarget" and "lTarget" variables for better compatibility with scripts originating with the Script Generator