Need Lag Help

jpres

New Member
Reaction score
15
Making a maze and I need to know what to insert to stop the lag for this trigger for whenever a footman is sliding.

Code:
Tiles
    Events
        Time - Every 0.04 seconds of game time
    Conditions
    Actions
        Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Unit-type of (Picked unit)) Equal to Footman
                        (Terrain type at (Position of (Picked unit))) Equal to Cityscape - Rough Dirt
                    Then - Actions
                        Unit - Move (Picked unit) instantly to ((Position of (Picked unit)) offset by 6.00 towards (Facing of (Picked unit)) degrees)
                    Else - Actions
        Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Unit-type of (Picked unit)) Equal to Footman
                        (Terrain type at (Position of (Picked unit))) Equal to Cityscape - Dirt
                    Then - Actions
                        Unit - Move (Picked unit) instantly to ((Position of (Picked unit)) offset by 8.00 towards (Facing of (Picked unit)) degrees)
                    Else - Actions
        Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Unit-type of (Picked unit)) Equal to Footman
                        (Terrain type at (Position of (Picked unit))) Equal to Cityscape - Black Marble
                    Then - Actions
                        Unit - Move (Picked unit) instantly to ((Position of (Picked unit)) offset by 11.50 towards (Facing of (Picked unit)) degrees)
                    Else - Actions
        Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Unit-type of (Picked unit)) Equal to Footman
                        (Terrain type at (Position of (Picked unit))) Equal to Cityscape - White Marble
                    Then - Actions
                        Unit - Move (Picked unit) instantly to ((Position of (Picked unit)) offset by 14.00 towards (Facing of (Picked unit)) degrees)
                    Else - Actions
        Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Unit-type of (Picked unit)) Equal to Footman
                        (Terrain type at (Position of (Picked unit))) Equal to Cityscape - Square Tiles
                    Then - Actions
                        Unit - Move (Picked unit) instantly to ((Position of (Picked unit)) offset by 20.00 towards (Facing of (Picked unit)) degrees)
                    Else - Actions
        Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Unit-type of (Picked unit)) Equal to Footman
                        (Terrain type at (Position of (Picked unit))) Equal to Cityscape - Round Tiles
                    Then - Actions
                        Unit - Move (Picked unit) instantly to ((Position of (Picked unit)) offset by 26.00 towards (Facing of (Picked unit)) degrees)
                    Else - Actions
        Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Unit-type of (Picked unit)) Equal to Footman
                        (Terrain type at (Position of (Picked unit))) Equal to Dalaran - Trim Grass
                    Then - Actions
                        Unit - Kill (Picked unit)
                    Else - Actions
 

SFilip

Gone but not forgotten
Reaction score
634
(Units in (Playable map area)) - leak
(Position of (Picked unit)) - leak
((Position of (Picked unit)) offset by 14.00 towards (Facing of (Picked unit)) degrees) - leak
etc.

find a tutorial about leaks or run LeakCheck.
 
L

Lordbevan

Guest
Leaks are often exagerated.
I think the laggy part is because u keep picking the same units on the Entire map, u only need to pick them once and store them in a variable.
 

dashival

New Member
Reaction score
11
Lordbevan said:
I think the laggy part is because u keep picking the same units on the Entire map, u only need to pick them once and store them in a variable.
Yes, that is exactly why my map was slow. But, you should still fix the leaks. =)
 
General chit-chat
Help Users

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top