GetPosition
From NWN Lexicon
Jump to navigationJump to search
GetPosition(object)
Determines the position of a creature or object.
Parameters
oTarget
Description
Returns the position (as a vector) of oTarget.
If oTarget is invalid or on other errors this function returns the vector (0.0f, 0.0f, 0.0f).
Version
1.61
Example
//Make the entering PC jump to the corresponding position
//in a different area
void main()
{
object oPC=GetEnteringObject();
if (!GetIsPC(oPC)) return;
vector vPos=GetPosition(oPC);
float fFacing=GetFacing(oPC);
//Create a location in another area
//"OTHER_AREA" is the tag of that other area
object oArea=GetObjectByTag("OTHER_AREA");
location lNew=Location(oArea, vPos, fFacing);
AssignCommand(oPC, JumpToLocation(lNew));
}
//in a different area
void main()
{
object oPC=GetEnteringObject();
if (!GetIsPC(oPC)) return;
vector vPos=GetPosition(oPC);
float fFacing=GetFacing(oPC);
//Create a location in another area
//"OTHER_AREA" is the tag of that other area
object oArea=GetObjectByTag("OTHER_AREA");
location lNew=Location(oArea, vPos, fFacing);
AssignCommand(oPC, JumpToLocation(lNew));
}
See Also
functions: |
author: Tom Cassiotis, editor: Lilac Soul