Clones & Pin Behavior

Get help using Construct 2

Post » Thu May 28, 2015 12:47 pm

I'm having a very odd problem with my project.

My game allows the player to customize the character (robot) with owned items/parts.

What I did was I cloned 'Body2' to make 'Body3' (a lot of work to adjust everything from the start), but even if I don't replace the graphics, the pin behavior is not working right:

Image

As soon as I change the direction of the robot (that has the cloned body), it goes off place.

I tried to debug this and double-checked everything. The clone is in all same families, has identical properties and events referring to it. I have the pin behavior in the object family, maybe that's the root of my problems?
"If you don't build your dream, someone else will hire you to build theirs"
B
12
S
4
G
1
Posts: 60
Reputation: 969

Post » Thu May 28, 2015 1:23 pm

can you post a capx so we can review/edit it for your?
B
141
S
44
G
10
Posts: 135
Reputation: 14,103

Post » Thu May 28, 2015 1:34 pm

not sure why you'd use a clone instead of another instance, but are all events the same on both clones, are all behaviours and settings for them the same, are they at exactly the same place when the pinning occurs?

If these questions don't help, adding a capx to review would be the only option..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Thu May 28, 2015 2:59 pm

LittleStain wrote:not sure why you'd use a clone instead of another instance, but are all events the same on both clones, are all behaviours and settings for them the same, are they at exactly the same place when the pinning occurs?

If these questions don't help, adding a capx to review would be the only option..

I'm trying to make a new type of body (different img file) for the robot. I used an untouched clone in my example just to show that the problem is not in the different image file.

All events are the same, everything looks same in debugger and settings. Both objects are spawned at player.x, player.y (char.x, char.y) at the start of the layout. Only difference is the name (Body2 and Body3) and the variable to detect which body is chosen (2 and 3).

Kind of hesistant to post a capx to my game that I've been working for half a year now. If I really can't get this fixed, I'll post a capx that only includes the layouts/objects/events involved with this bug. For now, here's a screenshot of my events:

Image
"If you don't build your dream, someone else will hire you to build theirs"
B
12
S
4
G
1
Posts: 60
Reputation: 969

Post » Thu May 28, 2015 3:31 pm

Still not sure why you'd use clones..
using an animationframe for this would work fine looking at your events..

are you destroying all other family-members or could there still be present so the pinning is done to the wrong one?
what is the difference between char and player?
Why are there 2 on start of layout events, wouldn't calling a function for the events in playerbuild be more suitable?
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Thu May 28, 2015 6:12 pm

LittleStain wrote:Still not sure why you'd use clones..
using an animationframe for this would work fine looking at your events..

Been thinking of this but I have a simple animation for the mouth of the robot (made with image points). Not sure how well it could be done lag-free with events.
LittleStain wrote:are you destroying all other family-members or could there still be present so the pinning is done to the wrong one?

It has no function in Game layout because the robot is only generated once and there's no parts by default to destroy. That event is there just so I can use the same sheet for a preview in a Garage/Store layout (where you customize the robot).
LittleStain wrote:what is the difference between char and player?

Char is simply a family that has 'Player' and 'Puppet' objects in them. Both are invisible objects that each part of the robot is pinned to with the difference that Player is in the Game layout, using Bullet behavior and Puppet is in the Store layout using Sine behavior.
LittleStain wrote:Why are there 2 on start of layout events, wouldn't calling a function for the events in playerbuild be more suitable?

For some reason when they're all under the same event, it fails to run the actions after the function.

I have far more experiance in game graphics, so I'm not all familiar with best practices in programming or C2 still.
"If you don't build your dream, someone else will hire you to build theirs"
B
12
S
4
G
1
Posts: 60
Reputation: 969


Return to How do I....?

Who is online

Users browsing this forum: matriax, plinkie and 6 guests