(Leak and Lag) Is this trigger ok?

A.Dominion

New Member
Reaction score
0
hi all and thanks in advance for your help and comment.
i am an average or basic triggerer since i can't use Jass, and i am not very familiar with memory used by trigger, so i would like to check with you all if these trigger are ok, or if there is a way to improve them....

please i don't know how to put the trigger tag to make it more lisible, so can a moderator do it for me and explain mle how to do it too. ^^
edit: i figured it out so no need to teach me how to put the trigge tag :p
Trigger:
  • trigger
    • Events
      • Temps - Elapsed game time is 1.00 seconds
    • Conditions
    • Actions
      • Set Center_point = (Center of Lake <gen>)
      • Set X = (X of Center_point)
      • Set Y = (Y of Center_point)
      • For each (Integer A) from 1 to 181, do (Actions)
        • Boucle - Actions
          • Wait 0.01 seconds
          • Set Y = (Y - 128.00)
          • Set X = (X of Center_point)
          • For each (Integer B) from 1 to 181, do (Actions)
            • Boucle - Actions
              • Set X = (X + 128.00)
              • Set Temp_point = (Point(X, Y))
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • Si - Conditions
                  • (Terrain type at Temp_point) = Ashenvale - Touffes d'herbe
                • Alors - Actions
                  • Set MountainN = (MountainN + 1)
                  • Environnement - Create a 0.01 second Permanent crater deformation at Temp_point with radius 128.00 and depth -128.00
                  • Environnement - Change terrain type at Temp_point to Summer de Lordaeron - Rochers using variation -1 in an area of size 1 and shape Square
                  • Destructible - Create a Obstacle chemin (Sol) (Grand) at Temp_point facing (Random angle) with scale 1.00 and variation 0
                  • Set Mountain[MountainN] = (Point((X of Temp_point), (Y of Temp_point)))
                • Sinon - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • Si - Conditions
                      • (Terrain type at Temp_point) = Summer de Lordaeron - Terre
                    • Alors - Actions
                      • Set MountainN = (MountainN + 1)
                      • Environnement - Create a 0.01 second Permanent crater deformation at Temp_point with radius 128.00 and depth -384.00
                      • Environnement - Change terrain type at Temp_point to Summer de Lordaeron - Rochers using variation -1 in an area of size 1 and shape Square
                      • Destructible - Create a Obstacle chemin (Sol) (Grand) at Temp_point facing (Random angle) with scale 1.00 and variation 0
                      • Set Mountain[MountainN] = (Point((X of Temp_point), (Y of Temp_point)))
                    • Sinon - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • Si - Conditions
                          • (Terrain type at Temp_point) Egal Ã_ Ashenvale - Vignes
                        • Alors - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • Si - Conditions
                              • (Random integer number between 1 and 10) <= 3
                            • Alors - Actions
                              • Set TreeN = (TreeN + 1)
                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • Si - Conditions
                                  • (Random integer number between 1 and 3) = 1
                                • Alors - Actions
                                  • Destructible - Create a Mur d'arbres de ville automnale at Temp_point facing (Random angle) with scale 1.00 and variation 0
                                  • Set Tree1[TreeN] = (Last created destructible)
                                  • Destructible - Masquer Tree1[TreeN]
                                  • Destructible - Create a Mur d'arbres de ville snow at Temp_point facing (Random angle) with scale 1.00 and variation 0
                                  • Set Tree2[TreeN] = (Last created destructible)
                                  • Destructible - Masquer Tree2[TreeN]
                                  • Destructible - Create a Mur d'arbres de ville Summer at Temp_point facing (Random angle) with scale 1.00 and variation 0
                                  • Set Tree0[TreeN] = (Last created destructible)
                                • Sinon - Actions
                                  • Destructible - Create a Mur d'arbre automne at Temp_point facing (Random angle) with scale 1.00 and variation 0
                                  • Set Tree1[TreeN] = (Last created destructible)
                                  • Destructible - Masquer Tree1[TreeN]
                                  • Destructible - Create a Mur d'arbre Snow at Temp_point facing (Random angle) with scale 1.00 and variation 0
                                  • Set Tree2[TreeN] = (Last created destructible)
                                  • Destructible - Masquer Tree2[TreeN]
                                  • Destructible - Create a Mur d'arbres Summer at Temp_point facing (Random angle) with scale 1.00 and variation 0
                                  • Set Tree0[TreeN] = (Last created destructible)
                            • Sinon - Actions
                              • Environnement - Change terrain type at Temp_point to Summer de Lordaeron - Herbe using variation -1 in an area of size 1 and shape Square
                        • Sinon - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • Si - Conditions
                              • (Terrain type at Temp_point) Egal Ã_ Ruines englouties - Sable
                            • Alors - Actions
                              • Set SandN = (SandN + 1)
                              • Set Sand[SandN] = (Point((X of Temp_point), (Y of Temp_point)))
                            • Sinon - Actions
                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • Si - Conditions
                                  • (Terrain type at Temp_point) = Ruines englouties - Terre herbeuse
                                • Alors - Actions
                                  • Set WaterN = (WaterN + 1)
                                  • Environnement - Create a 0.01 second Permanent crater deformation at Temp_point with radius 128.00 and depth 64.00
                                  • Destructible - Create a Obstacle chemin (Sol) (Grand) at Temp_point facing (Random angle) with scale 1.00 and variation 0
                                  • Set PathBlocker[WaterN] = (Last created destructible)
                                  • Set Water[WaterN] = (Point((X of Temp_point), (Y of Temp_point)))
                                • Sinon - Actions
              • Custom script: call RemoveLocation( udg_Temp_point )



