Home   Help Search Login Register  

Author Topic: Grrrr... Markers in MP  (Read 1119 times)

0 Members and 1 Guest are viewing this topic.

Offline Blanco

  • Former Staff
  • ****
Grrrr... Markers in MP
« on: 14 Jul 2003, 19:07:04 »
Hello, I'm struggling for a long time with this so I decided to ask some advice here...

I'm working on a regular CTF map but I tried to add something funny into it...with no succes... :-\

Every flag is equiped with a tracking device, It should start 120 sec after the flag's capped. Via a marker om the map the flagrunner should be visible for every player during 2 minutes. When the flagcapper dies the marker become "empty". When a teammate cap it back from his dead teammate the tracking start aigain after 120 seconds..

Everything works exept the markers.  >:(

On the map there are two "empty" markers named "wflagr" & "Eflagr"

Here is the code...

First in the init.sqs I defined some global variables...

Quote
FLAGRETURNDELAY = 60
FLAGRETURNLIMIT = 360
EFlaginWszone=false
WFlaginEszone=false

STARTTRACKING = 120
STOPTRACKING = 240

The CTF script for the EASTflag

Quote

EFlag SetFlagSide East
EFlag setflagtexture "mdsflag.jpg"
EFlag setFlagOwner objNull
c2 = FLAGRETURNLIMIT
c1 = 0
goto "start"

#start
~0.5

c3 = 0
"Wflagr" setmarkerpos [0,0];"Wflagr" setmarkertype "empty"
WFlagrunner = FLAGOWNER EFlag
?(c2 == 0):goto "FLAGRETURN"
?(isnull WFlagrunner ):Goto "START"
?(Alive WFlagrunner ):Goto "FLAGTAKEN"
?!(Alive WFlagrunner ):Goto "DEADHASFLAG"



#FLAGTAKEN
?(Side Player==West):titletext[format["%1 has taken East's Flag!",name WFlagrunner],"PLAIN DOWN"]
?(Side Player==East):titletext[format["%1 has taken our Flag",name WFlagrunner],"PLAIN DOWN"]
c3=0
Goto "LOOP"

#LOOP
~1
Wflagrpos = getpos Wflagrunner;publicvariable "Wflagrpos"
?(!Alive WFlagrunner):goto "DEADHASFLAG"
?(isnull Flagowner WFlag) and WFlagrunner distance WFlag<5:goto "WCaps"
?(c2 == 0):goto "FLAGRETURN"
;;These messages doens't show up on the screen... why???

?(local Server)&&(c3 == STARTTRACKING) : Titletext ["\n\nTRACKING DEVICE ENABLED","PLAIN DOWN"]
?(local Server)&&(c3 == STOPTRACKING) : Titletext ["\n\nTRACKING DEVICE DISABLED","PLAIN DOWN"]
?(local Server)&&(c3 >= STARTTRACKING && c3 <= STOPTRACKING):"Wflagr" setmarkertype "flag1";"Wflagr" setmarkerpos Wflagrpos

?(local Server)&&(c3 == STOPTRACKING):"Wflagr" setmarkerpos [0,0];"Wflagr" setmarkertype "empty"

c2 = c2 - 1
c3 = c3 + 1

Goto "LOOP"

#WCaps
"Wflagr" setmarkerpos [0,0];"Wflagr" setmarkertype "empty";c3=0;c2=FLAGRETURNLIMIT
?(Side Player == West):titletext[format["%1 has capped East's Flag!",name WFlagrunner],"PLAIN DOWN"]
?(Side Player == East):titletext[format["%1 has capped our flag",name WFlagrunner],"PLAIN DOWN"]
?(local Server):westflags = westflags + 1; westscore = westscore + 2
Goto "FLAGRETURN"


#FlagReturn
EFlaginWszone=false
c1=0
c2=FLAGRETURNLIMIT
c3=0
EFlag SetFlagSide East
"Wflagr" setmarkertype "empty";"Wflagr" setmarkerpos [0,0]
hint "East's Flag has been returned"
EFlag setFlagOwner objNull  
Goto "start"

#DEADHASFLAG
?(EFlaginWszone):goto "Flagreturn"
c1=0
"Wflagr" setmarkertype "empty";"Wflagr" setmarkerpos [0,0]
WFlagrunner = FLAGOWNER EFlag
?(local Server)&&(c3 >= STARTTRACKING && c3 <= STOPTRACKING): Titletext ["\nTRACKING DEVICE DISABLED","PLAIN DOWN"]
?(!Alive WFlagrunner)&&(Side Player == West)&& !(player==Wflagrunner):titletext[format["The flagcapper is dead. We have %1 seconds to tak it back",FLAGRETURNDELAY],"PLAIN DOWN"]
?(!Alive WFlagrunner)&&(Side Player == EAST):titletext[format["The enemy flagrunner is dead!"],"PLAIN DOWN"]

#deadloop
~1
c1 = c1 + 1
Wflagrpos = getpos Wflagrunner;publicvariable "Wflagrpos"
WFlagrunner = FLAGOWNER EFlag
?(local Server)&&(c2 == 0):goto "FLAGRETURN"
?(Alive WFlagrunner):goto "start"
?(c1 == FLAGRETURNDELAY):goto "FLAGRETURN"
goto "DEADLOOP"


And a mirrored version for the Westflag off course...

Everything works great when I start my own server, but it doesn't on a dedicated one.

The c1,c2 & c3 are global cos I used them in a hint format to check they're working. They did.

If someone can find why those damn markers doesn't work  I would him thankfull for eternity :-)
 
The position of the flagcapper... I used a publicvariable for it but I don't know this is the right way to do it, and is it nessecary?

Desperate seeking Blanco thanks u



 
 

 

Search or search or search before you ask.

Offline Terox

  • Former Staff
  • ****
  • Follow the Sappers!
    • zeus-community.net
Re:Grrrr... Markers in MP
« Reply #1 on: 17 Jul 2003, 21:33:03 »
This script looks familiar :-)

setmarkerpos (getpos WFlagrunner) or something like that

It would have to loop say every second so that it updates its position.

What i would do is have a Flagpos.sqs script enabled when the flag is taken
Have the script start with a  looping delay to delay activating the marker and during the loops have it check if WFlag is still with flagrunner, if it isnt then exit, if it is loop and every 1 second "setmarkerpos getpos"
« Last Edit: 17 Jul 2003, 21:38:09 by Terox »
Zeus ARMA2 server IP = 77.74.193.124 :2302
Teamspeak IP = 77.74.193.123