Skip to content

Set Sleeping

Mike-MF edited this page Aug 10, 2023 · 1 revision

This page will explain the usage of the set sleeping function.


/*
 * Author: Josh, Mike
 * Sets units in a sleeping animation, alternative call to wake them up.
 * Only the first argument is required to put units asleep.
 * The other arguments are used for waking up units, if you want an immediate transition set time to -1.
 *
 * Call from init.sqf or globally from a trigger.
 *
 * Arguments:
 * 0: Group <Group>
 * 1: Asleep <BOOL> (default: true)
 * 2: Time <NUMBER> (default: 0)
 *
 * Return Value:
 * None
 *
 * Example:
 * [MyGroup] call MFUNC(setSleeping)
 * [MyGroup, false, 5] call MFUNC(setSleeping)
 */

Usage

This function will simulate AI that are asleep, it will set an animation on a group of units and will do the same for waking up, which can also be staggered.

The staggered wakeup by default will take 7 seconds for a group of 8.

Call from init.sqf or Globally from a trigger.

Example:

[MyGroup] call MFUNC(setSleeping);

This example will set the units asleep.

Wakeup Example:

[MyGroup, false, 0] call TAC_Mission_fnc_setSleeping;

This example will wake up the units with a second delay between each.

If you wish no delay between units waking up change the third parameter to -1

Clone this wiki locally