JumpToLocation

From NWN Lexicon
Jump to: navigation, search



JumpToLocation(location)

This is a command to move instantly to the location referenced by lLocation.

void JumpToLocation(
    location locDestination
);

Parameters

locDestination


Description

This is a command, thus it is only valid when used in a AssignCommand(object oObject, JumpToLocation(locLocation)); call. This command is then put in the top of the referenced objects command queue, causing the object to immediately jump to the specified location. The action is added to the TOP of the action queue.



Remarks

Even though this command should appear at the top of the action queue, it might be a good idea to clear all of the intended target's actions first with ClearAllActions().

When a PC leaves an Area or Trigger because you've jumped to a location causes the OnExit event of the departed object to fire.

Does not affect creatures that are dead; they must have HP above 0 for this function to work properly.


Version

1.29

Example

void main()
{
   object oPC = GetFirstPC();
   object oArea = GetArea(OBJECT_SELF);
   vector vPosition = Vector(20.0, 20.0, 0.0);
   float fAngle = 90.0;
   location locTarget = Location(oArea, vPosition, fAngle);
   AssignCommand(oPC, JumpToLocation(locTarget)); 
}

See Also

functions: 

JumpToObject



 author: Michael Nork, editor: Charles Feduke, additional contributor(s): Barry, Enigmatic, Chris MacKenzie