Instance variables

Get help using Construct 2

Post » Tue Apr 16, 2013 4:30 am

I am probably using Instance Variables incorrectly but I was watching the Memory Card Game video tutorials and I can't figure out what I've got wrong...

I've got two different methods of spawning items my Large and Small use the same method, my Medium uses a method closer to the video. Neither ones seems to be doing the trick...

I'd like to spawn a unique colored number per spawn set when they spawn and unchanging until they fade and are destroyed.

I've probably built this way too complex or there are probably a lot better ways but this is what my brain built so here I am...

I assign Instance Variables to the name for each instance but when the Animation Frame set is changed they all change...

.capx posted here:
https://dl.dropboxusercontent.com/u/39000273/CleanTest.capx

Thanks!
B
10
S
4
G
2
Posts: 133
Reputation: 2,667

Post » Tue Apr 16, 2013 4:34 am

It may help.

https://www.scirra.com/tutorials/361/understanding-uid-iid-health-cards-and-rocket-smoke-trail/

https://www.scirra.com/tutorials/355/making-character-composed-of-multiple-parts/TELLES08082013-04-16 04:34:41
ImageImageImageImageImageImage
B
92
S
19
G
12
Posts: 1,192
Reputation: 18,276

Post » Tue Apr 16, 2013 4:35 am

I think I know why now that I'm watching it run... Its working I just need more animation frames, enough to satisfy the amount of unique frames visible at any time.

That changes my question... I am trying to prevent items spawning on top of each other using an Overlapping object check at spawn but that is causing some Animation Frames to be skipped because its a timed cycle... If I change the cycle to a When I get nothing...

I should probably make a new Post for the changed question...

Thanks!
B
10
S
4
G
2
Posts: 133
Reputation: 2,667

Post » Tue Apr 16, 2013 4:44 am

I read through the two posts listed and they don't seem to address my problem. They relate more to how to connect items together and I need to assign Animation Frames to instances of items as they are created and have them not shift.

Watching even closer now I can see I have something very wrong going on. Some of my emitters are putting out objects that are changing animation frame with the cycle and some objects are not.

I am totally lost...
B
10
S
4
G
2
Posts: 133
Reputation: 2,667

Post » Tue Apr 16, 2013 5:10 am

Ok I got it... I had to add an "On Created" action to set everything I couldn't just change the numbers after spawn. The post above:

https://www.scirra.com/tutorials/361/understanding-uid-iid-health-cards-and-rocket-smoke-trail

sort of helped because I could see the "On Create" action and decided it might fix my problem... it fixed all kinds of problems actually.

Thanks for taking a look and for the post. It helped a lot in the long run!
B
10
S
4
G
2
Posts: 133
Reputation: 2,667


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 4 guests