the problem i have is
The _Gno is the garrison number which the town is controlled by
_Tno is the actual town within the garrison
There are several garrisons and for each there are several towns
what i need to do is have an enemy soldier that has defeated the town, change the flag within that town, and in doing so set a boolean that is in the towns array to true
so at the moment i am using a looping script that
counts the number of garrisons,
counts the number of towns per garrison
and then for each town in turn sets the flagtexture and gives that specific flag an addaction
The script that the addaction then runs, will remove the action from that specific flag and set the towns "Towntaken" boolean to true
which will allow another looping script that is monitoring all the towns, to skip monitoring the "Taken" town
so any ideas
INIT.sqs
;;;###___ Garrison help booleans ___ ###;;;
tx_Gbools = [G1_Help,G2_Help,G3_Help,G4_Help]
;;;###___ Garrison 1 elements ___ ###;;;
;;;<<< Town 1 >>> ;;;
tx_G1T1_mg = [G1T1_mg1,G1T1_mg2,G1T1_mg3,G1T1_mg4]
tx_G1T1_d = [G1T1_d1,G1T1_d2,G1T1_d3,G1T1_d4]
tx_G1T1_p = [G1T1_p1,G1T1_p2,G1T1_p3,G1T1_p4]
tx_G1T1 = [G1T1_Flag,tx_Gbools,G1T1_attack,G1T1_taken,tx_G1T1_mg,tx_G1T1_d,tx_G1T1_p]
;;;<<< Town 2 >>> ;;;
tx_G1T2_mg = [G1T2_mg1,G1T2_mg2,G1T2_mg3,G1T2_mg4]
tx_G1T2_d = [G1T2_d1,G1T2_d2,G1T2_d3,G1T2_d4]
tx_G1T2_p = [G1T2_p1,G1T2_p2,G1T2_p3,G1T2_p4]
tx_G1T2 = [G1T2_Flag,tx_Gbools,G1T2_attack,G1T2_taken,tx_G1T2_mg,tx_G1T2_d,tx_G1T2_p]
;;;<<< Town 3 >>> ;;;
tx_G1T3_mg = [G1T3_mg1,G1T3_mg2,G1T3_mg3,G1T3_mg4]
tx_G1T3_d = [G1T3_d1,G1T3_d2,G1T3_d3,G1T3_d4]
tx_G1T3_p = [G1T3_p1,G1T3_p2,G1T3_p3,G1T3_p4]
tx_G1T3 = [G1T3_Flag,tx_Gbools,G1T3_attack,G1T3_taken,tx_G1T3_mg,tx_G1T3_d,tx_G1T3_p]
;;;<<< Town 4 >>> ;;;
tx_G1T4_mg = [G1T4_mg1,G1T4_mg2,G1T4_mg3,G1T4_mg4]
tx_G1T4_d = [G1T4_d1,G1T4_d2,G1T4_d3,G1T4_d4]
tx_G1T4_p = [G1T4_p1,G1T4_p2,G1T4_p3,G1T4_p4]
tx_G1T4 = [G1T4_Flag,tx_Gbools,G1T4_attack,G1T4_taken,tx_G1T4_mg,tx_G1T4_d,tx_G1T4_p]
;;;<<< Garrison1 HQ >>> ;;;
tx_G1 = [tx_G1T1,tx_G1T2,tx_G1T3,tx_G1T4]
;;;###___ MISC ARRAYS ___ ###;;;
tx_AllG_towns = [tx_G1]
[]exec "aiControl\town_monitor.sqs"
[]exec "setupflag.sqs"
exit
SETUPFLAGS.sqs
~ random 5
;;Sets all the flags up for all the towns in all the garrisons
?! (local server): exit
~ random 5
#START
_GNo = 0
_Gcount = count (tx_AllG_Towns)
_TNo = 0
goto "G_Loop"
#G_Start
_GNo = _GNo + 1
#G_Loop
? (_GNo >= _Gcount): _GNo = 0; goto "END"
goto "T_Loop"
#T_Start
_TNo = _TNo + 1
#T_Loop
_Tcount = count (tx_AllG_Towns select _GNo)
? (_TNo >= _Tcount): _TNo = 0; goto "G_Start"
goto "TOWNcheck"
#TOWNcheck
hint format ["_Gno = %1 .......... _Tno = %2\n\n_Gcount = %3 .........._Tcount = %4",_Gno,_Tno,_Gcount,_Tcount]
~1
((((tx_AllG_towns select _Gno)select _Tno)select 0) setflagtexture "rus_vlajka.pac")
Gno = _Gno
Tno = _Tno
((((tx_AllG_towns select _Gno)select _Tno)select 0) addaction ["take Flag","takeflag.sqs")])
goto "T_Start"
#END
hint "At End flagsetup"
Exit
and the addaction script that i need to pass the location of the flag "element" in its array is
TAKEFLAG.sqs
_Gno = this select 0
_Tno = this select 1
~3
((((tx_AllG_towns select _Gno)select _Tno)select 0) setflagtexture "usa_vlajka.pac" )
((((tx_AllG_towns select _Gno)select _Tno)select 0) setflagside WEST)
((((tx_AllG_towns select _Gno)select _Tno)select 0) removeaction 0)
(((tx_AllG_towns select _Gno)select _Tno) set [3,true])
hint "Removed action"
exit
am stuck with assigning the correct
select %