- Joined
- Apr 10, 2009
- Messages
- 380
Coloured Name
Well, this is a simple tutorial, that will teach you how to make a player name when display in a text will become coloured. This tutorial is simple, but it is good enough to learn something from it.
Firstly, have you all ever seen a text like this?
Yes? Well, have you think how to make the name become coloured? Well, I'll teach how to make it in this tutorial. Without it, the text will be just like this:
Enough of talking now, let's get started. Before that, prepare a string-type array variable, I named it "PlayerName"
Triggers:
There is bad way and good way of doing this.
Good Way:
I'll show you the good way, it only need 2 triggers and it's MPI.
First, we need to do the settings first:
Since this tutorial is about coloured names, I will show you the codes too:
Red: |CFFFF0303 |R
Blue: |CFF0042FF |R
Teal: |CFF1BE6D8 |R
Purple: |CFF540081 |R
Yellow: |CFFFFFF01 |R
Orange: |CFFFE8A0E |R
Green: |CFF20C000 |R
Pink: |CFFE55BB0 |R
Grey: |CFF959697 |R
Light Blue: |CFF7EBFF1 |R
Dark Green: |CFF106246 |R
Brown: |CFF4E2A04 |R
Neutral: |CFF272727 |R
Okay now, the next trigger will occurred when a unit of hero-type dies:
In the sentence, you can see there is "for |cffffcc00250|r Gold!". That one is optional, simply remove it by replacing "(PlayerName[(Player number of (Owner of (Dying unit)))] + for |cffffcc00250|r gold!!!!)))" into "(PlayerName[(Player number of (Owner of (Dying unit)))] + !!!"
NOTE: Variables won't automatically put spacebars for you, so you have to set it manually, like using concatenate strings to put spacebar after the variable. I won't show you the bad way because it might confuse your mind and is probably not MPI. Now you are done! Good luck in triggering!
Well, this is a simple tutorial, that will teach you how to make a player name when display in a text will become coloured. This tutorial is simple, but it is good enough to learn something from it.
Firstly, have you all ever seen a text like this?
Yes? Well, have you think how to make the name become coloured? Well, I'll teach how to make it in this tutorial. Without it, the text will be just like this:
Enough of talking now, let's get started. Before that, prepare a string-type array variable, I named it "PlayerName"
Triggers:
There is bad way and good way of doing this.
Good Way:
I'll show you the good way, it only need 2 triggers and it's MPI.
First, we need to do the settings first:
-
Players Option
-
Events
- Map initialization
- Conditions
-
Actions
- Set PlayerName[1] = ((|CFFFF0303 + (Name of Player 1 (Red))) + |r)
- Set PlayerName[2] = ((|CFF0042FF + (Name of Player 2 (Blue))) + |r)
- Set PlayerName[3] = ((|CFF1BE6D8 + (Name of Player 3 (Teal))) + |r)
- Set PlayerName[4] = ((|CFF540081 + (Name of Player 4 (Purple))) + |r)
- Set PlayerName[5] = ((|CFFFFFF01 + (Name of Player 5 (Yellow))) + |r)
- Set PlayerName[6] = ((|CFFFE8A0E + (Name of Player 6 (Orange))) + |r)
- Set PlayerName[7] = ((|CFF20C000 + (Name of Player 7 (Green))) + |r)
- Set PlayerName[8] = ((|CFFE55BB0 + (Name of Player 8 (Pink))) + |r)
- Set PlayerName[9] = ((|CFF959697 + (Name of Player 9 (Gray))) + |r)
- Set PlayerName[10] = ((|CFF7EBFF1 + (Name of Player 10 (Light Blue))) + |r)
- Set PlayerName[11] = ((|CFF106246 + (Name of Player 11 (Dark Green))) + |r)
- Set PlayerName[12] = ((|CFF4E2A04 + (Name of Player 12 (Brown))) + |r)
- Set PlayerName[13] = (|cff272727 + (Neutral Hostile + |r))
-
Events
Since this tutorial is about coloured names, I will show you the codes too:
Red: |CFFFF0303 |R
Blue: |CFF0042FF |R
Teal: |CFF1BE6D8 |R
Purple: |CFF540081 |R
Yellow: |CFFFFFF01 |R
Orange: |CFFFE8A0E |R
Green: |CFF20C000 |R
Pink: |CFFE55BB0 |R
Grey: |CFF959697 |R
Light Blue: |CFF7EBFF1 |R
Dark Green: |CFF106246 |R
Brown: |CFF4E2A04 |R
Neutral: |CFF272727 |R
Okay now, the next trigger will occurred when a unit of hero-type dies:
-
Events
- Unit - A unit Dies
-
Conditions
- ((Dying unit) is A Hero) Equal to True
- Actions
- Game - Display to (All players) for 5.00 seconds the text: (PlayerName[(Player number of (Owner of (Killing unit)))] + ( has just killed + (PlayerName[(Player number of (Owner of (Dying unit)))] + for |cffffcc00250|r gold!!!!)))
In the sentence, you can see there is "for |cffffcc00250|r Gold!". That one is optional, simply remove it by replacing "(PlayerName[(Player number of (Owner of (Dying unit)))] + for |cffffcc00250|r gold!!!!)))" into "(PlayerName[(Player number of (Owner of (Dying unit)))] + !!!"
NOTE: Variables won't automatically put spacebars for you, so you have to set it manually, like using concatenate strings to put spacebar after the variable. I won't show you the bad way because it might confuse your mind and is probably not MPI. Now you are done! Good luck in triggering!
Last edited: