Help on Repeat

Get help using Construct 2

Post » Thu Aug 02, 2012 11:51 pm

Hi guys!

Having a bit of trouble with the repeat and for each tool.

Basically, I want to be able to create an object a certain number of times. The system will count how many times an object appears, and then create that many additional objects which then are placed atop.

The problem is, the loop never seems to stop. I even tried "Repeat 10 times - create object", and it just goes on and on.

Repeat Test

My For Each is getting similar results.

Now I've looked at other posts, and found the one on health bars quite interesting, but I don't think it applies to what I'm ultimately trying to create. Eventually I'd like to use the same tool for creating multiple pivot points, but I think it's way above my help at the moment.

If someone could correct the Repeat program I made, I'd be very grateful. If there's any bright sparks that know how to create a pivot point with physics for each object, then I would be very happy.

The idea I have is that if the system finds a pivot sprite, it will create a rotating physics bar to it. I tried to do this manually, but all the bars were linked to the same pivot point. Looked odd :)

Any help would be greatly appreciated!
@bearboxmedia
www.bearboxmedia.com

Nintendo Wii U Developer using Construct 2
B
68
S
8
G
6
Posts: 930
Reputation: 9,358

Post » Fri Aug 03, 2012 12:14 am

That 'repeat 10 times' repeats 10 times every tick. You need to make it a subevent of 'on start of layout' or something similar.
B
54
S
28
G
18
Posts: 1,520
Reputation: 25,020

Post » Fri Aug 03, 2012 12:23 am

Ahh, does the same apply for the 'for each'?AnD4D2012-08-03 00:24:20
@bearboxmedia
www.bearboxmedia.com

Nintendo Wii U Developer using Construct 2
B
68
S
8
G
6
Posts: 930
Reputation: 9,358

Post » Fri Aug 03, 2012 12:25 am

Yeah if it's a top level event it will run every tick.
B
54
S
28
G
18
Posts: 1,520
Reputation: 25,020

Post » Fri Aug 03, 2012 12:38 am

Thanks, ill give it a go. Do you know how to solve the physics joint issue?
@bearboxmedia
www.bearboxmedia.com

Nintendo Wii U Developer using Construct 2
B
68
S
8
G
6
Posts: 930
Reputation: 9,358

Post » Fri Aug 03, 2012 12:42 am

Here's an example: repeat.capx
B
54
S
28
G
18
Posts: 1,520
Reputation: 25,020

Post » Fri Aug 03, 2012 10:13 am

Brilliant! Thank you very much! A lot more straight forward than I thought!
@bearboxmedia
www.bearboxmedia.com

Nintendo Wii U Developer using Construct 2
B
68
S
8
G
6
Posts: 930
Reputation: 9,358


Return to How do I....?

Who is online

Users browsing this forum: 99Instances2Go and 19 guests