Jump to content
Sign in to follow this  
rejenorst

Finding out if a unit/vehicle has reloaded

Recommended Posts

Is there a way I can check if a unit has reloaded? In particular the M119 Howitzer or D30 and mortars? Thanks.

Share this post


Link to post
Share on other sites

well, maybe 2 ways.. you could have a loop script check for the reloading animation (that would only work for soldiers , i dont know of 1 for vehicles but maybe for some types, not sure) or keep track of ammo in vehicle or unit and when mag count lowers it will trigger difference. something like this

/*
  [hummer1] execVM "checkmags.sqf"
---------------------------------------------------
note: this is NOT tested with vehicles with multiple turrets.  
*/
_veh = _this select 0;

_change = false;
_veh setVariable ["magchange",false,true];

_getammo = count magazines _veh;
_setcount = _getammo;

while {alive _veh} do {
_getammo = count magazines _veh;
if (_getammo < _setcount) then {_change = true};

	if (_change) then {_veh setVariable ["magchange",true,true]; _setcount = _getammo; _change = false}; 
sleep 1;
};

i setup a trigger set to repeated to test this with this in condition

t1 getVariable "magchange";

and on activation

t1 setVariable ["magchange",false,true]; hint "changing mags";

(my truck that was running script is named "t1")

maybe this gives you a few ideas anyway.

Share this post


Link to post
Share on other sites

Cheers man will give this a try.

At the very least I will see if the magazine count is a good indicator as to whether my Grad or Arty has reloaded.

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  

×