Home   Help Search Login Register  

Author Topic: A simple question for hard solutions  (Read 460 times)

0 Members and 1 Guest are viewing this topic.

mcnils

  • Guest
A simple question for hard solutions
« on: 15 Feb 2003, 07:12:47 »
err... or something like that.. lolz


This thing is hard to explain for me since im not english speaking...
so dont send me to hell if you dont understand a ****.


I have much markers in my C&H mission, i need to make them change color often
(one marker may be red, then green, then switch again to red etc.),
so i tought (yes sometimes it happens to me that i think, woah) it would be good
to not create every time a single script for changing color to one specific marker,
but to create one singular script that can handle 'em all, and since its a C&H,
i tought to implement this thing in the already existent Capture.sqs.


Now i doo this like that,
the only thing i need to change every time is in the line that calls the script,
i make an example:


If marker's name is obj2 and sector is taken by west, script launch in the init field of the trigger would be like that:

Code: [Select]
[flag2,WEST,"West now controls flag2!",obj2] exec "Capture.sqs"
If marker's name is obj5 and east has conquered the sector:

Code: [Select]
[flag5,EAST,"East now controls flag5!",obj5] exec "Capture.sqs"


Now to the Capture.sqs, it looks like that:

Code: [Select]
_flag = _this select 0
_side = _this select 1
_msg = _this select 2
_mark = _this select 3

?(_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 "usa_vlajka.pac"
_flag setflagside WEST
titleText [_msg, "PLAIN"]
"_mark" setMarkerColor "ColorGreen"
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
titleText [_msg, "PLAIN"]
"_mark" setMarkerColor "ColorRed"
goto "end"

#end
?(local Server): [_flag, _side] exec "control.sqs"
~1.5
hint format["West: %1\nEast: %2", WestScore, EastScore]
Exit


Now, titletext is displaying, the flags texture changes correctly,
all works fine, all except the marker color change, it does not change...
what the heck i do wrong here?! :help:
« Last Edit: 15 Feb 2003, 07:31:33 by mcnils »

Offline LCD

  • Former Staff
  • ****
    • Everon Cartel
Re:A simple question for hard solutions
« Reply #1 on: 15 Feb 2003, 14:26:37 »
its very simple :P

u dont put "" around da marker name in da script (all da "_mark" should b _mark)

and 2 exec u put "" around da marker name so it looks like dat

[flag2,WEST,"West now controls flag2!","obj2"] exec "Capture.sqs"

LCD OUT
"guess being the community has downsides .." - cheetah
Help Perfecting Da Next Best Thing - O-Team Beta

mcnils

  • Guest
Re:A simple question for hard solutions
« Reply #2 on: 16 Feb 2003, 03:05:52 »


Ill try this, I LOVE YOU LCD, LOL (ehm.. lolol  :P )

mcnils

  • Guest
Re:A simple question for hard solutions
« Reply #3 on: 16 Feb 2003, 03:10:57 »

It works!


OH YEAHHHHHHHHHHHHHHHHHHHHHHHHHH ~~~~~ loool


* happy like ****  ;D *
topic solved :)