Useful Generic Scripts

Forum for scripters of NWN material and third party applications.
Post Reply
Mistcaller
Groundling
Posts: 137
Joined: Tue Nov 25, 2003 7:29 am
Location: Avlis Team - Tairis'nadur Team

Useful Generic Scripts

Post by Mistcaller » Wed Feb 02, 2005 8:16 pm

Here we can post generic scripts that are commonly used among servers. I'll start with the most popular one :) :

1. Jump PC to a waypoint (Placeable OnUsed)

Code: Select all

//:://///////////////////////////////////////////// 
//:: Name     jump_pc_2wp 
//:: FileName jump_pc_2wp.nss 
//:: Copyright (c) 2001 Bioware Corp. 
//::////////////////////////////////////////////// 
/*   When a PC uses the placeable, it teleports him to a destination waypoint 
with tag: WP_<tag of placeable> 
*/ 
//::////////////////////////////////////////////// 
//:: Created By: Mistcaller 
//:: Created On: November 11, 2003 
//::////////////////////////////////////////////// 
void main() 
{ 
  string sExplanation = GetLocalString(OBJECT_SELF,"sExplanation"); 
  object oPC=GetLastUsedBy(); 
  string sTempTag = GetTag(OBJECT_SELF); 
  object oTarget = GetObjectByTag("WP_"+ sTempTag); 

  if (GetIsObjectValid(oTarget)) 
{ 
     ClearAllActions(); 
     AssignCommand(oPC, JumpToObject(oTarget)); 
     if (sExplanation !="") 
        SendMessageToPC(oPC, sExplanation); 
  } 
}

Post Reply