Infinite loop?

ShinyPickle

New Member
Reaction score
9
I think there is an infinite loop in my trigger, but I don't know where. It's actually a series of triggers that were working fine last night, and I don't think I changed them. Here are the triggers.

Trigger1
Event: Player - Player 1 (Red) types a chat message containing <Empty String> as An exact match

Action: Set Integer = (Integer((Entered chat string)))
That sets the integer to whatever number the player types. That was working.


Trigger2
Event: Time - Every 0.50 seconds of game time

Condition: Integer Greater than (Level of (Random unit from (Units in Region <gen>)))

Action: Trigger - Run Trigger3 <gen> (checking conditions)

If the number you typed in trigger1 is higher then the level of the unit currently in the region, it runs this trigger.

Action: If (Integer Equal to 1) then do (Unit - Remove (Random unit from (Units in Region <gen>)) from the game) else do (Do nothing)

Action: If (Integer Equal to 1) then do (Unit - Create 1 Unitl level 1 for Player 1 (Red) at (Center of Region <gen>) facing (Position of Barracks 0000 <gen>)) else do (Do nothing)

It was working fine last night... I wanted it to be so that when a specific event happens (Like the player typing the number, which was just to test it) it would change the value of the integer accordingly, thus placing the correct unit in the region. I had the same action in trigger3 5 times. One for each level. But when I test it, it creates infinite units one after another until I quit the game.
 

Exide

I am amazingly focused right now!
Reaction score
448
Um..
What the heck are these triggers? :p

-Why are you suspecting an infinite loop in one (or all) of these triggers?
-What happens?
-What is supposed to happen?
 

ShinyPickle

New Member
Reaction score
9
Um..
What the heck are these triggers? :p

-Why are you suspecting an infinite loop in one (or all) of these triggers?
-What happens?
-What is supposed to happen?

When I test the map, it keeps creating units in the same region one after another when I only want it to create one.
 

the Lumpy

►►►
Reaction score
53
Well, as long as the condition in Trigger 2 is true, Trigger 3 will run every .5 seconds. Keep in mind that the condition will only work as expected as long as there's only one unit in the region at a time.

As a last resort, you could set Integer to 0 after you create the unit -- that should stop the trigger from being run repeatedly.
 

ShinyPickle

New Member
Reaction score
9
But it only does it as long as the Intger is higher then the level of the unit... Maybe I screwed up and deleted an action from the trigger by mistake... I'll check that out.
 

cowmenace

New Member
Reaction score
22
Try this

In your second trigger, create a dummy for the player you want. set the dummy's custom value to 50. Make a .1 second expiration timer on the dummy.
In your third trigger, have the event be (Unit - A unit dies) and the condition be (Integer Comparison - Custom value of (Dying Unit) equal to 50)

that will also allow for the trigger to be MUI.

NOTE: your trigger leaks and since it is every .5 seconds you should make it leakless. http://world-editor-tutorials.thehelper.net/cat_usersubmit.php?view=27219
read that it will make your game much less laggy


If that doesn't work, then try turning off the third trigger as the last action in it.
 

the Lumpy

►►►
Reaction score
53
The best way you can help us help you is by explaining what you intend to use this for in as much detail as possible.

I recall you said that you were just using the chat message event for testing. It looks like you want the unit to be updated automatically whenever the variable changes. If this is the case, you might consider making your variable a real instead of an integer -- you would have to do a lot of conversions between real and integer types, but it would allow you to use the Game - Value Of Real Variable event.
 

cowmenace

New Member
Reaction score
22
Shinypickle -
I got the trigger finished, but the viruses are unable to have the ability locust, so I included another trigger that prevents a player from moving the unit at all. I also took the liberty in removing leaks and a bug that I found (typing in a number like 123 would spawn a million question marks) Be sure to read my trigger comments for tweaking things the way you want. You have private messages disabled so I put my message here =). Anyway give me an email at [email protected] and I'll send it over to you, or give me permission to post it in this thread and I will.
 
General chit-chat
Help Users
  • The Helper The Helper:
    The bots will show up as users online in the forum software but they do not show up in my stats tracking. I am sure there are bots in the stats but the way alot of the bots treat the site do not show up on the stats
  • Varine Varine:
    I want to build a filtration system for my 3d printer, and that shit is so much more complicated than I thought it would be
  • Varine Varine:
    Apparently ABS emits styrene particulates which can be like .2 micrometers, which idk if the VOC detectors I have can even catch that
  • Varine Varine:
    Anyway I need to get some of those sensors and two air pressure sensors installed before an after the filters, which I need to figure out how to calculate the necessary pressure for and I have yet to find anything that tells me how to actually do that, just the cfm ratings
  • Varine Varine:
    And then I have to set up an arduino board to read those sensors, which I also don't know very much about but I have a whole bunch of crash course things for that
  • Varine Varine:
    These sensors are also a lot more than I thought they would be. Like 5 to 10 each, idk why but I assumed they would be like 2 dollars
  • Varine Varine:
    Another issue I'm learning is that a lot of the air quality sensors don't work at very high ambient temperatures. I'm planning on heating this enclosure to like 60C or so, and that's the upper limit of their functionality
  • Varine Varine:
    Although I don't know if I need to actually actively heat it or just let the plate and hotend bring the ambient temp to whatever it will, but even then I need to figure out an exfiltration for hot air. I think I kind of know what to do but it's still fucking confusing
  • The Helper The Helper:
    Maybe you could find some of that information from AC tech - like how they detect freon and such
  • Varine Varine:
    That's mostly what I've been looking at
  • Varine Varine:
    I don't think I'm dealing with quite the same pressures though, at the very least its a significantly smaller system. For the time being I'm just going to put together a quick scrubby box though and hope it works good enough to not make my house toxic
  • Varine Varine:
    I mean I don't use this enough to pose any significant danger I don't think, but I would still rather not be throwing styrene all over the air
  • The Helper The Helper:
    New dessert added to recipes Southern Pecan Praline Cake https://www.thehelper.net/threads/recipe-southern-pecan-praline-cake.193555/
  • The Helper The Helper:
    Another bot invasion 493 members online most of them bots that do not show up on stats
  • Varine Varine:
    I'm looking at a solid 378 guests, but 3 members. Of which two are me and VSNES. The third is unlisted, which makes me think its a ghost.
    +1
  • The Helper The Helper:
    Some members choose invisibility mode
    +1
  • The Helper The Helper:
    I bitch about Xenforo sometimes but it really is full featured you just have to really know what you are doing to get the most out of it.
  • The Helper The Helper:
    It is just not easy to fix styles and customize but it definitely can be done
  • The Helper The Helper:
    I do know this - xenforo dropped the ball by not keeping the vbulletin reputation comments as a feature. The loss of the Reputation comments data when we switched to Xenforo really was the death knell for the site when it came to all the users that left. I know I missed it so much and I got way less interested in the site when that feature was gone and I run the site.
  • Blackveiled Blackveiled:
    People love rep, lol
    +1
  • The Helper The Helper:
    The recipe today is Sloppy Joe Casserole - one of my faves LOL https://www.thehelper.net/threads/sloppy-joe-casserole-with-manwich.193585/
  • The Helper The Helper:
    Decided to put up a healthier type recipe to mix it up - Honey Garlic Shrimp Stir-Fry https://www.thehelper.net/threads/recipe-honey-garlic-shrimp-stir-fry.193595/
  • The Helper The Helper:
    Here is another comfort food favorite - Million Dollar Casserole - https://www.thehelper.net/threads/recipe-million-dollar-casserole.193614/

      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