Animals: Override Default Animal Behaviour Via Script – Arma 3
Animals in Arma 3 roam freely according to their FSM; they autonomously walk, stop, eat, flee etc. In order to control them fully you will need to override their default behaviour and manually guide them, all with a bit of scripting.
Animal Creation
Animal classnames can be found on the Arma 3 CfgVehicles Animals page.
createAgent Command
Spawning animals via createAgent is the best way how to have control over them in your mission.
An agent is a "light AI" that doesn't have all the abilities/intelligence of a "normal" AI unit created via createUnit;
therefore, they cannot be controlled via commands such as doMove and doStop. However, low-level commands such as moveTo or setDestination will work.
For a basic example see Example script.
Animals Module
The Animals module can be found in Eden Editor in the Modules page (F5), under the Sites category.
Insert the module in editor, set the desired parameters and you have animals in your mission.
Spawned animals will be for mission decoration purpose instead of heavily-scripted behaviour.
Disable animal's scripted behaviour
You can disable animal's scripted behaviour using the following:
Animations
Animations can be played using playMove, playMoveNow or switchMove. Their names are quite self-explanatory.
Dog
- "Dog_Idle_Stop"
- "Dog_Idle_Walk"
- "Dog_Die"
- "Dog_Run"
- "Dog_Sprint"
- "Dog_Sit"
- "Dog_Stop"
- "Dog_Idle_01"
- "Dog_Idle_02"
- "Dog_Idle_03"
- "Dog_Idle_04"
- "Dog_Idle_05"
- "Dog_Idle_06"
- "Dog_Idle_07"
- "Dog_Idle_08"
- "Dog_Idle_09"
- "Dog_Idle_10"
- "Dog_Idle_Sit01"
- "Dog_Idle_Sit02"
- "Dog_Idle_Sit03"
- "Dog_Idle_Sit04"
- "Dog_Idle_Sit05"
- "Dog_Idle_Sit06"
- "Dog_Idle_Sit07"
- "Dog_Idle_Sit08"
- "Dog_Idle_Bark"
- "Dog_Idle_Growl"
- "Dog_Idle_Walk"
- "Dog_Idle_Run"
- "Dog_Idle_Sprint"
- "Dog_TurnL"
- "Dog_TurnR"
Sheep
Goat
Rabbit
Cockerel
Hen
Snake
Examples
Script
Simple example for a dog to follow the player:
See in action: YouTube