Trigger lag

vonahs

New Member
Reaction score
0
when i use an upgrade trigger.

unit finishes research
research = to attack upgrade
i got multiple actions for it that up grade all golems and the archer and then checks if what player the unit belongs to and upgrades the players partners = research.

do i need to spread out the trigger to cause less lag?
 

Sim

Forum Administrator
Staff member
Reaction score
534
> do i need to spread out the trigger to cause less lag?

What does that even mean?

Actually, the more trigger objects, the more memory used. Though it won't really affect anyone's gameplay as those are minuscule additions.
 

Accname

2D-Graphics enthusiast
Reaction score
1,462
we cant really tell what your trigger is supposed to do or what it actually does. at least i cant from what you told us.

please, copy your trigger as a text and paste it here for us to have a look at it.

most triggers, exspecially those without periodic events, do not cause alot of performance loss if coded properly. (of course not all)
ineffective triggering, memory leaks and spamming unneccassary dummy units is what causes performance drops most of the time. these things can be avoided.

post your trigger here, give us some more information about it and most probably a skillful member will tell you what you need to do and where your problem lies.
 

vonahs

New Member
Reaction score
0
here are some of my triggers

Trigger:
  • Initialization
    • Events
      • Time - Elapsed game time is 1.00 seconds
    • Conditions
    • Actions
      • -------- Team 1 (RED,BLUE,TEAL) --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player 1 (Red) slot status) Equal to Is playing
        • Then - Actions
          • Visibility - Create an initially Enabled visibility modifier for Player 1 (Red) emitting Visibility across Vision <gen>
          • Visibility - Create an initially Enabled visibility modifier for Player 1 (Red) emitting Visibility across Vision top <gen>
          • Player - Set Player 1 (Red) Current gold to 50
          • Unit - Create 2 Kings Men for Player 1 (Red) at (Player 1 (Red) start location) facing Default building facing degrees
          • Unit - Create 1 Fortess for Player 1 (Red) at (Player 1 (Red) start location) facing Default building facing degrees
          • Unit - Create 1 Spell Stone for Player 1 (Red) at (Center of RED STONE <gen>) facing Default building facing degrees
        • Else - Actions
          • Do nothing
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player 2 (Blue) slot status) Equal to Is playing
        • Then - Actions
          • Visibility - Create an initially Enabled visibility modifier for Player 2 (Blue) emitting Visibility across Vision top <gen>
          • Visibility - Create an initially Enabled visibility modifier for Player 2 (Blue) emitting Visibility across Vision <gen>
          • Player - Set Player 2 (Blue) Current gold to 50
          • Unit - Create 2 Kings Men for Player 2 (Blue) at (Player 2 (Blue) start location) facing Default building facing degrees
          • Unit - Create 1 Fortess for Player 2 (Blue) at (Player 2 (Blue) start location) facing Default building facing degrees
          • Unit - Create 1 Spell Stone for Player 2 (Blue) at (Center of BLUE STONE <gen>) facing Default building facing degrees
        • Else - Actions
          • Do nothing
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player 3 (Teal) slot status) Equal to Is playing
        • Then - Actions
          • Visibility - Create an initially Enabled visibility modifier for Player 3 (Teal) emitting Visibility across Vision top <gen>
          • Visibility - Create an initially Enabled visibility modifier for Player 3 (Teal) emitting Visibility across Vision <gen>
          • Player - Set Player 3 (Teal) Current gold to 50
          • Unit - Create 2 Kings Men for Player 3 (Teal) at (Player 3 (Teal) start location) facing Default building facing degrees
          • Unit - Create 1 Fortess for Player 3 (Teal) at (Player 3 (Teal) start location) facing Default building facing degrees
          • Unit - Create 1 Spell Stone for Player 3 (Teal) at (Center of TEAL STONE <gen>) facing Default building facing degrees
        • Else - Actions
          • Do nothing
      • -------- Team 1 (GREEN,PINK,GRAY) --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player 7 (Green) slot status) Equal to Is playing
        • Then - Actions
          • Visibility - Create an initially Enabled visibility modifier for Player 7 (Green) emitting Visibility across Vision <gen>
          • Visibility - Create an initially Enabled visibility modifier for Player 7 (Green) emitting Visibility across Vision top <gen>
          • Player - Set Player 7 (Green) Current gold to 50
          • Unit - Create 2 Kings Men for Player 7 (Green) at (Player 7 (Green) start location) facing Default building facing degrees
          • Unit - Create 1 Fortess for Player 7 (Green) at (Player 7 (Green) start location) facing Default building facing degrees
          • Unit - Create 1 Spell Stone for Player 7 (Green) at (Center of GREEN STONE <gen>) facing Default building facing degrees
        • Else - Actions
          • Do nothing
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player 8 (Pink) slot status) Equal to Is playing
        • Then - Actions
          • Visibility - Create an initially Enabled visibility modifier for Player 8 (Pink) emitting Visibility across Vision <gen>
          • Visibility - Create an initially Enabled visibility modifier for Player 8 (Pink) emitting Visibility across Vision top <gen>
          • Player - Set Player 8 (Pink) Current gold to 50
          • Unit - Create 2 Kings Men for Player 8 (Pink) at (Player 8 (Pink) start location) facing Default building facing degrees
          • Unit - Create 1 Fortess for Player 8 (Pink) at (Player 8 (Pink) start location) facing Default building facing degrees
          • Unit - Create 1 Spell Stone for Player 8 (Pink) at (Center of PINK STONE <gen>) facing Default building facing degrees
        • Else - Actions
          • Do nothing
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player 9 (Gray) slot status) Equal to Is playing
        • Then - Actions
          • Visibility - Create an initially Enabled visibility modifier for Player 9 (Gray) emitting Visibility across Vision <gen>
          • Visibility - Create an initially Enabled visibility modifier for Player 9 (Gray) emitting Visibility across Vision top <gen>
          • Player - Set Player 9 (Gray) Current gold to 50
          • Unit - Create 2 Kings Men for Player 9 (Gray) at (Player 9 (Gray) start location) facing Default building facing degrees
          • Unit - Create 1 Fortess for Player 9 (Gray) at (Player 9 (Gray) start location) facing Default building facing degrees
          • Unit - Create 1 Spell Stone for Player 9 (Gray) at (Center of GREY STONE <gen>) facing Default building facing degrees
        • Else - Actions
          • Do nothing
      • For each (Integer A) from 1 to 6, do (If (((Player((Integer A))) slot status) Equal to Is playing) then do (Player Group - Add (Player((Integer A))) to Team1) else do (Do nothing))
      • For each (Integer A) from 7 to 12, do (If (((Player((Integer A))) slot status) Equal to Is playing) then do (Player Group - Add (Player((Integer A))) to Team2) else do (Do nothing))
      • Trigger - Run Set Up Leaderboard <gen> (ignoring conditions)