Ok i will post trigger one at a time, but i will explain first the goal of these trigger so you can help me more efficiently.
this trigger run the whole map ((160x160) square by square, and detect the terrain type, store the sand terrain type into a point variable (shallow water), the grassy sand same (deep water), the summer lorderon dirt and ashenvale moss same (mountain), create randomly tree (2 chance out of 10) in the ashenvale vigne terrain and store each tree into a destructible variable (tree0,1,2) and hide them to show only summer tree. it also add pathblocker in the mountain and deep water and put the water blocker into a destructible variable (pathbloker)

it take something like 16 or 22 second to run through the whole map. so first is this trigger ok, or is it bad?



i write the following trigger down: (here is a bug, some of the terrain and tree doesn't change only the upper map to 2/3 are updated, but the lower map doesn't update tree and terrain) someone can help fix this??

when the season change it run this trigger:
Trigger:
  • Winter
    • Events
    • Conditions
    • Actions
      • Set Temp_point = (Point(-512.00, 0.00))
      • Environnement - Change terrain type at Temp_point to Hiver de Lordaeron - Falaise Snow using variation -1 in an area of size 91 and shape square
      • Custom script: call RemoveLocation( udg_Temp_point )
      • Trigger - Run Winter loop <gen> (checking conditions)


Trigger:
  • Winter loop
    • Events
    • Conditions
    • Actions
      • Set TempN = 0
      • For each (Integer A) from 1 to 3000, do (Actions)
        • Boucle - Actions
          • Set TempN = (TempN + 1)
          • If (TempN > WaterN) then do (Do nothing) else do (Trigger - Run Winter water <gen> (checking conditions))
          • If (TempN > SandN) then do (Do nothing) else do (Trigger - Run Winter sand <gen> (checking conditions))
          • If (TempN > TreeN) then do (Do nothing) else do (Trigger - Run Tree snow <gen> (checking conditions))
          • If (TempN > MountainN) then do (Do nothing) else do (Trigger - Run Mountain <gen> (checking conditions))


Trigger:
  • Winter sand
    • Events
    • Conditions
    • Actions
      • Environnement - Create a 0.01 second Permanent crater deformation at Sand[TempN] with radius 128.00 and depth -64.00
      • Environnement - Change terrain type at Sand[TempN] to Glacier d'Icecrown - Glace using variation -1 in an area of size 1 and shape square


Trigger:
  • Winter water
    • Events
    • Conditions
    • Actions
      • Environnement - Create a 0.01 second Permanent crater deformation at Water[TempN] with radius 128.00 and depth -128.00
      • Environnement - Change terrain type at Water[TempN] to Glacier d'Icecrown - Glace sombre using variation -1 in an area of size 1 and shape Square
      • Destructible - Kill PathBlocker[TempN]


Trigger:
  • Tree snow
    • Events
    • Conditions
    • Actions
      • Set Temp_point = (Position of Tree0[TempN])
      • Destructible - Masquer Tree0[TempN]
      • Destructible - Masquer Tree1[TempN]
      • Destructible - Montrer Tree2[TempN]
      • Environnement - Change terrain type at Temp_point to Ashenvale - Vignes using variation -1 in an area of size 1 and shape Square
      • Custom script: call RemoveLocation( udg_Temp_point )


Trigger:
  • Mountain
    • Events
    • Conditions
    • Actions
      • Environnement - Change terrain type at Mountain[TempN] to Eté de Lordaeron - Rochers using variation -1 in an area of size 1 and shape Square
 

kingkingyyk3

Visitor (Welcome to the Jungle, Baby!)
Reaction score
216
LOLOLOLOLOLOL for this long....................................... trigger. Ur coding quite good.
 

Igor_Z

You can change this now in User CP.
Reaction score
61
Hmm, every second those actions r spawned... Every second u show text messages etc, hmm i dunno, i think it will cause lags. Myb there r leaks, too tired to look @ the 1km code. Why do u use a wait? My advise is, separate those actions into many triggers. Btw can u explain what is this trigger for, myb we can construct it another way

For each (Integer A) from 1 to 181, do (Actions)
This is very much, it will cause lags 4 sure...
 

A.Dominion

New Member
Reaction score
0
the first trigger run only once at start of game and the text display only once at the end of the trigger ( if integer A 181 and integer 181) display text.
so it show only once the text

ps the first part i might slow down a bit but i don't think it really lag, the real issue is when the season change, while testing there is a little freeze or lag period, i am not sure if it is my imagination or because the whole terrain change, but i am affraid that online with slow computer it may desync....

when season change: i hide all tree from map and show all tree back but in there winter form, at same time i paste all the map snow, and then i replace the snow on mountain to rock, the snow on river to ice and on deep water to ice dark... i don't know if it is well triggered or if i should put some wait or do it differently, i have no idea how to detect lag or to detect memory used by trigger....
 

A.Dominion

New Member
Reaction score
0
Bump ^^

hum not much comment....
so i guess the trigger don't need to be perfected, or maybe my explaination aren't good enough?

anyway i would like to ask something more:

1) what is the max number for an integer in gui (to avoid lag or bug)?

