Jump to content
Sign in to follow this  

Recommended Posts

Ok I was modifing this script to work into a target range the pop 3 targets at a time, I have that working fine. But The count target that are hit is not working correctly. I think I has to do with this line.

if ((_rtarget select 1) animationPhase "terc" > 0.1) then
{
	_count1 = _count1+1;
	    };

I am trying to get it to count if 1 2 or 3 will be hit. If you hit 2 only 2 count if 1, one counts, if 3 3 counts. Now the targets do pop up correctly. But It still does not count correctly. This is what I have so far can anyone help me out with this. It hint it count SCALAR everytime, not sure what that means

_inc     = 0;
_count   = 0;
_pt = [pt2, pt2a, pt2b];
_pt1 = [pt2_1, pt2_1a, pt2_1b];
_pt2 = [pt2_2, pt2_2a, pt2_2b];
_pt3 = [pt2_3, pt2_3a, pt2_3b];
_pt4 = [pt2_4, pt2_4a, pt2_4b];
_pt5 = [pt2_5, pt2_5a, pt2_5b];
_pt6 = [pt2_6, pt2_6a, pt2_6b];
_pt7 = [pt2_7, pt2_7a, pt2_7b];
_dtargets = [pt2, pt2a, pt2b, pt2_1, pt2_1a, pt2_1b, pt2_2, pt2_2a, pt2_2b, pt2_3, pt2_3a, pt2_3b, pt2_4, pt2_4a, pt2_4b, pt2_5, pt2_5a, pt2_5b, pt2_6, pt2_6a, pt2_6b, pt2_7, pt2_7a, pt2_7b];
_targets = [_pt1, _pt, _pt2, _pt3, _pt4, _pt5, _pt6, _pt7];
_many    =  count _targets;
nopop=true;
{_x  animate["terc",1]} forEach _dtargets;

[West, "HQ"] sidechat "Welcome to the 101st Airborne's 2nd Live Fire Rifle Qualification Range";
sleep 5;
[West, "HQ"] sidechat "Begin!";


while {_inc<60} do 
{
_rnumber = floor random _many;
_rtarget = _targets select _rnumber;
//_rtarget animate["terc", 0];
{_x animate["terc", 0];} forEach _rtarget;
sleep 8;
if ((_rtarget select 0) animationPhase "terc" > 0.1) then
{
	_count = _count+1;
	    };
if ((_rtarget select 1) animationPhase "terc" > 0.1) then
{
	_count1 = _count1+1;
	    };
if ((_rtarget select 2) animationPhase "terc" > 0.1) then
{
	_count2 = _count2+1;
	    };
_countt = _count+_count1+_count2;
  [West, "HQ"] sidechat format ["Targets :%1 Hit :%2",_inc+3,_countt];
{_x animate["terc", 1];} forEach _rtarget;
_inc = _inc + 3;
};
sleep 8;
[West, "HQ"] sidechat "Session Complete,";

CORRECT BELOW

_inc     = 0;
_count   = 0;
_count1 = 0;
_count2 = 0;
_pt = [pt2, pt2a, pt2b];
_pt1 = [pt2_1, pt2_1a, pt2_1b];
_pt2 = [pt2_2, pt2_2a, pt2_2b];
_pt3 = [pt2_3, pt2_3a, pt2_3b];
_pt4 = [pt2_4, pt2_4a, pt2_4b];
_pt5 = [pt2_5, pt2_5a, pt2_5b];
_pt6 = [pt2_6, pt2_6a, pt2_6b];
_pt7 = [pt2_7, pt2_7a, pt2_7b];
_dtargets = [pt2, pt2a, pt2b, pt2_1, pt2_1a, pt2_1b, pt2_2, pt2_2a, pt2_2b, pt2_3, pt2_3a, pt2_3b, pt2_4, pt2_4a, pt2_4b, pt2_5, pt2_5a, pt2_5b, pt2_6, pt2_6a, pt2_6b, pt2_7, pt2_7a, pt2_7b];
_targets = [_pt1, _pt, _pt2, _pt3, _pt4, _pt5, _pt6, _pt7];
_many    =  count _targets;
nopop=true;
{_x  animate["terc",1]} forEach _dtargets;

[West, "HQ"] sidechat "Welcome to the 101st Airborne's 2nd Live Fire Rifle Qualification Range";
sleep 5;
[West, "HQ"] sidechat "Begin!";


while {_inc<60} do 
{
_rnumber = floor random _many;
_rtarget = _targets select _rnumber;
//_rtarget animate["terc", 0];
{_x animate["terc", 0];} forEach _rtarget;
sleep 8;
if ((_rtarget select 0) animationPhase "terc" > 0.1) then
{
	_count = _count+1;
	    };
if ((_rtarget select 1) animationPhase "terc" > 0.1) then
{
	_count1 = _count1+1;
	    };
if ((_rtarget select 2) animationPhase "terc" > 0.1) then
{
	_count2 = _count2+1;
	    };
_countt = _count+_count1+_count2;
  [West, "HQ"] sidechat format ["Targets :%1 Hit :%2",_inc+3,_countt];
{_x animate["terc", 1];} forEach _rtarget;
_inc = _inc + 3;
};
sleep 8;
[West, "HQ"] sidechat "Session Complete,";

Edited by =101AD=Richard

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  

×