Home   Help Search Login Register  

Author Topic: CTF Help  (Read 1648 times)

0 Members and 3 Guests are viewing this topic.

Glitchx0x

  • Guest
CTF Help
« on: 23 Apr 2004, 20:00:39 »
Hi i'v be following a tuturiol on making a CTF map and i'v made the basics, so it all works but i would like to add sounds and text to when the flag is taken, at the moment i can only make sounds and text when u score a point using the trigger. ;D

Offline Terox

  • Former Staff
  • ****
  • Follow the Sappers!
    • zeus-community.net
Re:CTF Help
« Reply #1 on: 25 Apr 2004, 13:49:18 »
try being a bit more specific, like showing the section of code where your want your titltext message and sounds etc

example of how to place a titletext message in a script

Quote
EFlagrunner = Flagowner EFlag
?(Side Player==West):titletext[format["%1 has East's Flag!",name EFlagrunner],"PLAIN DOWN"];PlaySound "fanfare"


you would place the soundfile "fanfare" in your missions "sound" folder

and your description.ext entry would look like the following
Quote
class CfgSounds
{
   sounds[] =  { fanfare };
   
   class fanfare
   {
      name = "fanfare";
      sound[] = {"zft\sound\fanfare.ogg", 10, 1.0};
      titles[] = {   };
   };
};
« Last Edit: 25 Apr 2004, 13:50:11 by Terox »
Zeus ARMA2 server IP = 77.74.193.124 :2302
Teamspeak IP = 77.74.193.123

Glitchx0x

  • Guest
Re:CTF Help
« Reply #2 on: 25 Apr 2004, 14:19:27 »
This is my script that makes it all work:
Quote
; capture.sqs line 1
_side = _this select 0
; capture.sqs line 2
?!(local Server): goto "client"
; capture.sqs lines 3-4
?(_side == WEST): WestScore = WestScore + 1; PublicVariable "WestScore"
?(_side == EAST): EastScore = EastScore + 1; PublicVariable "EastScore"
; capture.sqs line 5
#client
; capture.sqs lines 6-7
?(_side == WEST): goto "wclient"
?(_side == EAST): goto "eclient"
; capture.sqs line 8
#wclient
; capture.sqs lines 9-10
eastflag setFlagOwner objNull
(flagOwner eastflag) setFlagOwner objNull
; capture.sqs line 11
titleText ["West captured the flag!", "PLAIN DOWN"]
; capture.sqs line 12
goto "end"
; capture.sqs lines 13-16
#eclient
westflag setFlagOwner objNull
(flagOwner westflag) setFlagOwner objNull
titleText ["East captured the flag!", "PLAIN DOWN"]
; capture.sqs line 17
#end
; capture.sqs line 18
~10
#end
; capture.sqs line 19
titleText [format["West:  %1  East: %2", WestScore, EastScore], "PLAIN DOWN"]
; capture.sqs line 20
exit

I can change the text displayed when your score from this script, but i can only add sound using the trigger that init this script. I would like to make it so i can create sound and text saying when the flag has been stolen, not just when someone scores.

Incase you need it heres the code for the sound:
Quote
class CfgMusic
{
   // List of music tracks (.ogg files without the .ogg extension)
   tracks[] = {oh_crap, simp193, Track07};

   // Class definition needed for each music track
   class oh_crap
   {
      // Name to display in mission editor
      name = "oh_crap";
      // Music path, volume, pitch
      sound[] = {\music\oh_crap.ogg, db + 0, 1.0};
   };
   class simp193
   {
      // Name to display in mission editor
      name = "simp193";
      // Music path, volume, pitch
      sound[] = {\music\simp193.ogg, db + 0, 1.0};
   };
   class Track07
   {
      // Name to display in mission editor
      name = "Track07";
      // Music path, volume, pitch
      sound[] = {\music\Track07.ogg, db + 0, 1.0};
   };
};

Offline myke13021

  • Contributing Member
  • **
  • Myke
Re:CTF Help
« Reply #3 on: 25 Apr 2004, 17:04:37 »
uhm...i think this would work...u need 2 more triggers.

let's begin with the first.

Size = 0
Activated = anybody repeatedly
Condition = !isNull (flagOwner eastflag) AND side (flagOwner eastflag) == WEST
On Activation = [WEST] exec "message.sqs"

Make the second trigger the same as the first, just replace each "east" with "west" and vice versa.

Now to the script...you need a new one, since the one which you already have is executed too late (when you're already at your own flag)

Code: [Select]
;message.sqs

_side = _this select 0

?(_side == WEST): _flag = "East Flag"
?(_side == EAST): _flag = "West Flag"

_msg = format ["%1 has taken %2", _name flagowner, _flag]
titletext [_msg, "PLAIN DOWN"]
playsound "mysoundname"
exit

This is untested and right out of my mind...which isn't always running smooth ;D

Glitchx0x

  • Guest
Re:CTF Help
« Reply #4 on: 25 Apr 2004, 17:50:05 »
I'v tried what your said terox and all i get when i take the flag is:
Quote
'titletext [_msg, "PLAIN DOWN"]|#|': Error Typr Any, expected string
at the top of the screen in white.

Offline myke13021

  • Contributing Member
  • **
  • Myke
Re:CTF Help
« Reply #5 on: 25 Apr 2004, 18:30:36 »
then try this:

Code: [Select]
;message.sqs

_side = _this select 0

?(_side == WEST): _flag = "East Flag"
?(_side == EAST): _flag = "West Flag"

titletext[format["%1 has %2!",name flagowner, _flag],"PLAIN DOWN"]
playsound "mysoundname"
exit

Glitchx0x

  • Guest
Re:CTF Help
« Reply #6 on: 25 Apr 2004, 19:13:47 »
thats got the sound working but i'm still getting a error message so it dusnt display any text. :-[