Jump to content
Sign in to follow this  
Zombitch

Make a unit fire more than once (forceWeaponFire) ?

Recommended Posts

Hi,

I would like an AI to fire five times so I wrote a file (forceFire.sqf) :

_unit = _this select 0;
_weapon = currentWeapon _unit;
_ammo = _unit ammo _weapon;
_count = 0;

while {_count < 5} do
{
_unit forceWeaponFire [_weapon, "FullAuto"];
_count = _count + 1;
}

Calling the script in a unit init field like that :

_null = [this] execVM "intro\forceFire.sqf";

This thing is the unit is firing only once. I really don't understand why the unit does not fire other bullet.

Any idea(s) ?

Thanks.

Share this post


Link to post
Share on other sites

Would firemode "Single" and a little sleep in the loop help? I mean, you're commanding the unit to fire 5 times in an instant. Maybe the command doesn't stack?

Share this post


Link to post
Share on other sites

Work great when adding sleep or uiSlepp in the loop. Thanks

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×