Author Sticky: Post Working Scripts Here
Grundolt Posted: Sunday, 07 July 01:45AM
NAME: Name these yourself
WHAT IT DOES: This is my version of a recall stone.
NOTES: As these notes refer to things in the script that are too long for the "too long of a word error, they must also be placed in a script window, though they are notes, not scripts. BTW the too long of a word error filter thingy is stupid and you could never convince me that there is any good reason for having that limitation on a forum that talks about scripting.
NWScript:
I just scripted my own recall item.  It is a tent.  The item must be magical so that you can assignt the attribute CAST SPELL: UNIQUE ITEM SELF ONLY.  My implementation was for a "tent" item.  When The person right clicks on that item and chooses special ability unique item self only, it teleports them to the tent area.  When they exit the tent door, it teleports them back to where the used the item.  There are two scripts here, one in the module script event "OnItemActivated" and the other on the tent exit door script event "OnAreaTransitionClick".  In the tent is a bedroll tagged "BedRollTentEntry".  If you modify this script to tp you elsewhere, then just change the tag in the script to match the tag in the object to which your character will teleport.   The two scripts follow------
////////////////////////
//This script is in the module level OnActivateItem event.
//It will teleport the player to an item with the tag "BedRollTentEntry".
//To Use, there should be a tent area that has a bedroll with that tag.
//When used in conjunction with the TentExit Script (below)  it functions much like
//the Recall Stone in the official campaign, without the dialog and gold expenditure.
//CREATED BY: GRUNDOLT CHRYSANTHUS
///////////////////////
void main()
{
object oActivatedObject = GetItemActivated();
string sActivatedItemTag = GetTag(oActivatedObject);
if(sActivatedItemTag == "Tent")
    {
    object oDestination = GetObjectByTag("BedRollTentEntry");
    if(GetIsObjectValid(oDestination)==TRUE)
        {
        SetLocalLocation(GetItemActivator(),"MY_L_LOC_TENT",GetLocation(GetItemActivator()));
        object oClicker = GetItemActivator();
        AssignCommand(oClicker, ClearAllActions());
        AssignCommand(oClicker, JumpToObject(oDestination));
        AssignCommand(oClicker, ActionDoCommand(ClearAllActions()));
        }
    }
}
/////////////////////////////////
//This script goes on the door in the tent area, in the door's OnAreaTransitionClick event.
//It transitions the player to the place where he set up camp
//CREATED BY: GRUNDOLT CHRYSANTHUS
////////////////////////////////
void main()
{
object oEnterer=GetEnteringObject();
location lLoc=GetLocalLocation(oEnterer,"MY_L_LOC_TENT");
AssignCommand(oEnterer,ActionJumpToLocation(lLoc));
}



P.S. (hehe pardon that pun) By the way, this works perfectly.