Home   Help Search Login Register  

Author Topic: removing the effect of ObjNull on an in Gametigger counting ObjWest  (Read 1344 times)

0 Members and 1 Guest are viewing this topic.

DG

  • Guest
I have a capture.sqs file from the Capture hold tutorial ( that was edit by another fellow from the download area)and looking to use the ideas for a new game .

Game premise: ruffly 4 or more flags , their variables are the town names . Once capturing all four by one side ends the game by way of a trigger with the conditional " ((side (flagowner Davle)==West) and (side (flagowner Trosky) == west) ...etc)) .

now I am quite sure that as the individual triggers for each flag pass OnAct: [Davle , West] exec "capture.sqs" {the array is def in the scripts as _flag , _side} , the  "flagowner" value is logged at that moment as WEST ;either by this array being worked on by the relevant sqs or the action of taking the flag ... I am pretty certain the 2nd one is the logical answer of the two.

 then the script sets the flagowner value to ObjNull to change the flagtexture ... then the flagside values and thus placed in the "WestArray" value. this as you'll most likely agree destroys the effect of the afore conditional on the game end.

 if I change the ObjNull to Objwest then the conditional's effect is returned however the texture command is nullified.

I then thought , well , why not use the "westarray" value as the conditional rather than the trigger so I looked at the format in the commandref page for the "if (a=b) then (c=d)" syntax but was stumped by the explanation that BIS had provided .... I want a line like this inserted into the control.sqs
to end the game with "exit.sqs" ( I couldn't decifer that syntax either , I am very new to the scripting world ..)

 if(westarray==[Davle,Trosky,etc]) then (endgame==true) {or something like that , .. exec "exit.sqs" etc etc etc}

 looking forward to any ideas or directions

 cheers and glide well. ;)

DG

  • Guest
probably should have put this in from the start...  ;)

this is the control script with the timer/score removed ( they are not needed


?!(local Server): exit

_flag = _this select 0
_side = _this select 1

#start
~1
?(_side == West): _ar = WestArray
?(_side == East): _ar = EastArray
?!(_flag in _ar): exit

goto "start"

---- here is the capture script with the afore mentioned edit

_flag = _this select 0
_side = _this select 1

?(_flag == RussianAFB): _msg = "Russian Air Base"
?(_flag == Modrava): _msg = "Modrava"
?(_flag == Kvilda): _msg = "Kvilda"
?(_flag == Trosky): _msg = "Trosky"
?(_flag == Mokropsy): _msg = "Mokropsy"
?(_flag == Loukov): _msg = "Loukov"
?(_flag == Petrovice): _msg = "Petrovice"
?(_flag == Lipany): _msg = "Lipany"
?(_flag == Davle): _msg = "Davle"
?(_flag == AmericanAFB): _msg = "American Air Base"

?(_side == WEST): goto "West"
?(_side == EAST): goto "East"
exit

#West
?!(local Server): goto "Westclient"
WestArray = WestArray + [_flag]
EastArray = EastArray - [_flag]
#Westclient
(flagOwner _flag) setflagowner objNULL
_flag setflagowner objNULL
~0.2
_flag setflagtexture "usa_vlajka.pac"
_flag setflagside WEST
titletext [format["%1 %2","NATO Forces capture ", _msg], "PLAIN DOWN"]
goto "end"

#East
?!(local Server): goto "Eastclient"
EastArray = EastArray + [_flag]
WestArray = WestArray - [_flag]
#Eastclient
(flagOwner _flag) setflagowner objNull
_flag setflagowner objNull
~0.2
_flag setflagtexture "rus_vlajka.pac"
_flag setflagside EAST
titletext [format["%1 %2","Russian Forces capture ", _msg], "PLAIN DOWN"]
goto "end"

#end
?(local Server): [_flag, _side] exec "control.sqs"
~1.5
Exit

(based on scripts originally created by BackOff )


cheers guys

DG

  • Guest
well , solved half of the problem .. got the array to display the flags captured by each team however still stuck on the "array conditional" for ending the game.

 if you have any past examples of this type or any ideas please post'em

 cheers all

DG

  • Guest
I got it , You can close this know Mod's.... what a mongrel of a problem!!! , I will make a Tutourial if anyone is interested.

 cheers All


Pope_Zog

  • Guest
Instead of closing it for you, why not click the Solved button? That way it could be added to the Editor's Depot - well, assuming it belongs there :)

Pope Zog