Blockland Forums > Suggestions & Requests
[Default suggestion] customizable colored names [repost caus topic 2 old 2 bump]
(1/1)
gr8dayseth:
http://forum.blockland.us/index.php?topic=238699.0
I did this topic a while back, but no one even replied. So...
Here it is again.


--- Quote ---What I mean is, adding a drop-down to the avatar selection screen that has all the colors of names you can have.
When they're not in a minigame, their colored name will be there. heh, just used all 3 theres in one sentence.
When they're in a dm, it will also be there.
When someone kills another in a dm, both colored names will be there.
But in a tdm, it's only the color of the team.

So /discuss
--- End quote ---
Duhman115:
So, like, a client sided Swain/Swain/Swain thing that's default, shows in chat, AND in minigames, not just above the player?
gr8dayseth:
Yup, pretty much.

I realized how much I felt like wanting it when watching one of the vids I took of my dm server.
Every kill message being completely red is weird to me.

Plus the chat and names above heads are cool as well.

Hey, maybe for now, a script or something that randomizes each player a color?
Port:

--- Quote from: gr8dayseth on October 06, 2013, 01:36:42 AM ---Hey, maybe for now, a script or something that randomizes each player a color?

--- End quote ---

Untested, but should work:

package RandomNameColors {
   function GameConnection::spawnPlayer(%this) {
      Parent::spawnPlayer(%this);

      if (isObject(%this.player) && %this.player.getShapeNameColor() $= "1 1 1") {
         %this.player.setShapeNameColor(hueToRGB(getRandom()));
      }
   }
};

activatePackage("RandomNameColors");

function hueToRGB(%hue) {
   %i = mFloor(%hue * 6);
   %f = %hue * 6 - %i;

   switch (%i) {
      case 0: return 1      SPC %f     SPC 0     ;
      case 1: return 1 - %f SPC 1      SPC 0     ;
      case 2: return 0      SPC 1      SPC t     ;
      case 3: return 0      SPC 1 - %f SPC 1     ;
      case 4: return %f     SPC 0      SPC 1     ;
      case 5: return 1      SPC 0      SPC 1 - %f;
   }

   return "0 0 0";
}
Navigation
Message Index

Go to full version