Teleport - Theseus-Aegis/MissionTemplate GitHub Wiki
This page will explain the usage of the Teleport function.
/*
* Author: Rory, Jonpas, Mike
* Teleports the player from base (this) to teleport locations (objects).
* Condition to show teleport action can be set.
* Call from initPlayerLocal.sqf
*
* Arguments:
* 0: Interaction object <OBJECT>
* 1: Teleport target object <OBJECT>
* 2: Teleport target display name <STRING>
* 3: Condition <CODE> (default: {true})
* 4: Icon Path <STRING> (default: "")
*
* Return Value:
* None
*
* Example:
* [tpObj, tpPos, "Teleport"] call MFUNC(teleport)
* [tpObj, tpPos, "Teleport", {TAC_Example}] call MFUNC(teleport)
*/
This function adds an ACE Action to an object, allowing you to teleport to a specified position of an object.
This function works well using invisible helipads. One as a helper object on a door. Another as the actual position to move to.
Teleports can also be blocked by toggling a variable or inputting code that returns a bool. In the example below for this the first example uses a check for a unit to be alive, the other is checking if an object is not alive. (This can be changed by picking it up)
Note: This function is considered "one-way" so if you want a return teleport the other side must have a setup there too.
Call from initPlayerLocal.sqf
Example:
[Action_Object_1, Position_Object_2, "Climb to Roof"] call MFUNC(teleport);
[Action_Object_2, Position_Object_1, "Go back to Ground"] call MFUNC(teleport);
Condition Example:
[Action_Object_1, Position_Object_2, "Climb to Roof", {alive My_Unit}] call MFUNC(teleport);
[Action_Object_2, Position_Object_1, "Go back to Ground", {!alive KeyToPickup}] call MFUNC(teleport);