Author: beno_83au
Author Website:

Requirements: No addons required

Version: 2.1

Short description: Uses certain types of beds to have AI start a mission sleeping on them. AI can then be left asleep or woken up on command.

Date: 2018-06-18 15:54

Comments: (0)


MIL SleepingAI


Uses beds and other user-defined objects to have AI start a mission sleeping on them.
AI can then be left asleep or woken up on command.

- Predefined support for vanilla sleeping bags and sleeping mats, and the vanilla bed.
- Ability to define other objects as beds.

Installation / Usage:
For usage instructions and information of how to use the MIL SleepingAI please refer to the included documentation and/or example mission.

Demo mission:

- Copy the folder MIL_sleepingAI to your mission folder.

- Place a sleeping bag, mat, bed or other custom object into the mission.

- Position a unit near their required bed. They must be within 5m of the object to work.

- Run this command where the unit is local before the mission starts (e.g. initServer.sqf if created on the server, or init.sqf for SP):

nul = [_units,_otherBeds] execVM "MIL_SleepingAI\initSleepingAI.sqf";

_units - array - list of objects to start asleep.
_otherBeds - array (embedded) - list of other object classnames and their [x,y,z] offsets
- offset MUST be defined, and should be tested and adjusted for best positioning of AI.
- optional. Default - [].

nul = [units group1] execVM "MIL_SleepingAI\initSleepingAI.sqf";
_otherBeds = [
nul = [units group1,_otherBeds] execVM "MIL_SleepingAI\initSleepingAI.sqf";

- To wake the AI up, run this command:

nul = [_unit,_pos,_enableMoving] spawn MIL_fnc_WakeUp;

_unit - object - name given to the sleeping unit.
_pos - string - stance that the unit is to be in, example:
- "Up", "Middle", "Down", "NotProne" (uses either "Up" or "Middle"), "Auto" (normally the default AI setting).
- optional. Default - "Auto"
_enableMoving - boolean - allow AI to move from bed once woken up.
- optional. Default - false.
- NOTE - to get AI moving at a later stage, use:
- _unit enableAI "PATH"

nul = [unit1] spawn MIL_fnc_WakeUp; //setUnitPos "Auto" is used.
{nul = [_x,"NotProne"] spawn MIL_fnc_WakeUp;} forEach (units group1);
nul = [unit2,"Auto",true] spawn MIL_fnc_WakeUp;

Media: has its own Youtube channel where we will cover the Community made releases.
Subscribe to the Youtube channel

License / Disclaimer:
Use and abuse as required. Please just give credit for the original concept.

Added - Option to set rotation of AI on an object to account for the possibility that an object's "north point" would mean that the AI would end up sleeping perpendicular to (across) the object (Updated "To Use" and "Examples" in OP).
Added - Shooting mats and LoW stretchers to predefined bedding (Updated "Features" in OP).

Rebuild of the original function.


Forum topic:
- BI forums

Enable javascript to be able to download from Armaholic please!