Author: Millenwise (beno_83au)
Author Website:

Requirements: No addons required

Version: 1.0

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: 2017-07-16 10:46


Comments: (0)
Rating:



 

AI Sleeping and Waking Up Function

by
Millenwise (beno_83au)


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.


Features:
- SP/MP
- Supports vanilla sleeping bags and sleeping mats.


Installation / Usage:
For usage instructions and information of how to use the AI Sleeping and Waking Up Function please refer to the included documentation and/or example mission.

Copy the folder MIL_sleepingAI to your mission folder.
- Place a sleeping bag or sleeping mat into the mission.
- Position a unit near their bag/mat.
- Run this command anywhere (e.g. initServer.sqf) before the mission starts:
nul = [] execVM "MIL_sleepingAI\init.sqf";

- To start the AI sleeping, run this command:
nul = [_unit] spawn MIL_fnc_startAsleep;
_unit - object - name given to the sleeping unit.

Examples:
waitUntil {!isNil "MIL_fnc_startAsleep"};
nul = [unit01] spawn MIL_fnc_startAsleep;
waitUntil {!isNil "MIL_fnc_startAsleep"};
{nul = [_x] spawn MIL_fnc_startAsleep;} forEach (units sleepingGroup);

- To wake the AI up, run this command:
nul = [_unit,_pos] 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).
- default - "Auto"
Examples:
nul = [unit01,"Up"] spawn MIL_fnc_wakeUp;
{nul = [_x,"Auto"] spawn MIL_fnc_wakeUp;} forEach (units sleepingGroup);
nul = [unit01] spawn MIL_fnc_wakeUp; //setUnitPos "Auto" is used.


Media:



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


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


Changelog:
v1.0


Forum topic:
- BI forums




Enable javascript to be able to download from Armaholic please!