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)
Rating:



 







MIL SleepingAI

by
beno_83au


Description:
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.


Features:
- SP/MP
- 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: https://www.dropbox.com/s/i7okxd053jkkgkh/MIL_SleepingAI.Malden.pbo?dl=0

- 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 - [].
Examples:

nul = [units group1] execVM "MIL_SleepingAI\initSleepingAI.sqf";
_otherBeds = [
["Land_Stretcher_01_F",[0,0,0]],
["Land_WoodenTable_large_F",[0,0,0]]
];
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"
Examples:

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:



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:
v2.1
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).

v2.0
Rebuild of the original function.

v1.0


Forum topic:
- BI forums




Enable javascript to be able to download from Armaholic please!