GetTransitionTarget(object)

Gets the associated transitional target.

object GetTransitionTarget(
    object oTransition
);

Parameters

oTransition

Transitional object to return the target of.


Description

Returns the destination (a waypoint or a door) for a trigger or a door.
Returns OBJECT_INVALID if oTransition is not a valid trigger or door.



Remarks

If you place a script in the OnAreaTransitionClick of a door or the OnClick of a transition trigger, that script will override the transition. You can then use GetTransitionTarget to get the destination target of the transition, without having to hardcode it in the script (for instance, you might change the destination of a door, and then you won't have to remember to update the script as well).

The target is the object declared in the properties of the trigger/door, which normally is added via. a wizard and map system included there.


Known Bugs

1.64: Fixed problem with GetTransitionTarget() scripting command returning a random valid object ID if the destination on the trigger did not exist. It will now return OBJECT_INVALID in this case.


Version

1.64

Example

// We float some text - the next name of the area the target of this
// door is in, before delaying moving them to the target.

void main()
{
    // Declare who is moving, and the target.
    object oClicker = GetClickingObject();
    object oTarget = GetTransitionTarget(OBJECT_SELF);

    // Float the name of the target's area above the PC's head
    FloatingTextStringOnCreature(GetName(GetArea(oTarget)), oClicker, FALSE);

    // Delay moving them to the target
    DelayCommand(3.0, AssignCommand(oClicker, JumpToObject(oTarget)));
}

See Also

categories: Get Data from Object Functions | Movement Functions


 author: Charles Feduke, editor: Jasperre, additional contributor(s): Jeremy Sager, Lilac Soul, Jasperre