Forum Jump :

Author Message


Posts: 38
Rank:


Level: Member

Country: us
Location:
Occupation:
Age: 41
In-game name:

 
#1 Posted at 2014-05-06 04:34        
     
I made a Pop-up target range in the editor. However, my scoring system isn't working. Can anyone tell why by my script snippet?
hint "Session Complete,";
sleep5;
 if (_count >= 18) then {hint "You Scored MARKSMAN";};

sleep5;
 if (_count >= 14) and  if (_count <= 18)  then {hint "You Scored RIFLEMAN";};

sleep5;
 if (_count >= 9) and  if (_count <= 15)  then {hint "You Scored GRUNT";};

sleep5;
 if (_count <= 9) then {hint "You Scored TRUCK DRIVER";};
This is only part of the script, but I'm sure it's the non-working part.

"If you tremble with indignation at every injustice, then you are a comrade of mine." -"Che" Guevara-

Author Message


Posts: 7
Rank:


Level: Member

Country: de
Location:
Occupation:
Age:
In-game name:

 
#2 Posted at 2014-05-06 13:05        
     
Where is _count being set?

_count <= smaler then
_count >= bigger then


Advertisement


Author Message


Posts: 1524
Rank:


Level: Member

Country: uk
Location:
Occupation:
Age:
In-game name:

 
#3 Posted at 2014-05-06 13:44        
     
also id c_count is working correctly it would be worth using a switch for this.
sleep 5;
switch (true) do {
case  (_count <= 9)  : {hint "You Scored TRUCK DRIVER";};
case  (_count <= 14) : {hint "You Scored GRUNT";};
case  (_count <= 18) : {hint "You Scored RIFLEMAN";};
case  (_count >= 19) : {hint "You Scored MARKSMAN";};
};

Only the one that is true will fire as long as the order is correct.


Your if statements should have looked like this.
if (_count >= 14 and  _count <= 18)  then {hint "You Scored RIFLEMAN";};
and sleep5; should be sleep 5;


Author Message


Posts: 38
Rank:


Level: Member

Country: us
Location:
Occupation:
Age: 41
In-game name:

 
#4 Posted at 2014-05-06 23:40        
     
I probably should have just posted the whole script. With your help I got it working. Guess I had to fix a couple redundancies and mistakes, lol.
_inc     = 0;
_count   = 0;
_targets = [pt1, pt1_1, pt1_2, pt1_3, pt1_4, pt1_5, pt1_6, pt1_7, pt1_8, pt1_9, pt1_10, pt1_11, pt1_12];
_many    =  count _targets;
{_x  animate["terc",1]} forEach _targets;

hint "Welcome to Avery's Rifle Qualification Range";
sleep 5;
hint "Setting up the Range";
sleep 3;
hint "The Qualification Course will begin in 10 Seconds";
sleep 2;
hint "The Qualification Course will begin in 8 Seconds";
sleep 2;
hint "The Qualification Course will begin in 6 Seconds";
sleep 2;
hint "The Qualification Course will begin in 4 Seconds";
sleep 2;
hint "The Qualification Course will begin in 2 Seconds";
sleep 2;
hint "Begin!";


while {_inc<20} do 
{
_rnumber = floor random _many;
_rtarget = _targets select _rnumber;
_rtarget animate["terc", 0];
sleep 6;
 if (_rtarget animationPhase "terc" > 0.1) then
{
		_count = _count+1;
		    };
   hint format ["Targets :%1 Hit :%2",_inc+1,_count];
_rtarget animate["terc", 1];
_inc = _inc + 1;
};              
sleep 8;
hint "Session Complete,";

sleep5;
 if (_count >= 19) then {hint "You Scored MARKSMAN";};

 if (_count <= 18)  then {hint "You Scored RIFLEMAN";};

 if (_count <= 15)  then {hint "You Scored GRUNT";};

 if (_count <= 9) then {hint "You Scored TRUCK DRIVER";};
It works perfect now, Thx very much.

"If you tremble with indignation at every injustice, then you are a comrade of mine." -"Che" Guevara-

Author Message


Posts: 4
Rank:


Level: Member

Country: us
Location:
Occupation:
Age:
In-game name:

 
#5 Posted at 2014-12-04 19:56        
     
Hello,

I see you made a pop up target range and that sounds awesome.

I want to make one for my clan but not 100% on how to go about it.

Is there any chance that I can please use yours or at least see your mission in the editor so I can use it for my own? Will give you credit if you'd like.

It's not big or known clan, just like 10 of my friends and theirs.

Oh and it would be or Arma 3, if that changes anything.

Thanks in advance!


Author Message


Posts: 38
Rank:


Level: Member

Country: us
Location:
Occupation:
Age: 41
In-game name:

 
#6 Posted at 2015-08-23 06:17        
     
I Imagine My reply is a bit late. This was never authored by me, but an augmented version of another guys script. I don't remember his name.

1. I'm not sure if this would work in MP.

2. I was simply trying to get the augmented version working, so my son could get better at Arma2.

3. as far as setting it up, I placed 20 targets ( popup; under Objects in editor) grouped each one with 3 markers 3 m from each other ( to create a random effect) placed a few ambient objects for immersion. executed the script. Bam!

"If you tremble with indignation at every injustice, then you are a comrade of mine." -"Che" Guevara-