AI units with “this setUnitPos ‘MIDDLE’ or ‘DOWN’;” in their init will change their stance under fire. So far this has been observed as standing up.
Description
Details
- Severity
- Minor
- Resolution
- Open
- Reproducibility
- Sometimes
- Operating System
- Windows 10 x64
- Category
- AI Pathfinding / Motion
Place AI units in the crouched position behind cover (that can be seen over from this position) with attacking enemies.
None.
Event Timeline
It works just fine.
First of all, the command takes local args
Second of all, you're not supposed to use it in init fields
If it's run in an init field, then this is a local argument, since it will definitely run wherever the unit is local.
Second of all, you're not supposed to use it in init fields
Why not? There's nothing documented on its wiki page about potential failures when used in init fields. The only potential problem I see is if you want to change it again later, at which point JIP players could revert it to the init state, but that's not a problem that should cause the init command itself to not work.
I've also noticed this problem; I have a mission where some AI are set to stay fully upright by a script that occurs partway through the mission (so no init fields involved), and I've observed them not always respecting it in action.
If it's run in an init field, then this is a local argument, since it will definitely run wherever the unit is local.
It'll also run where the unit is not local, which might lead to problems (or maybe it just has no effect; idk)
There's nothing documented on its wiki page about potential failures when used in init fields.
AI "brain" initializes post-init. Init fields are pre-inits.
Anyway, the point is that the command works fine according to my tests.