HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

A simple question about locals.

01-09-2006, 11:25 PM#1
paidan_fain
Can i safely locally define a real value in a multiplayer map without server splits? My purpose is that I want to create a floating text that appears red to the defender and blue for the attacker.

Thx
01-09-2006, 11:35 PM#2
Zoxc
You can't create floating texts local, but you can hide/show them. Then create 2 floating texts use GetLocalPlayer() to show/hide them.
01-09-2006, 11:36 PM#3
paidan_fain
Ya but i was thinking that instead of creating two different floating texts, i could use a locally defined real value(s) to represent the rgb values of a single floating text.
01-09-2006, 11:52 PM#4
Earth-Fury
Quote:
Originally Posted by paidan_fain
Ya but i was thinking that instead of creating two different floating texts, i could use a locally defined real value(s) to represent the rgb values of a single floating text.

erm, how? :-/ a local variable is a variable to local to a function. (a trigger) not a player. theirfore, how would you use a local real variable to define diffrent text colours without the use of getlocalplayer?
01-10-2006, 02:57 AM#5
PitzerMike
I think he meant local as in for the local player. And I think that it might even work without server splits.

Collapse JASS:
local real r
if GetLocalPlayer() == whichPlayer then
    set r = 0
else
    set r = 255
endif
set t = CreateTextTag(......., r)

You will have to try this on bnet to see if it really doesn't desync but i think chances are good.
01-10-2006, 12:39 PM#6
iNfraNe
This would also work with different textmsg and even with different positions on the screen I think. Better performancewize maybe? :P
01-10-2006, 05:45 PM#7
Zoxc
Collapse JASS:
native SetTextTagColor takes texttag t, integer red, integer green, integer blue, integer alpha returns nothing

You might be able to use this locally :)