Hi,
I'm trying to set the variables that are passed in as parameters to the script. Is "this select 0" the only way of referencing the first parameter? I tried the following and it didn't work either.
; ***************************************
; Operation Flashpoint Script "ExclusiveOR"
; Example script call
; [Flag1,10,Flag2,10,Flag3,20,Flag4,15,Flag5,5] exec "ExclusiveOR.sqs"
; This means :
; Flag1 has a 10% chance of being set.
; Flag2 has a 10% chance of being set.
; Flag3 has a 20% chance of being set.
; Flag4 has a 15% chance of being set.
; Flag5 has a 5% chance of being set.
; There is a 40% chance of nothing being set
; ***************************************
; Initialise flags and variables
; ***************************************
_this select 0 = false
_this select 2 = false
_this select 4 = false
_this select 6 = false
_this select 8 = false
; ***************************************
; Roll the die and set THE flag
; ***************************************
_Die = Random 100
_TotProb = (_this select 1)
? (_Die < _TotProb) : (_this select 0) = true; exit
_TotProb = _TotProb + (_this select 3)
? (_Die < _TotProb) : (_this select 2) = true; exit
_TotProb = _TotProb + (_this select 5)
? (_Die < _TotProb) : (_this select 4) = true; exit
_TotProb = _TotProb + (_this select 7)
? (_Die < _TotProb) : (_this select 6) = true; exit
_TotProb = _TotProb + (_this select 9)
? (_Die < _TotProb) : (_this select
= true; exit
Bye for now.