Trigger making my game laggy.

Vulcansurge

Ultra Cool Member
Reaction score
27
Code:
spawnwolves
    Events
    Conditions
    Actions
        Unit Group - Pick every unit in (Units owned by Player 11 (Dark Green)) and do (Actions)
            Loop - Actions
                Unit - Kill (Picked unit)
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                gamelevelInt Equal to 1
            Then - Actions
                For each (Integer A) from 1 to 70, do (Actions)
                    Loop - Actions
                        Unit - Create 1 Wolf for Player 11 (Dark Green) at (Random point in playablearea <gen>) facing (Random angle) degrees
            Else - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        gamelevelInt Equal to 2
                    Then - Actions
                        For each (Integer A) from 1 to 105, do (Actions)
                            Loop - Actions
                                Unit - Create 1 Wolf for Player 11 (Dark Green) at (Random point in playablearea <gen>) facing (Random angle) degrees
                    Else - Actions
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            If - Conditions
                                gamelevelInt Equal to 3
                            Then - Actions
                                For each (Integer A) from 1 to 160, do (Actions)
                                    Loop - Actions
                                        Unit - Create 1 Wolf for Player 11 (Dark Green) at (Random point in playablearea <gen>) facing (Random angle) degrees
                            Else - Actions
                                Player Group - Pick every player in (All players) and do (Actions)
                                    Loop - Actions
                                        Game - Victory (Picked player) (Show dialogs, Skip scores)

something in this is creating a continuous loop and slowing down my computer to 1 FPS. I know it has leaks, but could that be the problem or is it something obvious?
 

~GaLs~

† Ғσſ ŧħə ѕαĸε Φƒ ~Ğ䣚~ †
Reaction score
180
u created over 100++ position leaks....sure lag like hell...read emjl's memory leak thread to know how to remove leaks
 

Vulcansurge

Ultra Cool Member
Reaction score
27
but it was working fine until a few minutes ago... are you sure its not something different?
 

Akatsuki

New Member
Reaction score
24
I'm sure that leaks are the main problem. It is very leaky. Take the suggestions above and use the leak check.

Use variables such as Unit Group and Point. Then you can use custom scripts and use call DestroyGroup(udg_Unit_Group) and call RemoveLocation(udg_Point). Unit_Group is the name of your unit group variable and point being the name of your point variable.

After that tell me about that lag problem.
 

Hero

─║╣ero─
Reaction score
250
Leaks are not only the problem...how many units are you planning to create?

Code:
For each (Integer A) from 1 to 70
For each (Integer A) from 1 to 105
For each (Integer A) from 1 to 160

Thats quite a lot of units to be creating...your gonna experience some lag with that...along with the many leaks


___________
Ugh beat by Aceharts's stealthy ninja speed... :(
 

Vulcansurge

Ultra Cool Member
Reaction score
27
im sure its the leaks now. im fixing it as im posting this...

i know it is alot, but it doesnt seem to have a problem with 160 units, they all appear on the map fine.

any other way to create that i can create that many units on the map? maybe i should do them in groups of ten and separate them with a .1 seond wait...
 

Azylaminaz

Vox Populi
Reaction score
91
im sure its the leaks now. im fixing it as im posting this...

i know it is alot, but it doesnt seem to have a problem with 160 units, they all appear on the map fine.

any other way to create that i can create that many units on the map? maybe i should do them in groups of ten and separate them with a .1 seond wait...
A .1 second wait won't help very much. And if you want to make 300+ units, it's okay to create them in three seconds?

Basicly, if you need this many units to be created at one time, you need to create them at one time(or in a short time..).

Why not make the units stronger so you can create less? ^.^
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      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