Trigger:
  • create
    • Events
      • Time - Every 2.00 seconds of game time
    • Conditions
    • Actions
      • -------- Team 1 --------
      • -------- Red/ Orange --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player 1 (Red) slot status) Equal to Is playing
        • Then - Actions
          • Unit - Create 1 Foot Soldier for Player 6 (Orange) at (Player 6 (Orange) start location) facing Default building facing degrees
          • Unit - Order (Last created unit) to Attack-Move To (Center of BottomTarget <gen>)
        • Else - Actions
          • Do nothing
      • -------- Blue/ Purple --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player 2 (Blue) slot status) Equal to Is playing
        • Then - Actions
          • Unit - Create 1 Foot Soldier for Player 4 (Purple) at (Player 4 (Purple) start location) facing Default building facing degrees
          • Unit - Order (Last created unit) to Attack-Move To (Center of BottomTarget <gen>)
        • Else - Actions
          • Do nothing
      • -------- Teal/ Dark Green --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player 3 (Teal) slot status) Equal to Is playing
        • Then - Actions
          • Unit - Create 1 Foot Soldier for Player 11 (Dark Green) at (Player 11 (Dark Green) start location) facing Default building facing degrees
          • Unit - Order (Last created unit) to Attack-Move To (Center of BottomTarget <gen>)
        • Else - Actions
          • Do nothing
      • -------- Team 2 --------
      • -------- Green/ Yellow --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player 7 (Green) slot status) Equal to Is playing
        • Then - Actions
          • Unit - Create 1 Foot Soldier for Player 5 (Yellow) at (Player 5 (Yellow) start location) facing Default building facing degrees
          • Unit - Order (Last created unit) to Attack-Move To (Center of Top Target <gen>)
        • Else - Actions
          • Do nothing
      • -------- Pink/ Light Blue --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player 8 (Pink) slot status) Equal to Is playing
        • Then - Actions
          • Unit - Create 1 Foot Soldier for Player 10 (Light Blue) at (Player 10 (Light Blue) start location) facing Default building facing degrees
          • Unit - Order (Last created unit) to Attack-Move To (Center of Top Target <gen>)
        • Else - Actions
          • Do nothing
      • -------- Gray/ Brown --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player 9 (Gray) slot status) Equal to Is playing
        • Then - Actions
          • Unit - Create 1 Foot Soldier for Player 12 (Brown) at (Player 12 (Brown) start location) facing Default building facing degrees
          • Unit - Order (Last created unit) to Attack-Move To (Center of Top Target <gen>)
        • Else - Actions
          • Do nothing


