Configuring idle for human actor
General Principles
The following FSM states allow idle animations to be triggered:
board— actor is linked to another objectlie_idle— lying downsnipe— peeking from behind coversquat— sittingidle— standing without performing any action
Idle animation selection occurs in two stages:
The actor's current idle state is stored in the FSM to support chained transitions between idle states.
Idle Request Selector configuration
Syntax of
human_idle_selector.set{init {state "<initial_state>"} ; required parameter {semaphore "<name>" <time_from> <time_to>} } {selector {if <condition> {idle {run "<request_name>"} ; request to the Animation Selector {state "<new_state>"} ; optional FSM state change {semaphore "<name>" <time_from> <time_to>} ; optional semaphore override } } [...] {idle {run ""} ; empty request } }
{init ...}
Initialization block called at game start or unit spawn. Sets the initial FSM state and semaphore locks.
state "<initial_state>"
Sets the FSM state of the actor immediately after spawning.
Required.
Example: "idle"
semaphore "<name>" <time_from> <time_to>
Locks or unlocks a semaphore for a randomized time interval (in seconds).
Example: semaphore "can_smoke" 10 30 disables smoking for 10–30 seconds.
{selector ...}
Main block that defines the logic for choosing requests of the Animation Selector based on current FSM state and conditions.
{if <condition> ...}
Conditional block.
Checks FSM state (fsm_tags, human_fsm_idle_state), semaphore status (human_fsm_idle_semaphore), item interaction (human_stuff holding), etc.
See: Condition syntax reference
{idle ...}
Defines what to execute if the condition is met. Typically includes a run command to call the Animation Selector.
May also include optional state and semaphore parameters.
run "<request_name>"
Triggers the specified request, which is then handled in animation_selector/human.set.
Example: run "stand_smoking_begin" will use that request name to find matching animations.
An empty string means no new animation is triggered and the current one continues playing.
When an empty request is triggered, the actor remains still for a short time, after which the request selection restarts.
Idle states
In Men of War II, two idle states are used:
idle— plays regular idle animationssmoking— plays smoking animations
To enable idle animation selection for a state that didn’t previously support it, FSM logic must be extended to include idle handling.
Semaphores in the Idle Request Selector
Semaphores are used to control the frequency and conditions under which specific requests can be triggered. They provide time-based restrictions that prevent all units from animating in sync.
Semaphore syntax
Nis the lock time in seconds
Semaphore states:
unlocked —
N = 0locked — for the specified time
N
Using two values for semaphore lock time is recommended to introduce random duration, promoting natural variation in unit behavior and avoiding synchronized animations.
New semaphores are defined inside the init block
Idle request semaphores used in Men of War II
can_smoke
Controls whether the smoking cycle can begin. While this semaphore is locked, the unit cannot trigger the request stand_smoking_begin. It is locked after each cigarette and unlocked after a random delay (e.g., 5–10 or 60–120 seconds).
can_inhale
Controls the interval between inhales during smoking. Used within the smoking state to determine when the stand_smoking_process request can be triggered. It is locked for a few seconds after each inhale.
can_action
Allows the execution of active idle behaviors (e.g., scratching, shifting weight). While locked, the unit will only play neutral idle animations such as stand_breath, squat_breath, or lie_breath. The lock controls the frequency of animation changes.
stop_smoking
Restricts the ability to end the smoking cycle. While active, the request stand_smoking_end will not be triggered. This is used to ensure a minimum duration in the smoking state to make smoking appear realistic.
Example: Using semaphores in the Idle Request Selector
Explanation
init block
{state "idle"}Sets the unit’s initial FSM state toidle.{semaphore "can_smoke" 10 30}Prevents the unit from starting the smoking cycle immediately. Smoking becomes available only after 10–30 seconds.{semaphore "can_inhale" 3 5}Sets the delay before the first inhale, in case the unit starts smoking soon after spawning.{semaphore "can_action" 5 15}Sets a pause before the unit can perform more active idle animations. While the semaphore is locked, only breathing idles will play.
idle block
{run "stand_smoking_begin"}Triggers thestand_smoking_beginrequest. It will be passed toanimation_selector/human.set, where the appropriate smoking start animations will be selected.{state "smoking"}Updates the FSM state tosmoking, which affects future request selection and conditions.{semaphore "stop_smoking" 20 40}Locks thestop_smokingsemaphore for 20–40 seconds. While active, the unit will not triggerstand_smoking_end.{semaphore "can_inhale" 3 5}Sets the pause before the next inhale (e.g., to allowstand_smoking_processin the next cycle).
Conditions
Compound conditions in the Idle Request Selector use logical operators and, or, and not.
Conditions used with highest priority:
Examples of conditions used in the Idle Request Selector
fsm_tags "board"
Checks whether the FSM state has the board tag.
human_fsm_counter "forced_smoke" once
Checks the FSM counter forced_smoke.
See: [FSM Counter Check Reference]
human_stuff holding "nothing"
Checks that the actor is holding nothing in their hands.
human_fsm_idle_state "idle"
Checks the current FSM idle state.
human_fsm_idle_semaphore "can_smoke"
Checks whether the specified semaphore is unlocked.
able "attention"
Checks if the attention ability is available.
not able "attention"
Inverse check — confirms that attention is not available.
Example: Nested compound condition in Idle Request Selector
This example uses a two-level nested condition, where each sub-condition must be true for the idle block to be executed.
First-level condition: {if fsm_tags "up"}
This block is only evaluated if the unit’s FSM state includes the tag up — for example, standing, not in cover, and ready to act.
Second-level condition All three conditions must be met:
human_fsm_counter "forced_smoke" onceChecks the forced_smoke counter:If the value is greater than 0 → returns true and resets the counter to 0;
If the value is 0 → returns false. This is used for one-time forced actions (consume and reset).
human_stuff holding "nothing"Verifies that the unit is not holding any item or weapon. I f the unit is holding something, the condition fails.human_fsm_idle_state "idle"Ensures that the current internal FSM idle state isidle. Prevents conflicts — for example, avoids triggering the same request again if the unit is already smoking.
Examples of Requests for Idle Animation Selection
The table below shows request names defined in the idle request selector and used with the run command.
The _idle index in request names typically denotes more active idle behaviors,
while the _breath index denotes breathing or subtle movement animations.
stand_idle
stand_breath
Standing — idle or subtle breathing animation
squat_idle
squat_breath
Sitting idle
snipe_breath
Peeking over low cover (e.g., trench, waist-high fence)
lie_idle
lie_breath
Lying idle
stand_smoking_begin
Lighting a cigarette
stand_smoking_process
Inhaling
stand_smoking_end
Putting out the cigarette
Custom animation requests can be defined and mapped in human_idle.inc
Last updated