is this a bug or not?

Get help using Construct 2

Post » Wed Jul 15, 2015 6:32 pm

I was trying to make a switch object that would make objects with the same instance value set in "objectID" switch on or off but in this case I was trying to make it change to another frame.
Link to Capx
Image
B
29
S
6
G
2
Posts: 233
Reputation: 2,895

Post » Wed Jul 15, 2015 6:39 pm

first off, you are setting the animation frame for the SwitchEnd 60 times per second.

Also you could easily use the Mouse OnClick event, instead of overlapping.
B
97
S
32
G
16
Posts: 1,199
Reputation: 16,680

Post » Wed Jul 15, 2015 6:45 pm

You would need a for each switch
is switch on
pick where oid = switch.oid

Animation speed of the sprites is not 0, so that can lead to further problems.

Your code seems to be not very straight-forward. Why not use something like this?:
Image

This way you dont check the switch every tick, to setup the switchends to the correct frame. If you face the problem that newly created switchends will not have the animation frame according to the switch, you could easily do a "on created"-event and then set it according to the switch boolean or add a function, that does a "for each switch"...
Visual Novel 'Engine' in 100 Events
if you ever have to choose between buying Construct 2 on scirra.com or on Steam, read this: Review
B
22
S
9
G
1
Posts: 787
Reputation: 3,786

Post » Wed Jul 15, 2015 6:51 pm

B
97
S
32
G
16
Posts: 1,199
Reputation: 16,680

Post » Wed Jul 15, 2015 7:04 pm

Oh yeah, should not pick the switchendsbefore the switch has been toggled, since if there would be no switchends with the correct objectid, the switch would not switch because the actions would not be run (or use pick by comparison, this should work regardless I think).
Visual Novel 'Engine' in 100 Events
if you ever have to choose between buying Construct 2 on scirra.com or on Steam, read this: Review
B
22
S
9
G
1
Posts: 787
Reputation: 3,786

Post » Wed Jul 15, 2015 7:35 pm

Thanks works without a problem. :D
B
29
S
6
G
2
Posts: 233
Reputation: 2,895


Return to How do I....?

Who is online

Users browsing this forum: Lancifer, MPPlantOfficial, Sup with that? and 61 guests