• Check out the results of the Techtree Contest #19!
  • 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.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

Adding abilities causes lag?

Status
Not open for further replies.
Level 15
Joined
Aug 7, 2013
Messages
1,342
Hi,

I have a command which creates a unit at some arbitrary level and accordingly levels up its attributes. I use a home brewed bonus mod system, so I do have to add or remove abilities using powers of 2.

I notice that whenever I run this command, there is noticeable lag/pause before the unit is made.

Is this because of the adding/removing of abilities, or an optimization problem with my code?
 
That'd be the adding of abilities. There's no real solution (that I'm aware of) other than creating a unit at the start of the game and adding the abilities to it and then removing it. This will cause the lag to be at the start of the game and not further through the game, for whatever reason this only occurs once per spell.
 
Once per spell, or once per unit?

So suppose I create a unit every 10 seconds using a bonus mod ability. Will it lag at each unit?
 
Status
Not open for further replies.
Back
Top