Event set up

Get help using Construct 2

Post » Wed Jun 05, 2013 5:51 pm

I'm pretty sure I got this right, but something doesn't seem to be working for me. Below is a copy of my event string for singles. The thought is that when the ball hits a part of the field it enables the variable Single. When that happens the bases are filled accordingly. For some reason, on certain layouts I've noticed it gives the right bases output, but the score changes when it shouldn't be.

I assumed that's cause when one variable changes(like 1st base) then it triggers another event, but all the events change the "Single" Variable to 2, so wouldn't that disable all events under Single? Or am I missing something?

B
13
S
3
G
2
Posts: 45
Reputation: 2,308

Post » Wed Jun 05, 2013 9:30 pm

Your problem comes from the fact that some cases cause two or more conditions to successively become true. A problem easily avoided by adding an else statement to each condition (excepted the first).
B
67
S
28
G
24
Posts: 970
Reputation: 18,675

Post » Wed Jun 05, 2013 10:15 pm

So, the events are being triggered so fast that my action of "+1 to Single" in the venets isn't getting done quick enough? Cause wouldn't making "Single = 2"(thus not meeting the requirement of "if Single = 1") cause the events to stop?
B
13
S
3
G
2
Posts: 45
Reputation: 2,308

Post » Thu Jun 06, 2013 3:34 am

No, that is not the case. Once the "Single = 1" condition has been evaluated and proven true, all sub-events will be executed, without ever "coming back" to see if "Single" still equals 1 (that is, until the next tick).Magistross2013-06-06 03:36:53
B
67
S
28
G
24
Posts: 970
Reputation: 18,675

Post » Thu Jun 06, 2013 3:12 pm

Ah, I see. Thank you.
B
13
S
3
G
2
Posts: 45
Reputation: 2,308


Return to How do I....?

Who is online

Users browsing this forum: Lancifer and 7 guests