Snippet Update Ability Tooltip

Sooda

Diversity enchants
Reaction score
318
If you ever wondered what will trigger tooltip text refresh then it' s 'unit kills' event. Your unit who' s tooltip you want to update must kill unit. Then game will automatically update all tooltip texts.
It can be useful when you constantly switch ability levels to pass to players info in real time. It could be used mostly for abilities which effects depend on unit' s current state and/ or actions.

Variables used:
"critChance" is integer variable with default starting values.
"tempPoint2" is point variable with default starting values.
"ourGuy" is unit variable with default starting values.
Code:
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    If - Conditions
    Then - Actions
        Set critChance = (critChance + 1)
        Unit - Set level of Critical Strike (Active) for ourGuy to critChance
        Set tempPoint2 = (Position of ourGuy)
        Unit - Create 1 Dummy Unit (Tooltip Updater) for (Owner of ourGuy) at tempPoint2 facing Default building facing degrees
        Unit - Cause ourGuy to damage (Last created unit), dealing 1000000000.00 damage of attack type Chaos and damage type Universal
        Custom script:   call RemoveLocation(udg_tempPoint2)
    Else - Actions
It is taken from my one ability what uses that method to update current unit chance to do Critical Attack. It' s idea how to. Still you have to set values to variables yourself.

EDIT:

I made demo map what shows that method in use. But be careful while using this method because when you start to create too much levels and abilities loading time will be reduced. I hope it makes you first time: "Wow!" when you see it. It looks pretty good too.
 

Attachments

  • Text Tooltip Updater Demo Map.w3x
    35.8 KB · Views: 345

Sim

Forum Administrator
Staff member
Reaction score
534
> If you ever wondered what will trigger tooltip text refresh then it' s 'unit kills' event. Your unit who' s tooltip you want to update must kill unit. Then game will automatically update all tooltip texts.

I didn't get this part. Please explain better ;)
 

Sooda

Diversity enchants
Reaction score
318
> I didn't get this part. Please explain better

When you got one ability and you hold mouse cursor on it's tooltip and at same time change level of that ability to something else (And that new ability level has different tooltip text) it woun' t get updated. Then you have to remove your mouse cursor from tooltip and drag cursor back to tooltip (And even then) there is chance tooltip text will be not updated to new ability tooltip text.
Though 'unit kills' refreshes tooltips even when you hold your mouse cursor on tooltip at that moment.
Thanks for one reply :D
 

Sooda

Diversity enchants
Reaction score
318
I added nice little demo map what shows two abilities. First will display Poetry in old good fashion and second is passive ability what name flashes like Limit Break from Final Fantasy 7 PlayStation game.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top