[SOLVED] Aaaand...another Ragdoll question

Get help using Construct 2

Post » Mon Nov 21, 2016 5:55 pm

Hey everyone.

I'm currently challenging myself in creating a hangman-ish game with a physically interactive hangman.
Creating a ragdoll isn't that much of a problem, but attaching the head of the ragdoll to the gibbet seems to break it.

What I want is to have the ragdoll simply hanging on the gibbet, but being physically interactive.

What happens, is:
  • the head doesn't rotate anymore (and so do the connected objects)
  • ragdoll objects stop moving completely after some time

I used distance joints and those are definitely needed because of my Sprite's layout.
I also disabled collisions between the ragdoll objects (as mentioned here by @silkc2) and added a delay before adding the joints (as mentioned here by @R0J0hound).

Here is my .capx:
Download

Any help is greatly appreciated.
Last edited by randomly on Mon Nov 21, 2016 7:03 pm, edited 1 time in total.
"We can't solve problems by using the same kind of thinking we used when we created them."
- Albert Einstein
B
27
S
11
G
8
Posts: 528
Reputation: 7,091

Post » Mon Nov 21, 2016 6:44 pm

Image

also on start disable dude Physics..wait 0.1...enable
Image
B
65
S
23
G
7
Posts: 1,502
Reputation: 10,890

Post » Mon Nov 21, 2016 7:03 pm

@korbaach

Great, that solved it! Thanks!

Though two questions:
  • Why/how does the collision polygon affect joints?
  • why is it necessary to disable the physics and re-enable them after a delay?

Thanks again!

EDIT: this also solves issues with revolute joints I had before. Awesome, thanks!
"We can't solve problems by using the same kind of thinking we used when we created them."
- Albert Einstein
B
27
S
11
G
8
Posts: 528
Reputation: 7,091

Post » Mon Nov 21, 2016 7:26 pm

why is it necessary to disable the physics and re-enable them after a delay?

Image

because Dude will fall down.. :D
just think as he have platform behavior..you have gravity..and gravity will not wait 0.1 second..


Why/how does the collision polygon affect joints?

gallows colision poligon will affect on head sprite(gonna push him)
just think as solid a platform..
Image
B
65
S
23
G
7
Posts: 1,502
Reputation: 10,890

Post » Mon Nov 21, 2016 7:45 pm

The wait shouldn't be needed in this case. Wait is only needed when you create a physics object with events and you want to add joints to it. Why? because the behavior needs a tick to update the positions in the physics world. It's a quirk and when I made the chipmunk behavior you don't have to worry about such things.

Anyways with your capx you just need to disable collisions between your physics objects. The collision polygon means they are overlapping so they will move out of each other and the joints will try pulling them into each other so it turns into a fight.
B
92
S
32
G
106
Posts: 5,272
Reputation: 69,455

Post » Mon Nov 21, 2016 9:12 pm

@R0j0hound

Thanks, did that, worked.
"We can't solve problems by using the same kind of thinking we used when we created them."
- Albert Einstein
B
27
S
11
G
8
Posts: 528
Reputation: 7,091

Post » Tue Nov 29, 2016 1:00 am

@R0J0hound
@korbaach

got another issue.
Thanks to you two, my project advanced and I now need to dismember bodyparts (god that sounds harsh).

That's what I got so far: (not very much since I don't want to continue before I got this solved)
Main event sheet:
Image
included event sheet "puppet control":
Image

The dismembering doesn't work when using the disabled event, but when I use the event below that.
(The layout definitely isn't the issue since it stays the same no matter whether it works or not)

I'd like to have all joints-creating events going from the body to the body part.
But apparently, that doesn't work, it just works when it starts at the body part.

Which is weird since the event "Remove all joints", according to its description, is supposed to remove all joints "from or to" the object.


Maybe a bug?
"We can't solve problems by using the same kind of thinking we used when we created them."
- Albert Einstein
B
27
S
11
G
8
Posts: 528
Reputation: 7,091

Post » Tue Nov 29, 2016 2:54 pm

@randomly you still need help on this?

even if not i took your first capx and created a hanging animations based on your ragged doll was more of a setting the right values really... also if you want to brake a leg or hand .... lol ... it does sound weird... just disable that joint from the body...

here it is
B
75
S
22
G
68
Posts: 1,335
Reputation: 43,267

Post » Tue Nov 29, 2016 4:40 pm

Can't open the project since I'm still using r239. Got some issues with the download. (Currently in a location with bad internet, connection breaks with files larger than 30mb)

Could you edit your post and add a screenshot of what you changed?

______________

gamecorpstudio wrote:just disable the joint from the body

Yeah, but that would disable all joints connected to the body, not only the arm..
"We can't solve problems by using the same kind of thinking we used when we created them."
- Albert Einstein
B
27
S
11
G
8
Posts: 528
Reputation: 7,091

Post » Tue Nov 29, 2016 6:12 pm

randomly wrote:

gamecorpstudio wrote:just disable the joint from the body

Yeah, but that would disable all joints connected to the body, not only the arm..

R239 Capx


i re-attached the limbs to the body on a order where you wold be able to cut them off without worrying to much about the body flying away... however no matter how many times you edit it..

the problem is this : each Original point 0 is the point of gravity or point of weight of an object if you move it down the point of gravity will pull from that part

imagine, you have a stick inside a iron ball and you can slide up and down the iron ball, wherever you move the ball that will be the center of gravity for the stick from now on...

thats how image point 0 works... its complicated... to explain in forum chat... but i hope you get my idea...

also object position in Layout editor matters when you create the joints... if positions are irregular then joint will be either to long or to short thats why the weird shakings and all that....

image the joint being an invisible rope. hope my logic of it made sense to it... and the capx helped you in your project.


Edited: also density which affects the way of world gravity and object heaviness is direct proportional with the density value you input and the size of collision box .... also the origin point 0 you have to have it dead center on X axes if you want things to be balanced...

but not on the center of the image... but on the center of the collision box.... image the collision box as being the filled material of the iron ball from the above stick... if the ball is missing one part then its weight and gravity point changes ... physics behavior is very complex to explain... ... need to make a live feed for it or record a entire video.
Last edited by gamecorpstudio on Tue Nov 29, 2016 6:18 pm, edited 1 time in total.
B
75
S
22
G
68
Posts: 1,335
Reputation: 43,267

Next

Return to How do I....?

Who is online

Users browsing this forum: DharmaOne, ezgaming420 and 19 guests