I'm working on a UAV (air recon) training mission.
In the begining, a random script setPos one, two or three armored target(s) to a getMarkerPos. The player must recon this area and if he/she sees one armored target call the alpha radio code, if he/she sees two, then Bravo and three - Charlie... That's simple.
The random script is here:
_rnd = random 99
at1 setPos getMarkerPos "dot1"
targetcnt = 1
? (_rnd < 33) : goto "vege"
at2 setPos getMarkerPos "dot2"
targetcnt = 2
? (_rnd < 66) : goto "vege"
at3 setPos getMarkerPos "dot3"
targetcnt = 3
#vege
exit
if random 99 is smaller than 33 then only one armored target positioning to the area.
if random 99 is bigger than 33 but smaller then 66, two armored target and so on...
Finally I put three Triggers with radio codes: alpha, bravo, charlie.
if player use the alpha (0-0-1) I change the 'alphacall' variable to true.
if player use the bravo (0-0-2) I change the 'bravocall' variable to true. etc.
Of course I initialize 'alphacall' and other variables to false in init.sqs.
Then I insert two triggers: one for success and one for fail.
The success trigger condition is:
((alphacall and targetcnt == 1) or (bravocall and targetcnt == 2) or (charliecall and targetcnt == 3))
The activation is a mission End.
The fail trigger condition is:
((alphacall and targetcnt != 1) or (bravocall and targetcnt != 2) or (deltacall and targetcnt != 3))
Tha activation is a Cheater warning and mission Loose.
(if the player don't want use the air recon device and guess, (and he have badluck) the mission is failed)
The PROBLEM is: this mission sometimes works, but other times doesn't.
Doesn't work means: there are three armored target and I call the Charlie code, but mission failed.
I tried to solve this problem in whole weekend, but I don't know what is the problem.
I attached the reduced version of this problem on desert island.
[attachment deleted by admin]