Need help improving this small trigger

R 3 T R O

New Member
Reaction score
12
I'd like to make this trigger leak-less and lag-less as much as i can


Trigger:
  • Drop
    • Events
      • Time - Every 0.10 seconds of game time
    • Conditions
    • Actions
      • Set Point[1] = (Random point in Region 000 <gen>)
      • Unit - Create 1 Peasant for Player 1 (Red) at Point[1] facing Default building facing degrees
      • Custom script: call RemoveLocation(udg_Point[1])


Trigger:
  • Damage
    • Events
      • Unit - A unit enters (Entire map)
    • Conditions
      • (Unit-type of (Entering unit)) Equal to Peasant
    • Actions
      • Unit - Kill (Entering unit)
      • Set Point[2] = (Random point in Region 000 <gen>)
      • Unit - Cause (Entering unit) to damage circular area after 0.00 seconds of radius 200.00 at Point[2], dealing 100.00 damage of attack type Normal and damage type Normal
      • Custom script: call RemoveLocation(udg_Point[2])
 
As far as I can tell there are no leaks, and it shouldn't cause lag.
 
Why would you create a unit, just to kill it to damage an area ?! :S
Why not just create an explosion there or something ? :eek:
 
This does seem rather pointless to make it just to kill it. You could have a single dummy unit in some corner of the map deal all the damage. I'm not sure if the damage would be dealt if you kill it first anyway.
 
this trigger is leakless.

this trigger should not lag for any computer which is less then 15 years old.

this trigger is absolutely pointless. do as the others said, use some dummy unit and dump that peasant creation idea.

This does seem rather pointless to make it just to kill it. You could have a single dummy unit in some corner of the map deal all the damage. I'm not sure if the damage would be dealt if you kill it first anyway.

the damage will be dealt no matter whether its dead or not, only if you remove it the damage would not be dealt.
 
It does leak, as whenever you use the little thing called "(Entire Map)" it leaks... Use "(Playable map area)" instead ;)
 
It does leak, as whenever you use the little thing called "(Entire Map)" it leaks... Use "(Playable map area)" instead ;)

are you sure entire map leaks? i thought it would be a global, more over it is used in the event, that means it wouldnt be created periodically or with each call of this trigger, but only once.
 
It just creates a region while game is starting, not that bad.But playable are is better :p
 
No, Entire Map isn't a global, but Playable map area is... It's stupid XD

thank you for the info, thats something i didnt know.
(not that its stupid, i knew that before, but that entire map is not global)
 
Well I think part of the problem is pretty obvious. .1 seconds is way too small of an interval. You have not one but 2 triggers running every tenth of a second. You also should consider that it has to run the death sequence for every single peasant. If that doesn't make a computer lag i dont know what will.

You should change the interval to at least .5 seconds, although I would recogmend making it a second or longer (a second won't feel like a very long time anyway).
 
Well I think part of the problem is pretty obvious. .1 seconds is way too small of an interval. You have not one but 2 triggers running every tenth of a second. You also should consider that it has to run the death sequence for every single peasant. If that doesn't make a computer lag i dont know what will.

You should change the interval to at least .5 seconds, although I would recogmend making it a second or longer (a second won't feel like a very long time anyway).

if these little actions will slow my computer down i would throw that computer out of the window.
this trigger will definitly not cause any lags if they stand alone.
 
General chit-chat
Help Users
  • The Helper The Helper:
    News portal has been retired. Main page of site goes to Headline News forum now
  • The Helper The Helper:
    I am working on getting access to the old news portal under a different URL for those that would rather use that for news before we get a different news view.
  • Ghan Ghan:
    Easily done
    +1
  • The Helper The Helper:
    https://www.thehelper.net/pages/news/ is a link to the old news portal - i will integrate it into the interface somewhere when i figure it out
  • Ghan Ghan:
    Need to try something
  • Ghan Ghan:
    Hopefully this won't cause problems.
  • Ghan Ghan:
    Hmm
  • Ghan Ghan:
    I have converted the Headline News forum to an Article type forum. It will now show the top 20 threads with more detail of each thread.
  • Ghan Ghan:
    See how we like that.
  • The Helper The Helper:
    I do not see a way to go past the 1st page of posts on the forum though
  • The Helper The Helper:
    It is OK though for the main page to open up on the forum in the view it was before. As long as the portal has its own URL so it can be viewed that way I do want to try it as a regular forum view for a while
  • Ghan Ghan:
    Yeah I'm not sure what the deal is with the pagination.
  • Ghan Ghan:
    It SHOULD be there so I think it might just be an artifact of having an older style.
  • Ghan Ghan:
    I switched it to a "Standard" article forum. This will show the thread list like normal, but the threads themselves will have the first post set up above the rest of the "comments"
  • The Helper The Helper:
    I don't really get that article forum but I think it is because I have never really seen it used on a multi post thread
  • Ghan Ghan:
    RpNation makes more use of it right now as an example: https://www.rpnation.com/news/
  • The Helper The Helper:
  • The Helper The Helper:
    What do you think Tom?
  • tom_mai78101 tom_mai78101:
    I will have to get used to this.
  • tom_mai78101 tom_mai78101:
    The latest news feed looks good
  • The Helper The Helper:
    I would like to see it again like Ghan had it the first time with pagination though - without the pagination that view will not work but with pagination it just might...
  • The Helper The Helper:
    This drink recipe I have had more than a few times back in the day! Mind Eraser https://www.thehelper.net/threads/cocktail-mind-eraser.194720/

      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