• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!
  • ✅ The POLL for Hive's Texturing Contest #34 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!
  • ✅ The POLL for Hive's Techtree Contest #20 is OPEN! Vote for the TOP 3 FACTIONS! 🔗Click here to cast your vote!

[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
 
" 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.
 
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.
Back
Top