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

[Trigger] Using triggered abilities for the first time causes game to freeze

Status
Not open for further replies.
Level 3
Joined
Apr 23, 2015
Messages
22
As title says, massive lags follow my abilities, but only when I use the for the first time. All latter usages will not cause any problems. I remove all leaks (or try to at least). Example of a trigger below:

  • Rampage
    • Events
      • Unit - A unit Finishes the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Rampage
    • Actions
      • Set Berserker = (Casting unit)
      • Set BER3_Number = (Number of All buffs considered Magical and physical on Berserker (Include expiration timers, Exclude auras))
      • Unit - Remove All buffs considered Magical and physical from Berserker (Include expiration timers, Exclude auras)
      • Unit - Set life of Berserker to ((Life of Berserker) + ((10.00 + (5.00 x (Real((Level of Ability being cast for Berserker))))) x (Real(BER3_Number))))
      • Unit - Add Rampage(movespeed) to Berserker
      • Unit - Set level of Rampage(movespeed) for Berserker to BER3_Number
 

Chaosy

Tutorial Reviewer
Level 40
Joined
Jun 9, 2011
Messages
13,183
" Unit - Remove All buffs considered Magical and physical from Berserker (Include expiration timers, Exclude auras)"

I have never used this myself, does it lag if you remove that line?

Another theory would be preloading, basically that when the game works with the buffs for the first time it will delay/lag. This is actually the case for animations for example.
 
Level 12
Joined
Feb 22, 2010
Messages
1,115
This happens when an ability appears at the game first time, in this case it is "Rampage(movespeed)".The more levels your ability has, the more time it causes freeze.


Solution is something like this.

  • PreloadTrigger
    • Events
      • Map Initialization - or Time elapsed 0.01 seconds
    • Conditions
    • Actions
      • Unit - Create a unit
      • Unit - Add Rampage(movespeed) to last created unit
      • Unit - remove last created unit
If you have this problem with other triggered skills that use extra object editor abilities, you can use same unit to preload all abilities but keep in mind that you can only add a few abilities to a unit so you need to do something like

Add ability1
Add ability2
Add ability3
Add ability4
Add ability5
remove 5
Add ability6
remove 6
add 7
remove 7
...
...
...
 
Last edited:
Status
Not open for further replies.
Top