Random Instance problem

  • I have just started using Construct a few days ago. So far so good, but I can't seem to figure this problem out.

    I have objects called servers that supposed to

    • randomly every 1-4 seconds pick an instance that has a state of 0 and flip it to state 1.
    • In state 1 every 1 second add to the an instance variable of how long it has been in state 1 "secondsBreaking".
    • When the instance variable secondsBreaking reaches 5 flip the state to state 2.
    • In state 2 it should wait 3 seconds then go back to state 0.

    All of this works except for an oddity. The random instance event will sometimes pick a server flip it to state 1 and back to 0 in a flash of a second. Almost like it's saying "oops, never mind not that one."

    What am I doing wrong?! Any help would be greatly appreciated!

    I have attached my event sheet with the section that controls all of this. No other section in my event sheet controls these objects or variables.

  • Sorry dont have much time but generally, put the every-x-seconds trigger as the top condition. Hope it helps.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • I gave it a shot, unfortunately it's still happening. Doesn't make any sense to me.

  • It does appear your logic could change the state from 0 to 1, then in the same tick change it to 2 then back to 0 again, depending on the value of secondsBreaking.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)