Lag Spike

Malice-

Endlessly Known
Reaction score
34
Okay, so i've been experiencing the lag spikes in my map, mainly when a hero is picked (its a hero arena type map) and when one of the runes are acquired. Basically, when I pick up a rune, the game freezes for a SPLIT second, and when a hero is picked, the game freezes for a SPLIT second. Its kind of annoying.

Here are the triggers:

The hero pick trigger: Basically all it does is, well, what you see there. The actually spawning of the hero is done by the player clicking it in the tavern, and the tavern selling it.
Code:
Manual Hero Pick
    Events
        Unit - A unit Sells a unit
    Conditions
        ((Sold unit) is A Hero) Equal to True
    Actions
        Player Group - Pick every player in (All players) and do (Actions)
            Loop - Actions
                Player - Make (Unit-type of (Sold unit)) Unavailable for training/construction by (Picked player)
        Game - Display to (All players) the text: (A player has chosen  + (Name of (Sold unit)))
        Wait 0.10 seconds
        Selection - Select (Sold unit) for (Owner of (Sold unit))
        Set Hero[(Player number of (Owner of (Sold unit)))] = (Sold unit)
        Player - Add 750 to (Owner of (Sold unit)) Current gold

The rune pickup trigger: A unit picks up a rune, and he gets those abilities for 15 seconds. The variable is to allow the unit to walk on the 'lava'.
Code:
Blazing Speed Effect
    Events
        Unit - A unit Acquires an item
    Conditions
        (Item-type of (Item being manipulated)) Equal to Rune of Blazing Speed
    Actions
        Set FireRune[(Player number of (Owner of (Hero manipulating item)))] = True
        Unit - Add Rune Fire Attack  to (Hero manipulating item)
        Unit - Add Rune Attack Speed (Greater) to (Hero manipulating item)
        Game - Display to (All players) the text: (PlayerNames[(Player number of (Owner of (Hero manipulating item)))] +  |cffFF4500has aquired a FIRE RUNE!  He is blazing fast and can walk on lava!  Watch out!|r)
        Wait 15.00 seconds
        Unit - Remove Rune Attack Speed (Greater) from (Triggering unit)
        Unit - Remove Rune Fire Attack  from (Triggering unit)
        Set FireRune[(Player number of (Owner of (Hero manipulating item)))] = False

Any ideas on how to fix the spikes?
 

Tinki3

Special Member
Reaction score
418
>Any ideas on how to fix the spikes?

Preload.

For heroes, place them in a bunch anywhere on the map, then have them removed at Map Init.
That way they're loaded before hand, aka being preloaded.

For the rune's abilities, I think you should be able to preload them by adding them to a hero/unit via object editor, and place that unit on the map, and again remove it at Map Init.
 

Malice-

Endlessly Known
Reaction score
34
>Any ideas on how to fix the spikes?

Preload.

For heroes, place them in a bunch anywhere on the map, then have them removed at Map Init.
That way they're loaded before hand, aka being preloaded.

For the rune's abilities, I think you should be able to preload them by adding them to a hero/unit via object editor, and place that unit on the map, and again remove it at Map Init.

Thanks a lot. Never even considered Preloading.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top