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

[Trigger] Why does this cause a small lag when casted?

Status
Not open for further replies.
Level 11
Joined
Aug 11, 2009
Messages
605
Just a simple spell that increases the size and attack damage of the caster. First dummy spell increases size while the second dummy spell increases damage.

Everytime I cast it, the game freezes for like ~0.1-0.2 sec or something, which is annoying. I am wondering if anyone knows why and how this could be resolved.

  • Beastial Wrath
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Beastial Wrath (Beast Hunter)
    • Actions
      • Set Point_DummyUnit = (Position of (Triggering unit))
      • Unit - Create 1 Dummy for (Owner of (Triggering unit)) at Point_DummyUnit facing Default building facing degrees
      • Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
      • Unit - Add Beastial Wrath [Dummy 1] to (Last created unit)
      • Unit - Order (Last created unit) to Orc Shaman - Bloodlust (Triggering unit)
      • Unit - Create 1 Dummy for (Owner of (Triggering unit)) at Point_DummyUnit facing Default building facing degrees
      • Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
      • Unit - Add Beastial Wrath [Dummy 2] to (Last created unit)
      • Unit - Set level of Beastial Wrath [Dummy 2] for (Last created unit) to (Level of Beastial Wrath (Beast Hunter) for (Triggering unit))
      • Unit - Order (Last created unit) to Human Priest - Inner Fire (Triggering unit)
      • Custom script: call RemoveLocation (udg_Point_DummyUnit)
+rep for any help on this, and thanks for taking your time :)
 
Level 16
Joined
Mar 27, 2011
Messages
1,349
I have heard if abilities have many levels, any dummies created with these abilties will take a while to load.

  • Unit - Add Beastial Wrath [Dummy 2] to (Last created unit)
  • Unit - Set level of Beastial Wrath [Dummy 2] for (Last created unit) to (Level of Beastial Wrath (Beast Hunter) for (Triggering unit))
How many levels do the abilites have?

Try creating the dummies at map start and saving them to variables, and then moving them to the position of caster when needed.

Just curious, do you place the units on the map and set them into a "unit" variable at map initialisation, then reference that variable for all triggers, instead of creating new ones?
 
Level 25
Joined
Jul 10, 2006
Messages
3,315
Just curious, do you place the units on the map and set them into a "unit" variable at map initialisation, then reference that variable for all triggers, instead of creating new ones?

Either that or you create the units at map initialization and set the unit variable to them.

That aside, I think your observation about the ability level is probably what OP needs to fix his bug.
 
Level 11
Joined
Aug 11, 2009
Messages
605
It has 20 levels so that would probably be it :/

Could you show me some mui way to create the units at map start? Its an orpg map.
Or is it better to make 20 abilities? ;)
 
Status
Not open for further replies.
Top