Separate animations for instances

Get help using Construct 2

Post » Wed Sep 04, 2013 1:04 am

OK guys, I have a situation and I can't for the life of me figure out how to do what I want to do. Searched the forums, manual, every
thing.

Here is the https://www.dropbox.com/s/key8wu2yzje8322/Game.capx

What I want to do here is make sure that the rotaries play the connect animation when the notches overlap. I have got this working but with a few problems:

1 - The animation triggers on all rotaries regardless of connection or not, if only one is overlapping.

2 - The animation doesn't change back when they are no longer overlapping

I've tried so far what I call an ascending tag system. That is, dishing out tags to instances using instance variables and one global variable. It didn't work XD

I was considering arrays, but I'm not all that savvy just yet, so I haven't tried.

What are your opinions, guys and gals?
B
7
S
2
G
2
Posts: 13
Reputation: 1,553

Post » Wed Sep 04, 2013 1:13 am

Im on my mobile at moment but if you give the rotary an instance variable then on overlap set variable to 1, another event with condition of rotary variable = 1 to them perform the action

Edit: you can then set the variable back to zero in the action event.

Hope this makes senseJWstudios2013-09-04 01:15:41
B
10
S
2
G
1
Posts: 77
Reputation: 1,278

Post » Wed Sep 04, 2013 1:30 am

If you mean an instance variable that changes from 0 for 'not connected' to 1 for 'connected', I did try that, but for some reason it didn't work. I set the animation for 'every tick' to check for a change in value, but the problem I think is having every instance have it's own unique ID, I've not managed to connect the dots so far....
B
7
S
2
G
2
Posts: 13
Reputation: 1,553

Post » Sat Sep 07, 2013 11:19 am

Anyone got any ideas, still a bit stuck on this, not sure which direction I should be looking :S
B
7
S
2
G
2
Posts: 13
Reputation: 1,553

Post » Sat Sep 07, 2013 2:09 pm

Game_BHT_139.capx

Each object already has an IID and UID, so you probably don't need another tag, but maybe you do, so I left that alone. I think this does what you need.
ImageImageImage
B
71
S
22
G
247
Posts: 3,756
Reputation: 137,558

Post » Sat Sep 07, 2013 9:44 pm

Wow BH, that is amazing! I've been stuck on this for ages and you solved it rather quickly, I checked by disabling the tags and you do need them. At least I was on the right track with those. Thanks very much for helping me dude, means a lot! :D
B
7
S
2
G
2
Posts: 13
Reputation: 1,553

Post » Sat Sep 07, 2013 10:18 pm

This is an awesome solution dude, can I ask a couple of things, everything else makes sense :)

1 - why do you need to turn on the second notch, I disabled the second, still a good 'un ;D

2 - when connection is set to '1', where does the variable 'connection' affect the animations?
B
7
S
2
G
2
Posts: 13
Reputation: 1,553

Post » Sat Sep 07, 2013 10:18 pm

You wouldn't disable them, you'd use UID instead, for example. Often to link things, you store the UID of the other object so that you can always pick, regardless of which object is picked first. If you are happy with a separate ID, then leave it alone.
ImageImageImage
B
71
S
22
G
247
Posts: 3,756
Reputation: 137,558

Post » Sat Sep 07, 2013 10:21 pm

1 - I obviously misunderstood what you wanted.
2 - event 15
ImageImageImage
B
71
S
22
G
247
Posts: 3,756
Reputation: 137,558

Post » Sun Sep 08, 2013 12:05 am

That's awesome, BH :D Thanks again for the help!
B
7
S
2
G
2
Posts: 13
Reputation: 1,553

Next

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 41 guests