Page MenuHomeFeedback Tracker

[Feature Request] New scripting commands for setting the weapon/head orientation: setWeaponDirection and setHeadDirection
New, NormalPublic


Having commands for setting the weapon and head direction of units is extremely useful for AI mods.

This game has a lot of potential for creating a really good AI. Like being able to look around, aiming the weapon at potential target positions, etc. Unfortunately, there are a lot of issues that make commands like doTarget/doWatch/lookAt/etc. useless for this purpose (see T144528 for one of these issues).

Requested commands:

unit setWeaponDirection direction

Which sets the aim direction of the unit (taking the limitGunMovement value of the animation into account, just like how the player changes aim using mouse)
Note that this command would behave similar to when you set "Aiming Deadzone" in Game settings to maximum. In other words, the unit itself must NOT turn (vectorDir unit must not change) and only the weapon must move in the hands.


unit setHeadDirection direction

which sets the head direction (while also preventing awkward/invalid head directions). Similar to above, only the "head" must turn and the unit direction (vectorDir unit) doesn't change.

P.S: I'm not sure why there's no such feature in the game right now. If it's because people might be able to create aimbots and cheat with it, then I'm sure you know better than me that there are hundreds of other (and more effective) ways to cheat!


Operating System
Windows 7
Feature Request
Additional Information

You can understand what I mean by doing the following:

  1. Create an AI unit.
  2. `AI disableAI "MOVE"

To see how aiming should work:
AI doTarget player

To see how moving head should work:
AI lookAt player

Event Timeline

Leopard20 renamed this task from [Feature Request] New scripting command for setting the weapon direction of units? to [Feature Request] New scripting commands for setting the weapon/head orientation: setWeaponDirection and setHeadDirection.Sep 24 2020, 7:34 PM
Leopard20 updated the task description. (Show Details)
Leopard20 changed Operating System from Windows 10 x64 to Windows 7.
Leopard20 updated the task description. (Show Details)Sep 24 2020, 9:15 PM
Leopard20 edited Additional Information. (Show Details)Sep 24 2020, 9:17 PM
h- added a subscriber: h-.Sep 25 2020, 7:02 AM
Madin added a subscriber: Madin.May 25 2021, 12:05 PM
Madin added a comment.May 25 2021, 4:46 PM

Any update on it? It seems like something already in game engine, sqf command would help a lot.