Page MenuHomeFeedback Tracker

“setUnitPos” no longer locks AI stance.
New, NormalPublic

Description

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.

Details

Severity
Minor
Resolution
Open
Reproducibility
Sometimes
Operating System
Windows 10 x64
Category
AI Pathfinding / Motion
Steps To Reproduce

Place AI units in the crouched position behind cover (that can be seen over from this position) with attacking enemies.

Additional Information

None.

Event Timeline

Leopard20 added a subscriber: Leopard20.EditedJul 7 2021, 4:03 AM

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

NikkoJT added a subscriber: NikkoJT.Jul 7 2021, 4:24 AM

It works just fine.
First of all, the command takes local args

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.

Leopard20 added a comment.EditedJul 7 2021, 7:57 PM

@NikkoJT

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.

I figured out the “why”. It only happens to units that are grouped.