• 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.

Adding abilities causes lag?

Status
Not open for further replies.
Level 15
Joined
Aug 7, 2013
Messages
1,338
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?
 
Level 13
Joined
Oct 16, 2010
Messages
737
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.
 
Level 15
Joined
Aug 7, 2013
Messages
1,338
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.
Top