Home   Help Search Login Register  

Author Topic: Pop up Script  (Read 1572 times)

0 Members and 1 Guest are viewing this topic.

Offline unknownx9

  • Members
  • *
Pop up Script
« on: 30 Mar 2011, 02:45:46 »
Quote
_inc     = 0;
_count   = 0;
_targets = [MG22, MG23, MG24, MG25, MG26, MG27, MG28, MG29, MG30, MG31, MG32, MG33, MG34, MG35, MG36, MG37, MG38, MG39, MG40, MG41, MG42];
_many    =  count _targets;
_SoldierOne  = player;
_pass    = 16; // number of targets you  are required to hit.

{_x  animate["terc",1]} forEach _targets;
_rnumber1=0;
_rnumber2=0;
_rnumber3=0;

_soldierOne groupChat "Welcome to the firing range";
sleep 5;
_soldierOne groupChat "Setting up the Range";
sleep 2;
_soldierOne groupChat "The Qualification Course will begin in 2 Seconds";
sleep 2;
_soldierOne groupChat "Begin!";


while {_inc<17} do
{
_rnumber1 = random _many;
_int = _rnumber1%1;
_rnumber1 = _rnumber1-_int;

while {(_rnumber1 == _rnumber2) or (_rnumber1 == _rnumber3) or (_rnumber2 == _rnumber3)} do

_rnumber2 = random _many;
_int = _rnumber2%1;
_rnumber2 = _rnumber2-_int;

_rnumber3 = random _many;
_int = _rnumber3%1;
_rnumber3 = _rnumber3-_int;
};

_rtarget1 = _targets select _rnumber1;
_rtarget2 = _targets select _rnumber2;
_rtarget3 = _targets select _rnumber3;

_rtarget1 animate["terc", 0];
_rtarget2 animate["terc", 0];
_rtarget3 animate["terc", 0];

sleep 6;

 if (_rtarget1 animationPhase "terc" > 0.1) then
{
      _count = _count+1;
          };
 if (_rtarget2 animationPhase "terc" > 0.1) then

{
      _count = _count+1;
          };
 if (_rtarget3 animationPhase "terc" > 0.1) then
{
      _count = _count+1;
          };
         
_soldierOne groupChat format ["Targets :%1 Hit :%2",(_inc+1)*3,_count];
_rtarget1 animate["terc", 1];
_rtarget2 animate["terc", 1];
_rtarget3 animate["terc", 1];
sleep 2;
_inc = _inc + 1;
};
sleep 2;
_soldierOne groupChat "Session Complete";
sleep 1;
_soldierOne commandChat format ["%1",_count];
//if  (_count >= _pass ) then {_soldierOne commandChat "Congratulations you have passed";} else {_soldierOne commandChat "Sorry you must do better";};

Hello OFPEC,

I found this script lying around and is being used for a training map that I am currently working on. In its current state the script works like it's scripted to.

Now the issue I am having with this script is that it is suppose to be for an Machine gun range. The pop up targets pop up in pairs of 3 but in different location in the same range. I am wondering if anyone can assist me in making the 3 targets that pop up are next to each other.

I have tried to group them, place an array of array's, but my scripting knowledge is limited. Therefore any help would be greatly appreciated.

Thank you.