• 🏆 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!

Custom Value/Variable displayed in ability Tool-Tip?

Status
Not open for further replies.
Level 5
Joined
May 27, 2007
Messages
162
As the name suggested, I want to be able to display a variable or a custom value of a unit, in a tooltip of an ability?

I think this is possible.

Right now what I'm doing is giving the unit an active ability, which when used displays that unit's custom value as a floating text. What I want is for the ability to be a passive (non-clickable) and for the unit's custom value to appear when the player mouse's over the ability.

Any help much appreciated!
 
Level 5
Joined
May 27, 2007
Messages
162
Alternatively, is it possible through triggers to determine what units a player currently has selected?

That way I can still use the Floating Text method, except for groups of units. So instead of 12 individual floating texts, it will give one floating text for all selected units combined 'custom value / 100' as a percentage. Etc


Found it... Interger comparsion, unit group, selected by player... :)
 
Level 5
Joined
May 27, 2007
Messages
162
  • Check Hull Capacity
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Hull Capacity
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in (Units currently selected by (Owner of (Casting unit)))) Greater than 1
        • Then - Actions
          • Unit Group - Pick every unit in (Units owned by (Owner of (Casting unit)) matching (((Unit-type of (Matching unit)) Equal to Asteroid Miner) and (((Matching unit) is in (Units currently selected by (Owner of (Casting unit)))) Equal to True))) and do (Actions)
            • Loop - Actions
              • Set TempCounter[1] = (TempCounter[1] + 150)
              • Set TempCounter[2] = (TempCounter[2] + (Custom value of (Picked unit)))
          • Set TempCounter[3] = (TempCounter[2] / TempCounter[1])
          • Set TempCounter[3] = (TempCounter[3] x 100)
          • Floating Text - Create floating text that reads ((String(TempCounter[3])) + % Full.) at ((Position of (Casting unit)) offset by (100.00, 100.00)) with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
          • Floating Text - Set the velocity of (Last created floating text) to 64.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 5.00 seconds
          • Floating Text - Change the fading age of (Last created floating text) to 4.00 seconds
        • Else - Actions
          • Do nothing
This isn't working as it should, can anyone see where I'm going wrong?

Also, look at my first post - any ideas on that one?
 
Status
Not open for further replies.
Top