VadaVaka
Colour Switch - Printable Version

+- VadaVaka (https://vadavaka.com/forums)
+-- Forum: General Forums (https://vadavaka.com/forums/forumdisplay.php?fid=5)
+--- Forum: IT-Geeks Hang Out (https://vadavaka.com/forums/forumdisplay.php?fid=42)
+---- Forum: Programming (https://vadavaka.com/forums/forumdisplay.php?fid=27)
+---- Thread: Colour Switch (/showthread.php?tid=4161)



Colour Switch - Wha? - 09-04-2005

If you play DM, you're well aware of the seventh player who is indistinguishable from the first. I did some digging through the source, and there's no way to *fix* this; though there is a painless workaround.

These are the disc colours:
Code:
//disc_weapon_disc.cpp, line 32


float g_iaDiscColors[33][3] =
{
    { 255, 255, 255, },
    { 250, 0, 0 },
    { 0, 0, 250 },
    { 0, 250, 0 },
    { 128, 128, 0 },
    { 128, 0, 128 },
    { 0, 128, 128 },
    { 128, 128, 128 },
    { 64, 128, 0 },
    { 128, 64, 0 },
    { 128, 0, 64 },
    { 64, 0, 128 },
    { 0, 64, 128 },
    { 64, 64, 128 },
    { 128, 64, 64 },
    { 64, 128, 64 },
    { 128, 128, 64 },
    { 128, 64, 128 },
    { 64, 128, 128 },
    { 250, 128, 0 },
    { 128, 250, 0 },
    { 128, 0, 250 },
    { 250, 0, 128 },
    { 0, 250, 128 },
    { 250, 250, 128 },
    { 250, 128, 250 },
    { 128, 250, 250 },
    { 250, 128, 64 },
    { 250, 64, 128 },
    { 128, 250, 64 },
    { 64, 128, 250 },
    { 128, 64, 250 },
};
And this is how they map out:
NOTE: g_iaDiscColors[32][] is left empty. Not sure why, or what happens to player 32.


Colour Switch - Wha? - 09-04-2005

What I propose is swapping the colour in slot 19 for the colour in slot 7. The other colours relevant to a player are generated with a calculation done on the appropriate disc colour, so it should be seamless.

Since there are only 12 slots, any colour above that is fair game.

No, it doesn't solve the problem of identical-looking players on servers with higher max player counts, but it does make it less common.

Code:
float g_iaDiscColors[33][3] =
{
    { 255, 255, 255, },
    { 250, 0, 0 },
    { 0, 0, 250 },
    { 0, 250, 0 },
    { 128, 128, 0 },
    { 128, 0, 128 },
    { 0, 128, 128 },
    { 250, 128, 0 },
    { 64, 128, 0 },
    { 128, 64, 0 },
    { 128, 0, 64 },
    { 64, 0, 128 },
    { 0, 64, 128 },
    { 64, 64, 128 },
    { 128, 64, 64 },
    { 64, 128, 64 },
    { 128, 128, 64 },
    { 128, 64, 128 },
    { 64, 128, 128 },
    { 128, 128, 128},
    { 128, 250, 0 },
    { 128, 0, 250 },
    { 250, 0, 128 },
    { 0, 250, 128 },
    { 250, 250, 128 },
    { 250, 128, 250 },
    { 128, 250, 250 },
    { 250, 128, 64 },
    { 250, 64, 128 },
    { 128, 250, 64 },
    { 64, 128, 250 },
    { 128, 64, 250 },
};



Colour Switch - GRITS - 09-04-2005

amazing


B)


Colour Switch - Wha? - 09-04-2005

This is how player colours map out. Each swatch is divided into topcolor and bottomcolor (intuitive). As you can see, 19 is the same as 9, so that's a no go.

Turns out that there are virtually no unique colours. These are the matching ones:
[*]0, 1, 7, 14
[*]2, 13
[*]3, 15
[*]4, 16, 24
[*]5, 17, 25
[*]6, 18, 26
[*]8, 20
[*]9, 19
[*]10, 22
[*]11, 21

And these are unique (though some may be a little tough to tell):
[*]12, 23, 27, 28, 29, 30, 31



[Image: post-16-1125887165.jpg]


Colour Switch - Wha? - 09-05-2005

Did some more digging and it appears as though the client chooses the colour a player (and their team on the scoreboard) should be, even though the server sets the colour of the discs.

Oh well.


Colour Switch - Wha? - 09-05-2005

Scratch that. I looked a little harder, and it called on the same disc colour array, so I did a search for it. Lo and behold cl_dll.dll includes a few files from mp.dll; one of which is disc_weapon_disc.cpp. Just needed to rebuild the client dll.

Best part is that you can still play on the servers (not sure about servers with VAC).

Now... the weird part is that it defaults to third person on my HLDS. It doesn't seem to default elsewhere, but you can still use it. Guess the SDK dll supports it.

I have yet to settle on a colour to use for team 7, since 23 was a little close to green and teal.


Colour Switch - Miagi - 09-05-2005

I think I left my 3rd person code in the client code:P. Didn't think people would want to compile that since the servers are not suppose to allow you to use your own version... But I don't know how you were able to play on other servers...


Colour Switch - Wha? - 09-05-2005

Well, it does.. spooky, huh?

*NOTE* This is on Vad's, so the skin is red (since it isn't patched). That's why I have the scoreboard open. I used colour 30 for team 1.


Colour Switch - Miagi - 09-05-2005

I have noooo idea what valve changed in the hlds, but now my thirdperson code can work since we can use a custom client.dll now. Woot.

I'm glad I left the code in there..


Colour Switch - Pique - 09-05-2005

i was thinking about that back when we did the steam/won fix

we switched the clients from steam and won, and if i remember right they were different sizes too...

are custom clients allowed in ricochet?


Colour Switch - Wha? - 09-05-2005

This will resolve the team 7 issue.

Code:
float g_iaDiscColors[33][3] =
{
    { 255, 255, 255, },
    { 250, 0, 0 },
    { 0, 0, 250 },
    { 0, 250, 0 },
    { 128, 128, 0 },
    { 128, 0, 128 },
    { 0, 128, 128 },
    { 250, 160, 0 },//{ 128, 128, 128 },
    { 64, 128, 0 },
    { 0, 250, 128 },//{ 128, 64, 0 },
    { 128, 0, 64 },
    { 64, 0, 128 },
    { 0, 64, 128 },//12
    { 64, 64, 128 },
    { 128, 64, 64 },
    { 64, 128, 64 },
    { 128, 128, 64 },
    { 128, 64, 128 },
    { 64, 128, 128 },
    { 250, 128, 0 },
    { 128, 250, 0 },
    { 128, 0, 250 },
    { 250, 0, 128 },
    { 128, 128, 128 },//{ 0, 250, 128 }, //23
    { 250, 250, 128 },
    { 250, 128, 250 },
    { 128, 250, 250 },
    { 250, 128, 64 },//27
    { 250, 64, 128 },//28
    { 128, 250, 64 },//29
    { 64, 128, 250 },//30
    { 128, 64, 250 },//31
};



Colour Switch - Gump - 09-06-2005

:blink:
this is precisely why I'm not studying code, thank god I picked hardware instead


Colour Switch - GRITS - 09-06-2005

geeks:wub:

gotta luv em :heartbeat:


Colour Switch - Wha? - 09-16-2005

This is the client.dll that gets built.