Hi guys!
Ok, i am making a 5 flag C&H following a tutorial and everything was working fine until today i came across Tacticians new example mission, template scripts etc. (i think the first tute i was following may have been an earlier one by Tactician actually).
Having read how good is suposedly is i decided to base my map on it so i changed all the scripting which just left the flag triggers and the GL named server...... All it says in the tute is that the scripts can be implemented straight in as long as the flag triggers are correct but it doesn't actually tell u the parameters for them so i wondered if one of u would maybe please take a looksee
Now, everything looks ok to me....except for one thing....i can't take the flags....kind of a big problem really aint it!
Anyway....here is what i've got.....see what u think....
------------------------------------------------------------------------
First i have a GL called Server. (This isn't actually mentioned in the second tute)
(Neither are the flag triggers)
------------------------------------------------------------------------
Next i have 5 flags....
Name: Flag1, Flag2, Flag3, Flag4, Flag5.
Init: this setflagside RESISTANCE; this setflagtexture "Black"
------------------------------------------------------------------------
Next, 3 triggers for each flag (I'll work with Flag5 here)
The East capture trig...
Activated by: East, present, repeatedly
Name: Ecap5
Condition: !isNull (flagOwner Flag5) == EAST
On activation: [Flag5, EAST] exec "capture.sqs"
The West capture trig..... the same but mirrored obviously.
The Return trig....
Activation: None, Repeatedly
Timeout: 3, 3, 3
Name: Return5
Condition: !isNull (flagOwner Flag5)
On Activation: Flag5 setflagowner objNull
------------------------------------------------------------------------
;capture.sqs
_flag = _this select 0
_side = _this select 1
?(_side == WEST): goto "West"
?(_side == EAST): goto "East"
exit
#West
?!(local Server): goto "Westclient"
WestScore = WestScore + 1
WestArray = WestArray + [_flag]
EastArray = EastArray - [_flag]
PublicVariable "WestScore"
#Westclient
(flagOwner _flag) setflagowner objNull
_flag setflagowner objNull
~0.2
_flag setflagtexture "\Flags\unitedkingdom.jpg"
_flag setflagside WEST
goto "end"
#East
?!(local Server): goto "Eastclient"
EastScore = EastScore + 1
EastArray = EastArray + [_flag]
WestArray = WestArray - [_flag]
PublicVariable "EastScore"
#Eastclient
(flagOwner _flag) setflagowner objNull
_flag setflagowner objNull
~0.2
_flag setflagtexture "rus_vlajka.pac"
_flag setflagside EAST
goto "end"
#end
?(local Server): [_flag, _side] exec "control.sqs"
~1.5
hint format["West: %1\nEast: %2", WestScore, EastScore]
Exit
------------------------------------------------------------------------
;control.sqs
?!(local Server): exit
_flag = _this select 0
_side = _this select 1
#start
~90
?(_side == West): _ar = WestArray
?(_side == East): _ar = EastArray
?!(_flag in _ar): exit
?(_side == West): WestScore = WestScore + 1
?(_side == East): EastScore = EastScore + 1
?(_side == West): PublicVariable "WestScore"
?(_side == East): PublicVariable "EastScore"
goto "start"
------------------------------------------------------------------------
;return.sqs
_flag = _this select 0
~5
?(!isnull (flagOwner _flag)): goto "return"
Exit
#return
(flagOwner _flag) SetFlagOwner objNull
_flag SetFlagOwner objNull
exit
------------------------------------------------------------------------
;init.sqs
param1 = 1800
WestScore = 0
EastScore = 0
WestArray = []
EastArray = []
------------------------------------------------------------------------
PHEW!!! Ok, so where have i gone wrong
Many, many thanks for taking the time to read this and the lucky brainiac will get a thank-you on my briefing ;D