TT Scripted Movement Functions
Are you tired of AI running around unpredictably when creating scenarios in Arma 3? This mod is here to fix that problem!
Currently, the main way to ensure AI in Arma 3 reaches a designated location is by setting their behavior to “Never fire” and “Safe.” However, this causes the AI to do nothing when encountering enemies, which can severely impact the player’s experience. Even with these settings, Arma 3’s pathfinding issues often cause AI to wander off, disrupting the flow of the mission.
Of course, there are many other drawbacks — something scenario creators are all too familiar with.
This mod moves units using scripted displacement combined with animations to ensure that AI follow a designated path without wandering off.
While this method still prevents infantry from returning fire during movement, it works perfectly for vehicles — since the vehicle follows the set path, but all turrets remain fully operable for AI to aim and shoot.
It’s also highly useful for close air support: the animation can guide aircraft along a precise route and drop specific bombs at designated locations.
In short, this is an essential mod for anyone looking to create Call of Duty-style linear missions in Arma 3.
This mod includes two types of functions:
1. Record and Play Back Animations
This method is perfect for crafting natural-looking animations for units close to the player. It allows detailed and immersive movement and firing sequences. However, recording for each unit individually can be time-consuming if many AIs are involved.
2. Direct Path-Based Animations
This method skips the recording process. Just set the path and the unit will animate along it — just like placing waypoints in Eden Editor.
Note: This method only works with infantry.
To start recording, use:
unit1 can be infantry or a vehicle. (The object corresponding to unit1 must have a global variable name. otherwise, the function won’t work properly.)
Control the unit to perform actions — the system will record movement, animations, and weapon fire.
To stop recording, press Esc (or the function stops automatically if the unit dies).
After recording ends, the screen will instruct you to press:
F1: all the code required to play the animation will be copied to your clipboard at once.
This will make the unit exactly repeat the recorded behavior.
recording each animation individually can be time-consuming when many AI units are involved. To solve this, the second type of function allows you to skip the recording step. Instead, you simply define a path, and the unit will move along it using animations. This method is as convenient as placing waypoints in 3den, but it only works for infantry — vehicles are not supported with this method.
Example usage:
man1: the infantry unit (vehicles not supported)
[waypoint_1, waypoint_2, waypoint_3]: objects acting as waypoints; the unit will move along them in order
The function name determines the animation — in this case, the soldier runs while standing and holding a rifle.
Crouch:
TT_fnc_scripted_crouch_Run_pistol
TT_fnc_scripted_crouch_Run_rifle
Prone:
TT_fnc_scripted_prone_Run_pistol
TT_fnc_scripted_prone_Run_rifle
Standing (Fast Run):
TT_fnc_scripted_stand_fastRun_pistol
TT_fnc_scripted_stand_fastRun_rifle
Standing (Normal Run):
TT_fnc_scripted_stand_Run_pistol
TT_fnc_scripted_stand_Run_rifle
More animations will be added in future updates!
At the moment, there is a critical limitation — you cannot save the game while a unit is executing a recorded animation.
If you load a save that was made during animation playback, the unit will appear stuck in place and will not resume the animation. [color=red]Avoid saving the mission during playback to prevent this issue.[/color]
All human animation playback functions in this mod will automatically execute the following two commands after finishing:
This prevents the unit from wandering after the animation.
If you want the unit to resume native AI behavior, restore it manually with:
All ground vehicles and boats will automatically have the following applied to their driver during animation playback:
This ensures that the vehicle follows the exact animation path without interruption.
To restore the vehicle driver’s AI after the animation ends, use:
In summary, the main reason I created this mod is because I was fed up with Arma 3’s native AI constantly running off and ruining mission flow.
If you want to see what fully scripted unit movement looks like in action, check out my Workshop missions — all unit movements in those scenarios are controlled purely by script.
Here are some tips for mission makers:
Make sure all units that directly affect mission objectives are controlled by scripted movement. This guarantees they won’t wander off or behave unpredictably, ensuring the mission progresses smoothly.
That said, you can still add regular AI units to increase difficulty and enhance battlefield atmosphere. Just be sure that whether those AIs live, die, or run off somewhere, it has no impact on the mission objectives.
This balance gives you both a stable mission structure and the dynamic chaos of a real battle.
1. While recording tanks and other vehicles in the East Asia War, 1937 – 日中戦争 – 抗日战争 MOD, I noticed that the tracks would only rotate for the first few seconds and then stop. After analysis, I believe this may be an AI-related issue specific to that MOD, as it does not occur in the vanilla game or other MODs.The solution is to move the tank by rapidly tapping the “W” key continuously, rather than holding it down, when recording its movement. This way, the recorded data will avoid this issue.
In the latest version, it’s now possible to record turret rotation animations for vehicles with turrets, including the elevation and depression of the gun barrel. Note: By default, only the animation of the primary weapon turret will be recorded.You can use currentWeapon _vehicle to detect which turret is the primary weapon turret.
However, the pitch (up and down) movement of a soldier’s weapon still cannot be recorded. If anyone knows how to record this, feel free to share it in the comments.