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.
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
{semaphore "<semaphore_name>" N}
N
is the lock time in seconds
Semaphore states:
unlocked —
N = 0
locked — 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.
Conditions
Compound conditions in the Idle Request Selector use logical operators and
, or
, and not
.
Conditions used with highest priority:
{if human_fsm_idle_semaphore "can_smoke"}
{if human_fsm_idle_state "smoking_begin"}
{if fsm_tags "board"}
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.
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
Last updated