• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Givinge the Floating texts Same Color as Player

Status
Not open for further replies.
Level 8
Joined
Apr 8, 2009
Messages
499
I recently implanted a Damage detection system with floating texts,

  • Damage Detection
    • Events
    • Conditions
    • Actions
      • Set Temp_Real_1 = (Damage taken)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Temp_Real_1 Greater than or equal to 1.00
        • Then - Actions
          • Floating Text - Create floating text that reads (String((Integer(Temp_Real_1)))) above (Triggering unit) with Z offset 64.00, using font size 10.00, color (100.00%, 0.00%, 0.00%), and 0.00% transparency
          • Floating Text - Set the velocity of (Last created floating text) to 60.00 towards 90.00 degrees
          • Floating Text - Change (Last created floating text): Disable permanence
          • Floating Text - Change the lifespan of (Last created floating text) to 2.00 seconds
          • Floating Text - Change the fading age of (Last created floating text) to 1.70 seconds
        • Else - Actions
Now i want the color of those floating texts, to have the same color of the owner of the (Damage Source).


how do i do this?
 
Level 11
Joined
Sep 9, 2010
Messages
368
easy deal:

Just make one to twelve (considering the number of aviable players) string variables with array.
etc.
Then make a trigger that triggers while the map is loading that have those 'set variable' actions:

  • Events
  • Map initialization
  • Actions
  • Set ColourString [1] = COLOUR CODE OF PLAYER 1
  • Set ColourString [2] = COLOUR CODE OF PLAYER 2

and just get it going down to 12 or what number of players that is suposed to play the map as maximum.

COLOURING CODES HERE

(Remember to remove the |r!
For example:

|CFFFF0303 |R is incorrect
|CFFFF0303 is correct.



Then at the

Floating Text - Create floating text that reads (String((Integer(Temp_Real_1)))) above (Triggering unit) with Z offset 64.00, using font size 10.00, color (100.00%, 0.00%, 0.00%), and 0.00% transparency
action that you've posted, you should put the ColourString variable


Floating Text - Create floating text that reads ColourString(Player number of owner of triggering unit) + (String((Integer(Temp_Real_1)))) above (Triggering unit) with Z offset 64.00, using font size 10.00, color (100.00%, 0.00%,




P.S. I've not access to WE, so I can't make any proper triggers :>
 
Level 8
Joined
Apr 8, 2009
Messages
499
Floating Text - Create floating text that reads ColourString(Player number of owner of triggering unit) + (String((Integer(Temp_Real_1)))) above (Triggering unit) with Z offset 64.00, using font size 10.00, color (100.00%, 0.00%,

how does this change the string color?

doesn't this just combine 2 strings, if which 1 is the color and second one is the amount of damage?

also, you stil use the (100%, 0%, 0%) at the end. i'll try it, but i'm not sure if this will work.

----EDIT----

didn't try what you said but it did give me a idea how to fix it. works now.


i used Concentate strings

Color tag + damage amount + end of color tag

example:
|cff272727 + 56 + |r


anyways +rep for helping me. in a way. ;D
 
Level 8
Joined
Apr 8, 2009
Messages
499
That was just what I was thinking about exept:



The |r is completly unecessary in this case, because it shows where the colourtag stops :>


Edit:

for example:

will be 56 Damage
will be 56 Damage


=O!!

power of habits i guess ;D

tyvm ^^
 
Status
Not open for further replies.
Top