Trigger:
  • Attack power upgrade
    • Events
      • Unit - A unit Finishes research
    • Conditions
      • (Researched tech-type) Equal to Foot Soldier Sword
    • Actions
      • Player - Set the current research level of Golem Strength a to ((Current research level of Foot Soldier Sword for (Triggering player)) + 2) for (Owner of (Researching unit))
      • Player - Set the current research level of Golem Strength b to ((Current research level of Foot Soldier Sword for (Triggering player)) + 1) for (Triggering player)
      • Player - Set the current research level of Golem Strength c to ((Current research level of Foot Soldier Sword for (Triggering player)) + 0) for (Triggering player)
      • Player - Set the current research level of Golem Strength d to ((Current research level of Foot Soldier Sword for (Triggering player)) - 1) for (Triggering player)
      • Player - Set the current research level of Golem Strength e to ((Current research level of Foot Soldier Sword for (Triggering player)) - 2) for (Triggering player)
      • Player - Set the current research level of Black Gunpowder to ((Current research level of Foot Soldier Sword for (Triggering player)) + 3) for (Triggering player)
      • If ((Owner of (Researching unit)) Equal to Player 1 (Red)) then do (Player - Set the current research level of Foot Soldier Sword to (Current research level of Foot Soldier Sword for Player 1 (Red)) for Player 6 (Orange)) else do (Do nothing)
      • If ((Owner of (Researching unit)) Equal to Player 2 (Blue)) then do (Player - Set the current research level of Foot Soldier Sword to (Current research level of Foot Soldier Sword for Player 2 (Blue)) for Player 4 (Purple)) else do (Do nothing)
      • If ((Owner of (Researching unit)) Equal to Player 3 (Teal)) then do (Player - Set the current research level of Foot Soldier Sword to (Current research level of Foot Soldier Sword for Player 3 (Teal)) for Player 11 (Dark Green)) else do (Do nothing)
      • If ((Owner of (Researching unit)) Equal to Player 7 (Green)) then do (Player - Set the current research level of Foot Soldier Sword to (Current research level of Foot Soldier Sword for Player 7 (Green)) for Player 5 (Yellow)) else do (Do nothing)
      • If ((Owner of (Researching unit)) Equal to Player 8 (Pink)) then do (Player - Set the current research level of Foot Soldier Sword to (Current research level of Foot Soldier Sword for Player 8 (Pink)) for Player 10 (Light Blue)) else do (Do nothing)
      • If ((Owner of (Researching unit)) Equal to Player 9 (Gray)) then do (Player - Set the current research level of Foot Soldier Sword to (Current research level of Foot Soldier Sword for Player 8 (Pink)) for Player 12 (Brown)) else do (Do nothing)
 

Sim

Forum Administrator
Staff member
Reaction score
534
I just don't get what you mean by "spread out my triggers".

Apart from numerous memory leaks, your triggers are fine.
 

Romek

Super Moderator
Reaction score
964

skyblader

You're living only because it's illegal killing.
Reaction score
159
Please do not double post. Use the edit button if you have to. A link is already posted to help you with memory leaks. It explains what it is, how it leaks, and how to clear them as well. Just click on the link ;)
 

