Skip to content
10Dozen edited this page Mar 27, 2018 · 9 revisions

You can set specific DynAI behavior for editor-placed units (indoor for infantries, vehicle hold for vehicles).

Adding Unit Behavior

There are 2 behaviours available:

  • "indoor"
    (infantry will hold his position and will turn around looking for a targets; if hostiles are detected in close range - infantry may rush to fight hostiles)
  • "vehicle hold"
    (vehicle will hold it's position, gunner and commander will scan horizon; if hostiles detected - vehicle will not hold it's position and will step in fight according to Arma3 AI FSMs)
  • "vehicle 45 hold"
    (vehicle will hold it's position, gunner and commander will scan horizon in +-45 degrees in front of the vehicle; if hostiles detected - vehicle will not hold it's position and will step in fight according to Arma3 AI FSMs)
  • "vehicle 90 hold"
    (vehicle will hold it's position, gunner and commander will scan horizon in +-90 degrees in front of the vehicle; if hostiles detected - vehicle will not hold it's position and will step in fight according to Arma3 AI FSMs)
Set Unit Variable

Add next code to unit's init in the editor (e.g. for "indoor" behavior): this setVariable ["dzn_dynai_setBehavior", "indoor"]; It's enough to set variable to single unit from group.

Synchronize with GameLogic

Place GameLogic object and add next code to it's init in the editor: this setVariable ["dzn_dynai_setBehavior", "vehicle hold"]; Now synchronize all units you want apply behavior to with this GameLogic. It's enough to synchronize single unit from group.

API call

[@Unit, @Behavior] call dzn_fnc_dynai_addUnitBehavior -- where @Unit(OBJECT) is a Infantry Unit or Vehicle (not a crew); @Behavior(STRING) is the name of behavior (see the list above). You are free to spawn this function.

Clone this wiki locally