HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

local player and unit's player color

08-06-2006, 04:15 AM#1
Linera
Is it possible without a desync or crash to set a unit's player color (not ownership) for a player

For example: player 1 sees unit A as red
while
player 2 sees unit A as blue


or is this gonna cause a desync or crash?
08-06-2006, 04:24 AM#2
Rising_Dusk
I've never experimented with it, but since you're not creating a handle...
It very well might work.

My recommendation: Try it
08-06-2006, 04:32 AM#3
vile
IMO its going to desync like hell, player colors arent supposed to be changed only for 1 player. Notice that when you change ally colors next to the minimap buttons, all players get the same colors and see the same things that you see. This was for a reason IMO.
08-06-2006, 04:35 AM#4
Linera
Quote:
Originally Posted by Rising_Dusk
I've never experimented with it, but since you're not creating a handle...
It very well might work.

My recommendation: Try it

I'll give it a try.
08-06-2006, 04:45 AM#5
Vexorian
Quote:
Originally Posted by vile
IMO its going to desync like hell, player colors arent supposed to be changed only for 1 player. Notice that when you change ally colors next to the minimap buttons, all players get the same colors and see the same things that you see. This was for a reason IMO.
I think it is to prevent desyncs when checking the ally color filter state with triggers
08-06-2006, 05:07 AM#6
BDSM
Entirely possible. Putting SetUnitColor and SetPlayerColor inside a GetLocalPlayer block does not cause a desync.

I use a system to let players change the color of other players (and in turn their units). If this is what you want, note that SetPlayerColor only affects the player color and color of newly created units, you would want to use SetUnitColor on all existing units of a player. To do this, just enumerate a group with all unit's belonging to the player you want to change the color of, then change each unit. Of course making sure that the SetUnitColor/SetPlayerColor are in a GetLocalPlayer block (otherwise it will change for all players).
08-06-2006, 05:32 AM#7
Linera
What I'm planning to do is use for showing con colors.

i know that nobody knows what con colors are...
Don't worry about that.
08-07-2006, 03:04 AM#8
Linera
This reply is to let people know that this works and with no desyncs

I included a map to show it off.
Attached Files
File type: w3xunit color test map.w3x (16.4 KB)