Can anyone think of a logical way to solve this event?

Get help using Construct 2

Post » Sat Dec 12, 2015 2:13 pm

If All Sprite1.varActivated = 1 then

Set All Sprite2.varOpen to 1

Else If One / All Sprite1.varActivated = 0

Set All Sprite2.varOpen to 0

End If


I want to open all sprite2 if all sprite1 is activated but if 1 or many or all sprite1 is not activated then All Sprite 2 will be closed.



Can anyone solve this problem in the event sheet? @Ashley
Image



The Things you can create is only limited by your imagination. If you don't have the skills then use your motivation as a natural force to exceed all expectations. Chadori RebornXD
B
51
S
17
G
90
Posts: 1,108
Reputation: 59,024

Post » Sat Dec 12, 2015 2:21 pm

Not sure why you'd need Ashley for this..

You'd only need:

Sprite1 compare variable varactivated = 1
(subevent)
system compare two values: Sprite1.pickedcount = sprite1.count
> sprite2 set variable varopen = 1
else
> sprite2 set variable varopen = 0
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Sat Dec 12, 2015 2:25 pm

Image
Image
B
61
S
23
G
7
Posts: 1,461
Reputation: 10,686

Post » Sat Dec 12, 2015 2:36 pm

It still doesn't work @LittleStain

---------------------what happens---------------

when a single / all sprite1.varactivated = 1 ( single or more sprite1)
all sprite2.varopen is set to 1

----------------------Goal----------------------
but what I want is : If all sprite1.varactivated = 1
all sprite2.varopen is set to 1

but if one / not all sprite1.varactivated = 1 (not all sprite1.varactivated = 1)
all sprite2.varopen is set to 0
Image



The Things you can create is only limited by your imagination. If you don't have the skills then use your motivation as a natural force to exceed all expectations. Chadori RebornXD
B
51
S
17
G
90
Posts: 1,108
Reputation: 59,024

Post » Sat Dec 12, 2015 2:50 pm

Thanks @LittleStain & @korbaach ! helped a lot. I forgot to remove the ForEach Loop thats why it did not work earlier.
Image



The Things you can create is only limited by your imagination. If you don't have the skills then use your motivation as a natural force to exceed all expectations. Chadori RebornXD
B
51
S
17
G
90
Posts: 1,108
Reputation: 59,024


Return to How do I....?

Who is online

Users browsing this forum: dandeliongames, QuantumMMX and 6 guests