How do I pin to family on start of layout?

Get help using Construct 2

Post » Sat Nov 19, 2016 12:00 pm

Hey there,

I have a problem. This time, I’m trying to make a chain on start of layout.

I’m using pin behaviour -template (which is included in C2) as a base. In this example, Blobs are already on layout and are pinned to each other on start of layout. Then, depending of their instance variable “number”, they are pinned to player or to each other. (I won’t cover that much details here, check my capx or example in C2 for more details)

However, I need to create these blobs during run time on start of layout. This is where I’m having a problem. First I thought I can just replace “for each” with “repeat nn times” event and call it a day. I was wrong. I don’t understand what I’m doing wrong here.

Remove those *** from https: to download.
h*t*t*p*s://dl.dropboxusercontent.com/u/43020976/Scirra%20forums/pin%20to%20family/pin_to_family_example_r233.capx

Any kind of help is highly appreciated.

-M-
B
16
S
2
Posts: 58
Reputation: 980

Post » Sat Nov 19, 2016 1:05 pm

Link is broken. (yes with * removed lol)
B
45
S
15
G
73
Posts: 2,002
Reputation: 43,386

Post » Sat Nov 19, 2016 1:15 pm

@Mithrill

I think there are two problems.
1. The Blobs you created in the reapeat-loop are only accessible after the loop.
2. The pin-behavior belongs to the Family

It is like you said, you need a family to have two objects for pinning.
I made an example:
https://drive.google.com/file/d/0B5FlDY ... sp=sharing
B
24
S
3
G
1
Posts: 451
Reputation: 2,165

Post » Sat Nov 19, 2016 4:34 pm

@Asmodean

Thank you so much! You helped me a lot ^^

-M-
B
16
S
2
Posts: 58
Reputation: 980

Post » Fri Jun 23, 2017 7:24 am

I'm trying to achieve this same thing but I'm using a Function to spawn the object by name in order to generalize the EnemySpawn function.

Is there a way to accomplish this since I can't Pick all "Function.Param(0)"

SOLVED

I just added a blank sub-event with Set healthBar to Enemies.imagepoint 1
B
9
S
3
G
1
Posts: 43
Reputation: 1,288


Return to How do I....?

Who is online

Users browsing this forum: R0J0hound and 7 guests