Random Instance problem

Discussion and feedback on Construct 2

Post » Mon Jan 19, 2015 1:39 am

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.
You do not have the required permissions to view the files attached to this post.
B
2
Posts: 2
Reputation: 154

Post » Mon Jan 19, 2015 1:59 am

Sorry dont have much time but generally, put the every-x-seconds trigger as the top condition. Hope it helps.
B
24
S
9
G
4
Posts: 1,646
Reputation: 6,596

Post » Mon Jan 19, 2015 2:12 am

I gave it a shot, unfortunately it's still happening. Doesn't make any sense to me.
B
2
Posts: 2
Reputation: 154

Post » Mon Jan 19, 2015 2:16 am

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.
B
24
S
9
G
4
Posts: 1,646
Reputation: 6,596


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 17 guests