2) what is the number max of destructible to be in game in a map (not lagging or creating problem) ?

3) what happen when u use the hide/show destructible, is the hidden destructible still in the memory but not in game anymore?
if that is so last question:

4) if i have 3000 destructible of 3 types wich mean i create 6000 destructible hidden and 3000 visible in order to make my replace tree trigger, i replace all 3000 tree by next 3000 tree and hide the first one this trigger occure once every 15 min or so.
is it better to have 9000 destructible (6000 hidden, 3000 visible)?
or better to have 3000 tree and remove them and create 3000 new destructible at position of old one?

in term of memory leak or lag wich one is better?
 

Sajberhippie

New Member
Reaction score
30
hum not much comment....
so i guess the trigger don't need to be perfected, or maybe my explaination aren't good enough?

anyway i would like to ask something more:

1) what is the max number for an integer in gui (to avoid lag or bug)?

2) what is the number max of destructible to be in game in a map (not lagging or creating problem) ?

3) what happen when u use the hide/show destructible, is the hidden destructible still in the memory but not in game anymore?
if that is so last question:

4) if i have 3000 destructible of 3 types wich mean i create 6000 destructible hidden and 3000 visible in order to make my replace tree trigger, i replace all 3000 tree by next 3000 tree and hide the first one this trigger occure once every 15 min or so.
is it better to have 9000 destructible (6000 hidden, 3000 visible)?
or better to have 3000 tree and remove them and create 3000 new destructible at position of old one?

in term of memory leak or lag wich one is better?

1. Far more than you could ever need. What matters isn't the integer, it's what you do with it. Looping no actions 200 times won't take much memory, but looping a "create unit" action 200 times might lag a bit.
2. That probably also varies depending on destructible polycount and how much players interact with them.
3. I think it's in the memory.
4. Didn't understand this, I blame fever.
 

kingkingyyk3

Visitor (Welcome to the Jungle, Baby!)
Reaction score
216
Whoa, I am mad when you are trying to make those kinda crazy thingy. About your fourth question, default world editor had limit the number of destrubtible on a map, so use JNGP to overcome it.
 

A.Dominion

New Member
Reaction score
0
thank for your time

Well kingkingyyk3, i don't have problem with the We because i create all the destructible tree in Game at map start...

Sajberhippie sorry not to be precise, so i add this:

what happen when u create 6100+ tree(loarderon summer) hide them, then create 6100+ tree(loarderon fall) hide them, then create 6100+ tree(loarderon snow) (not hide)....

and then use a loop that for each integer from 1 to 6100+ action:
hide tree(snow)
show tree(summer)

(in game memory 18300 tree, but the changing is fast) doest it take a lot of memory?

on the other hand i could do create 6100+ tree set position of last created destructible to Point(x)

and then use loop for each integer from 1 to 6100+
remove tree(snow)
create destructible tree(summer) at Point(integerA)
set last created destructible = tree

(only 6100+ tree, but removing / creating might lag or use lot of memory at once...?


EDIT : (bump)
I added an edit at the top page, my trigger seems to bug because the loop is too high maybe, can i request some help?
thanks in advance ^^

Ok i solved it on my own, it look like it really was the integerA loop was too high, so i cut the loop into loop of 2000, because it seem that 2000 or less is the safe loop number for my trigger
 
General chit-chat
Help Users
  • Ghan Ghan:
    Howdy
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.
  • The Helper The Helper:
    Power back on finally - all is good here no damage
    +1
  • V-SNES V-SNES:
    Happy Friday!
    +1

      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