How do I duplicate ragdolls [SOLVED]

Get help using Construct 2

Post » Fri May 09, 2014 12:53 am

Sorry but after a lot of tries in my game, I still have weird behaviors with the physics...
So I went back to your exemple and I deactivated the limbs to keep only the head to discover what's going on.
You'll see that the only ragdoll with the head in the correct place is the first one. The others have the head far from the body. Here it's not really a problem, but in the game I'm trying to make, it's very visible since the body have a neck...
I've spent several hours today trying to comprehend what is going on. Is that some kind of weird bug in Construct 2?
You do not have the required permissions to view the files attached to this post.
B
8
S
2
G
1
Posts: 16
Reputation: 612

Post » Fri May 09, 2014 3:43 pm

So after a bunch of more tries, it appears that
Head - Set position (Body.X, Body.Y-10) works, but
Head - Set position (Body.ImagepointX("head"), Body.ImagepointY("head")) won't...
Seems like a Construct bug to me. Either way, I'll try that solution in my game and see if it finally works.
B
8
S
2
G
1
Posts: 16
Reputation: 612

Post » Fri May 09, 2014 3:56 pm

It seems to work fine for me. If you disable physics on each limb and the body and then try your example again you can see that the head is set to the correct position each time. Maybe you need to move the "head" imagepoint inside the body to change where the head is positioned to. Otherwise I'm not sure what the problem is...

PS you need to add @Colludium to your message or I won't get a notification that you're looking for more help.
A big fan of JavaScript.
B
76
S
20
G
76
Posts: 2,285
Reputation: 47,554

Post » Sat May 10, 2014 8:46 am

Oh ok
So @Colludium , I've prepared an example with the ragdoll I'm actually using in my game. You'll see that only the first one is ok and the others are quite messed up... You can move them using the arrows, try to keep the good looking one alive :lol:

Edit:
here's my last thought, maybe the problem comes from the limbs that are overlapping the body for a perfect connection? Maybe the bounding boxes don't like that...
You do not have the required permissions to view the files attached to this post.
B
8
S
2
G
1
Posts: 16
Reputation: 612

Post » Sat May 10, 2014 1:32 pm

There are 2 problems.

One is an error in the events - you position the DudeRightCuisse to an imagepoint on itself....

The second is caused by the container and is part of what you identified above. When the body is created, the container causes all of the limbs to overlap on top of each other - the physics engine then immediately tries to move them because they are in collision. When the joints are created, the limbs have moved from their desired positions by this movement and that's why the subsequent dolls are funny shapes.

Part of the fix to the second problem you have already identified - make sure that the collision polygons are not overlapping when the limbs are in position. You also need to have the physics turned off for the limbs until they have been moved from being in collision when they are created by the container. Once they have been correctly positioned you can turn their physics on.
A big fan of JavaScript.
B
76
S
20
G
76
Posts: 2,285
Reputation: 47,554

Post » Sat May 10, 2014 3:14 pm

Thanks @Colludium for the hints !
This time it is good. Disabling and enabling the physics did the trick. The overlaping limbs don't seems to cause any problems. And finally, there is no need for the .05s delay.
Here's the final duplicate ragdolls .capx ;)
You do not have the required permissions to view the files attached to this post.
B
8
S
2
G
1
Posts: 16
Reputation: 612

Previous

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 5 guests