Snippet ResetTooltips

Azlier

Old World Ghost
Reaction score
461
'Avul' can work without any problems, if I remove that lovely MakeUnitFlyable capability, which shouldn't be in there anyway.
 

quraji

zap
Reaction score
144
Until then, I'm sure the player can manage with this silly little bug, and not have the performance of the map crippled because of something so insignificant.

How would the performance be crippled?

Can you automatically do this in response to an event that causes the bug?

Who cares about the "lovely side effect" of making units flyable?
 

Azlier

Old World Ghost
Reaction score
461
Because side effects should be documented.


>Can you automatically do this in response to an event that causes the bug?

Well, I can hook [lJASS]UnitAddAbility[/lJASS]. But then I get a crazy recursive function. Probably results in a game crash.
 

quraji

zap
Reaction score
144
>Because side effects should be documented.

Suppose so.

>Well, I can hook UnitAddAbility. But then I get a crazy recursive function. Probably results in a game crash.

More vJass hook woes =/
What about something like this:

JASS:
globals
    private boolean reset = true
endglobals

function ResetTooltips takes unit u returns nothing
    if (reset==false) then
        return
    endif
    set reset = false
    if UnitAddAbility(u, 'Arav') then
        call UnitRemoveAbility(u, 'Arav')
    endif
    set reset = true
endfunction

hook whatever whatever
 

Azlier

Old World Ghost
Reaction score
461
Wait, not UnitAddAbility. I realize it now. The native that sets an ability's level.

Now I need a 0 second timer, a second function, a system to handle the timers for me, and a struct to hold the unit!

AWAY I GO!

...But not today. I don't have WC3 today.
 

quraji

zap
Reaction score
144
Wait, not UnitAddAbility. I realize it now. The native that sets an ability's level.

Now I need a 0 second timer, a second function, a system to handle the timers for me, and a struct to hold the unit!

AWAY I GO!

...But not today. I don't have WC3 today.

Errr...k. :nuts:
 

Troll-Brain

You can change this now in User CP.
Reaction score
85
If you want to refresh UI, just use a dummy ability with no effect at all, add/remove it.
I guess using the object merger is fine for that here.
 

Azlier

Old World Ghost
Reaction score
461
Indeed it is. I'll add a dummy ability via ObjectMerger and hook it so it runs whenever you increase a unit's ability's level.
 

Azlier

Old World Ghost
Reaction score
461
>You don't need a timer sys for 0 sec timers

What if someone calls the native more than once at a time? Or within 0.001 seconds of the other (or whatever the lowest timer amount is)?

Hmm.
 

Weep

Godspeed to the sound of the pounding
Reaction score
400
I wonder if boolean operations are faster than Ifs.

[ljass]return (UnitRemoveAbility(u, 'Avul') and UnitAddAbility(u, 'Avul')) or (UnitAddAbility(u, 'Avul') and UnitRemoveAbility(u, 'Avul'))[/ljass]
 

Azlier

Old World Ghost
Reaction score
461
That is totally insane.

Beautiful.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top