Home   Help Search Login Register  

Author Topic: Flag Carriers Name Appearing on Bottom  (Read 1081 times)

0 Members and 1 Guest are viewing this topic.

atamanch

  • Guest
Flag Carriers Name Appearing on Bottom
« on: 28 Jul 2003, 23:18:03 »
Hi, i've tried searching for this topic but haven't found anything, I tried a tutorial by Backoff for a Flagfight but it didn't work for me. Heres my problem, I have made a full blown CTF all ready to rock...but whenever you take the flag, nothing hapens... my 2 flags are named WestFlag and EastFlag. I'd like my custom sound to play when someone takes them, but have no idea how to write a Condition or On Activation Script for the Capture Trigger..someone help, thanks. ;D
« Last Edit: 28 Jul 2003, 23:19:16 by atamanch »

Offline Terox

  • Former Staff
  • ****
  • Follow the Sappers!
    • zeus-community.net
Re:Flag Carriers Name Appearing on Bottom
« Reply #1 on: 28 Jul 2003, 23:42:53 »
Heres a script i use in the new EFL CTF map template
It should give u an idea.
Requires no triggers, just two flags called EFlag and WFlag

Here's the EFlag script
Executed from the init.sqs using the following line
[] exec "EFlag.sqs"
_____________________________________________________________________________
;;;;;;;; ________ DO NOT EDIT THIS SCRIPT ________ ;;;;;;;;
;;CTF Script for East's flag
;;Name East flag EFlag
;;Local and global variables have been reduced to a minimum to reduce memory storage
?(isnull EFlag):hint "Object EFlag does not exist";goto "DeBug"
EFlag SetFlagSide East
EFlag setflagtexture "rus_vlajka.pac"  
EFlag setFlagOwner objNull
goto "start"

#start
~0.5
EFlagrunner = FLAGOWNER EFlag
?(isnull EFlagrunner ):Goto "START"
?(Alive EFlagrunner ):Goto "FLAGTAKEN"
?!(Alive EFlagrunner ):Goto "DEADHASFLAG"
hint "Debug: Eflag_ctf/start section":goto "DEBUG"


#FLAGTAKEN
?(Side Player==West):titletext[format["%1 has East's Flag!",name EFlagrunner],"PLAIN DOWN"];PlaySound "fanfare"
;;?(Side Player==East):titletext[format["Our Flag is missing"],"PLAIN DOWN"];PlaySound "fanfare"
;;Following line is used for a special script used in EFL
?(EFlagrun):[]exec "ctf\Eflagtouch_control.sqs"
Goto "LOOP"

#LOOP
~0.5
?!(Alive EFlagrunner):goto "DEADHASFLAG"  
?(isnull Flagowner WFlag) and EFlagrunner distance WFlag<5:goto "WCaps"  
Goto "LOOP"

#WCaps
?(Side Player == West):titletext[format["%1 capped a flag!",name EFlagrunner],"PLAIN DOWN"]
?(Side Player == East):titletext[format["The enemy has scored"],"PLAIN DOWN"]
PlaySound "gong"
?(local Server):WScore = WScore + ctf_Score; PublicVariable "WScore"
Goto "ShowScore"

#ShowScore
?(local Server):ShowScore=true; PublicVariable "ShowScore"
Goto "FLAGRETURN"

#FlagReturn
?(local Server):EFlagrun = true; PublicVariable "EFlagrun"
;;Following line is used in conjunction with a trigger to reset a bolean caused by flagrunner  in a safezone)
EFlaginsafezone = false
EFlag SetFlagSide East
hint format ["East's Flag \n has been returned"]
EFlag setFlagOwner objNull  

Goto "start"

#DEADHASFLAG
?(EFlaginsafezone):goto "Flagreturn"
_count = 1
;EFlagrunner = FLAGOWNER EFlag
?(!Alive EFlagrunner)&&(Side Player == West)&& !(player==EFlagrunner):titletext[format["Our Flagrunner is dead\nWe have %1 seconds to retrieve it",FLAGRETURNDELAY],"PLAIN DOWN"]
?!(Alive EFlagrunner)&&(Side Player == EAST):titletext[format["Enemy flagrunner is dead!"],"PLAIN DOWN"]
#deadloop
~0.5
_count = _count + 0.5
EFlagrunner = FLAGOWNER EFlag
?(Alive EFlagrunner ):goto "start"
?(_count == FLAGRETURNDELAY):goto "FLAGRETURN"
goto "DEADLOOP"

 
#Debug
~5
hint "Eflag_CTF script exiting"
goto "END"
 
#end
Exit
______________________________________________________________________________
The global variables used in the script are stated in the init.sqs

These are

FLAGRETURNDELAY = 120 (Amount of times in seconds before the flag is returned from a dead flagrunner)

ctf_Score = 3 (Points awarded for a succesful ctf flag run)

EFlaginsafezone (This is a boolean basically used to return the flag immediately should the flagrunner run into a safezone, it is used with a trigger, which if you are interested can be extracted by getting any of the new efl ctf maps and de pbo'ing it

?(local Server):EFlagrun = true; PublicVariable "EFlagrun"
The above line is of no use to you, its used to run a bonus points system for flag run attempts






The above is just one of many ways of doing a ctf system, there may be different scripts better suited to your needs


Hope this was of help to ya
Zeus ARMA2 server IP = 77.74.193.124 :2302
Teamspeak IP = 77.74.193.123