issue with variable check

Discussion and feedback on Construct 2

Post » Tue Jan 17, 2017 8:06 pm

I am using drag n drop on 6 items. Every time they are dropped in the correct place I add 1 to the global variable score.
I have a text set to score for a visual feedback and it is working fine. The score reaches 6.
When score = 6 I need a screen to slide in. However, though I think I have the correct code the slide does not move in.

Set up: 6 labels - 6 boxes - six check marks - 6 red crosses. (feedback items show when element dropped).
Code:
system/compare variable score
if score = 6 then move slide in (using LiteTeen) (LiteTeen is set to start from beginning)

This does not work so I added another global variable finished = 0

then I have if score = 6 then set finished to 1
if score = 6 and finished = 1 then move slide in - set animation to frame 0 (good! image)
if score < 6 and finished = 0 then move silde in - set animation to frame 1 (not so good! image)

Does not work either.

I tried to put the score variable on an every tick even too. still not joy!

Any idea why this is not working?
B
8
S
1
Posts: 86
Reputation: 618

Post » Tue Jan 17, 2017 8:19 pm

Educated guess.

Your score stays at 6. Now the 'event that moves' keeps starting the move from the beginning every tick. Tick, tick, tick tick ....

Or.
if score = 6
....set score to something different
....move slide in

Or
If score = 6
Once While true
...move slide in
B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950

Post » Tue Jan 17, 2017 8:33 pm

Does it work if you add the System object's Trigger once while true condition to your event?
B
137
S
33
G
17
Posts: 1,560
Reputation: 20,797

Post » Tue Jan 17, 2017 10:31 pm

Thanks for your input. I will try these and let you know probably tomorrow.
B
8
S
1
Posts: 86
Reputation: 618

Post » Wed Jan 18, 2017 1:29 pm

99Instances2Go - I used the following:
Code: Select all
if score = 6, set score to 7
if score = 7 slide in good

and it works.


FYI, for the 'not so good slide' I added a new variable called 'done' and add 1 to it when any drop is done. At the end if check both score and done.
Code: Select all
if score < 6 and done = 6, then slide in 'not so good'.


Thanks for your help. I wish there was a way to mark your answer as correct.
B
8
S
1
Posts: 86
Reputation: 618


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 11 guests