vonahs

New Member
Reaction score
0
ok for units one i tihnk i know how to fix it, but that tut doesnt give variable values which i am starting to get in to (creating a leadership board now) and is there a leak in the armor upgrade? cuz i cant think of one.
 

skyblader

You're living only because it's illegal killing.
Reaction score
159
Is it me.. Or I don't see any armour upgrade triggers?
 

vonahs

New Member
Reaction score
0
so its only the unit create trigger? (that i fgirue cuz i read the memory leak)


Edit

darn now i see a few leaks in the Initialization
 

vonahs

New Member
Reaction score
0
Are the Leaks fixed? for this trigger? if so then i know how to fix the other unit leaks

Trigger:
  • Initialization
    • Events
      • Time - Elapsed game time is 1.00 seconds
    • Conditions
    • Actions
      • -------- Team 1 (RED,BLUE,TEAL) --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Or - Any (Conditions) are true
            • Conditions
              • (Player 1 (Red) slot status) Equal to Is playing
              • (Player 1 (Red) controller) Equal to Computer
        • Then - Actions
          • Visibility - Create an initially Enabled visibility modifier for Player 1 (Red) emitting Visibility across Vision <gen>
          • Visibility - Create an initially Enabled visibility modifier for Player 1 (Red) emitting Visibility across Vision top <gen>
          • Player - Set Player 1 (Red) Current gold to 50
          • Set TempPoint[1] = (Player 1 (Red) start location)
          • Unit - Create 2 Kings Men for Player 1 (Red) at TempPoint[1] facing Default building facing degrees
          • Unit - Create 1 Fortess for Player 1 (Red) at TempPoint[1] facing Default building facing degrees
          • Custom script: call RemoveLocation (udg_TempPoint[1])
        • Else - Actions
          • Do nothing
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Or - Any (Conditions) are true
            • Conditions
              • (Player 2 (Blue) slot status) Equal to Is playing
              • (Player 2 (Blue) controller) Equal to Computer
        • Then - Actions
          • Visibility - Create an initially Enabled visibility modifier for Player 2 (Blue) emitting Visibility across Vision top <gen>
          • Visibility - Create an initially Enabled visibility modifier for Player 2 (Blue) emitting Visibility across Vision <gen>
          • Player - Set Player 2 (Blue) Current gold to 50
          • Set TempPoint[2] = (Player 2 (Blue) start location)
          • Unit - Create 2 Kings Men for Player 2 (Blue) at TempPoint[2] facing Default building facing degrees
          • Unit - Create 1 Fortess for Player 2 (Blue) at TempPoint[2] facing Default building facing degrees
          • Custom script: call RemoveLocation (udg_TempPoint[2])
        • Else - Actions
          • Do nothing
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Or - Any (Conditions) are true
            • Conditions
              • (Player 3 (Teal) slot status) Equal to Is playing
              • (Player 3 (Teal) controller) Equal to Computer
        • Then - Actions
          • Visibility - Create an initially Enabled visibility modifier for Player 3 (Teal) emitting Visibility across Vision top <gen>
          • Visibility - Create an initially Enabled visibility modifier for Player 3 (Teal) emitting Visibility across Vision <gen>
          • Player - Set Player 3 (Teal) Current gold to 50
          • Set TempPoint[3] = (Player 3 (Teal) start location)
          • Unit - Create 2 Kings Men for Player 3 (Teal) at TempPoint[3] facing Default building facing degrees
          • Unit - Create 1 Fortess for Player 3 (Teal) at TempPoint[3] facing Default building facing degrees
          • Custom script: call RemoveLocation (udg_TempPoint[3])
        • Else - Actions
          • Do nothing
      • -------- Team 1 (GREEN,PINK,GRAY) --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Or - Any (Conditions) are true
            • Conditions
              • (Player 7 (Green) slot status) Equal to Is playing
              • (Player 7 (Green) controller) Equal to Computer
        • Then - Actions
          • Visibility - Create an initially Enabled visibility modifier for Player 7 (Green) emitting Visibility across Vision <gen>
          • Visibility - Create an initially Enabled visibility modifier for Player 7 (Green) emitting Visibility across Vision top <gen>
          • Player - Set Player 7 (Green) Current gold to 50
          • Set TempPoint[4] = (Player 7 (Green) start location)
          • Unit - Create 2 Kings Men for Player 7 (Green) at TempPoint[4] facing Default building facing degrees
          • Unit - Create 1 Fortess for Player 7 (Green) at TempPoint[4] facing Default building facing degrees
          • Custom script: call RemoveLocation (udg_TempPoint[4])
        • Else - Actions
          • Do nothing
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Or - Any (Conditions) are true
            • Conditions
              • (Player 8 (Pink) slot status) Equal to Is playing
              • (Player 8 (Pink) controller) Equal to Computer
        • Then - Actions
          • Visibility - Create an initially Enabled visibility modifier for Player 8 (Pink) emitting Visibility across Vision <gen>
          • Visibility - Create an initially Enabled visibility modifier for Player 8 (Pink) emitting Visibility across Vision top <gen>
          • Player - Set Player 8 (Pink) Current gold to 50
          • Set TempPoint[5] = (Player 8 (Pink) start location)
          • Unit - Create 2 Kings Men for Player 8 (Pink) at TempPoint[5] facing Default building facing degrees
          • Unit - Create 1 Fortess for Player 8 (Pink) at TempPoint[5] facing Default building facing degrees
          • Custom script: call RemoveLocation (udg_TempPoint[5])
        • Else - Actions
          • Do nothing
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Or - Any (Conditions) are true
            • Conditions
              • (Player 9 (Gray) slot status) Equal to Is playing
              • (Player 9 (Gray) controller) Equal to Computer
        • Then - Actions
          • Visibility - Create an initially Enabled visibility modifier for Player 9 (Gray) emitting Visibility across Vision <gen>
          • Visibility - Create an initially Enabled visibility modifier for Player 9 (Gray) emitting Visibility across Vision top <gen>
          • Player - Set Player 9 (Gray) Current gold to 50
          • Set TempPoint[6] = (Player 9 (Gray) start location)
          • Unit - Create 2 Kings Men for Player 9 (Gray) at TempPoint[6] facing Default building facing degrees
          • Unit - Create 1 Fortess for Player 9 (Gray) at TempPoint[6] facing Default building facing degrees
          • Custom script: call RemoveLocation (udg_TempPoint[6])
        • Else - Actions
          • Do nothing
      • For each (Integer A) from 1 to 6, do (If (((Player((Integer A))) slot status) Equal to Is playing) then do (Player Group - Add (Player((Integer A))) to Team1) else do (Do nothing))
      • For each (Integer A) from 7 to 12, do (If (((Player((Integer A))) slot status) Equal to Is playing) then do (Player Group - Add (Player((Integer A))) to Team2) else do (Do nothing))
      • Trigger - Run Set Up Leaderboard <gen> (ignoring conditions)
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • WildTurkey WildTurkey:
    is there a stephen green in the house?
    +1
  • The Helper The Helper:
    What is up WildTurkey?
  • The Helper The Helper:
    Looks like Google fixed whatever mistake that made the recipes on the site go crazy and we are no longer trending towards a recipe site lol - I don't care though because it motivated me to spend alot of time on the site improving it and at least now the content people are looking at is not stupid and embarrassing like it was when I first got back into this like 5 years ago.
  • The Helper The Helper:
    Plus - I have a pretty bad ass recipe collection now! That section of the site is 10 thousand times better than it was before
  • The Helper The Helper:
    We now have a web designer at my job. A legit talented professional! I am going to get him to redesign the site theme. It is time.
  • Varine Varine:
    I got one more day of community service and then I'm free from this nonsense! I polished a cop car today for a funeral or something I guess
  • Varine Varine:
    They also were digging threw old shit at the sheriff's office and I tried to get them to give me the old electronic stuff, but they said no. They can't give it to people because they might use it to impersonate a cop or break into their network or some shit? idk but it was a shame to see them take a whole bunch of radios and shit to get shredded and landfilled
  • The Helper The Helper:
    whatever at least you are free
  • Monovertex Monovertex:
    How are you all? :D
    +1
  • 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 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