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

lags problem

Status
Not open for further replies.
Level 6
Joined
Sep 24, 2015
Messages
174
  • lumberbase1
    • Evénements
      • Temps - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 12, do (Actions)
        • Boucle - Actions
          • Set Temp_Group = (Units in (Playable map area) matching (((Unit-type of (Matching unit)) Egal Ã* Lumber Base 1 (bug fix test)) and (((Owner of (Matching unit)) Egal Ã* (Player((Integer A)))) and (((Matching unit) is alive) Egal Ã* TRUE))))
          • Joueur - Add ((Number of units in Temp_Group) x 25) to (Player((Integer A))) Bois actuel
          • Custom script: call DestroyGroup( udg_Temp_Group )
Hello,

I have lagg problems, let me explain (if i can),

i did one trigger for 1 lumberbase level 1 giving x amount of wood/sec
i did this with the "temp_group" variable and copied it 8 times for lumberbases till level 8 (each level of lumberbases is giving an other amount of wood)

and did all tis x2 again (so 16 lumberbases )

normal lumberbases x8 and secret lumberbases x8


I guess this multiplied 16 times will cause some laggs but the call destroyGroup would not delete the leaks?

please help me :)
 
Last edited:
Level 21
Joined
Nov 4, 2013
Messages
2,016
Correct me if I'm wrong but aren't you adding players to a player group? That leaks as well and requires to be removed by a custom script "DestroyForce". Create a player group (array if required) then destroy it like that:

  • call DestroyForce(udg_TempPlayerGroup[1])
Assuming the variable is called TempPlayerGroup.
Naturally if you use "For each integer" command, you'd have to replace [1] with something like [GetForLocalIndexA()] or something similar I don't recall well.
 
You have copied this trigger 8 times and then again 2 times?
In this trigger you pick all units in map, and this you do 12 times.

So -> 12*8*2 = 192 times you pick ALL units inside the map at same moment (likely).
If you have huge amount of units/buildings this could be problematic.

You should try to combine these "PickAllUnits" operations, like this for example:

1. You pick AllUnits without any condition once and in one trigger only.
2. Inside the actions you put in your conditions, like checking for unit type or owner.

@SF, I'm pretty sure he is adding gold to a player.
 
Level 6
Joined
Sep 24, 2015
Messages
174
So, if i unserstood correctly, i need to remove my variable "Temp_Group" add a new "PlayerGroup" variable and add a new custom script "call DestroyForce(udg_TempPlayerGroup[1])" ? i let "[1]" for the variable or need i to change that number?

btw thank you for your help :)

I did this could it work?

  • lumberbases 4
    • Evénements
      • Temps - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 12, do (Actions)
        • Boucle - Actions
          • Joueur - Add (5 x (Number of units in (Units owned by (Player((Integer A))) of type Lumber Base 1 (bug fix test)))) to (Player((Integer A))) Bois actuel
@IcemanBo : like this ?

  • lumberbase1 Copier Copier
    • Evénements
      • Temps - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Groupe unité - Pick every unit in (Units in (Playable map area)) and do (Actions)
        • Boucle - Actions
But i cant put conditions here, i dont' understand your way...

I copied the trigger in the first post 16 times not 196 times 8 times the trigger and 8 more times...

Did this but it works only for red player...

  • lumberbase01
    • Evénements
      • Temps - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Custom script: set bj_wantDestroyGroup = true
      • Groupe unité - Pick every unit in (Units of type Lumber Base 1 (bug fix test)) and do (Actions)
        • Boucle - Actions
          • Joueur - Add 25 to (Owner of (Picked unit)) Bois actuel
 
Last edited:
Status
Not open for further replies.
Top