Page MenuHomeFeedback Tracker

AI unable to aim when using playMove/playMoveNow
New, NormalPublic

Description

This is more of a feature request. Can you please make the AI able to aim when using playMove/playMoveNow in a loop? It would be useful for, say, make an AI side-step and shoot at the enemy.

Details

Severity
Feature
Resolution
Open
Reproducibility
Always
Operating System
Windows 8 x64
Category
Anims
Steps To Reproduce

Simply give an AI a playMove in a loop. E.g:

Place an AI in editor. Set his var name to "AI". Also, place an enemy unit in front of him. Name him "aiTarget".

Run this sample code in debug console:

[] spawn {
  _lastDir = 0;
  aiTarget disableAI "ALL";
  ai setSkill 1;
  ai disableAI "MOVE";
  ai doWatch aiTarget;
  ai doTarget aiTarget;
  aiTarget allowDamage false;
  _time = time+3;
  waitUntil {
    ai playMoveNow (["amovpercmtacsraswrfldl", "amovpercmtacsraswrfldr"] select _lastDir);
	ai forceWeaponFire [currentWeapon ai, currentWeaponMode ai];
	ai reveal aiTarget;
	if (time - _time > 3) then {
		_time = time;
		aiTarget attachTo [ai, [0, 5, ([2, 5] select _lastDir)]];
	};
	_lastDir = 1 - _lastDir;
	ai setAmmo [currentWeapon ai, 10];
   sleep 0.3;
    false
  }
};

This will make the AI constantly shoot at the target while playing an animation in a loop.

The problem is, the AI cannot aim up or down even though the target is right in front of him.

Event Timeline

Leopard20 created this task.Sat, Sep 7, 4:03 PM
Leopard20 edited Steps To Reproduce. (Show Details)
Leopard20 edited Steps To Reproduce. (Show Details)Sat, Sep 7, 4:05 PM