ragdoll

Posted By: frescosteve

ragdoll - 08/14/07 15:41

Is there a way to make a ragdoll like character. If so, would you need separate entities and then attach them. or use another method? And if you use constraints how do you make it so the model is able to move? ~(anchor point stop movement)
Posted By: xXxGuitar511

Re: ragdoll - 08/14/07 18:01

This has been asked many times, please use the search button

..yes, you can make ragdoll physics in 3DGS

http://www.coniserver.net/ubbthreads/showflat.php/Cat/0/Number/766714/an/0/page/0#Post766714
Posted By: frescosteve

Re: ragdoll - 08/14/07 21:15

I have used the search feature but most of the posts are out dated or lack information so i created a specific thread on ragdoll. Plus, when i said is there a way i was asking for an example for the code. sorry if this wasn't seen in that way.
Posted By: Shadow969

Re: ragdoll - 08/15/07 04:54

well, what part of code interests you?
Posted By: frescosteve

Re: ragdoll - 08/16/07 01:53

The section to attach physics objects to a bone ready model which moves segments accordingly. any code will surely help.
Posted By: Slin

Re: ragdoll - 08/16/07 12:28

If someone can tell me how to place a bone on a modelsposition I´m done with my (hopefully easy to use) ragdollsystem...
It would be great if someone could help me
Thanks,
Slin
Posted By: Shadow969

Re: ragdoll - 08/16/07 14:48

well, last time i've done it i had no probems. i'll post code if i'll have time
Posted By: frescosteve

Re: ragdoll - 08/21/07 15:31

I really badly need that code
Posted By: Shadow969

Re: ragdoll - 08/21/07 16:35

ENTITY* create_bone(ENTITY* ent, STRING* parent, STRING* child)
{
VECTOR parent_pos;
VECTOR child_pos;
ANGLE bone_ang;
ENTITY* temp_bone;

vec_for_bone(parent_pos,ent,parent);
vec_for_bone(child_pos,ent,child);

vec_sub(child_pos,parent_pos);
vec_to_angle(bone_ang,child_pos);

temp_bone = ent_create("crate.mdl",parent_pos,0);
vec_set(temp_bone.pan,bone_ang);
temp_bone.scale_x = 0.1;
temp_bone.scale_y = 0.1;
temp_bone.scale_z = 0.1;
return(temp_bone);
}

use it like this

create_bone(doll,"ValveBiped.Bip01~17","ValveBiped.Bip01~18");
you = create_bone(doll,"ValveBiped.Bip01~30","ValveBiped.Bip01~31");
create_bone(doll,"ValveBiped.Bip01~11","ValveBiped.Bip01~12");
wait(-7);
ent_remove(you);//remove 2nd bone in 7 seconds for testing
Posted By: frescosteve

Re: ragdoll - 08/22/07 17:27

Thanks for that code. I have modified it so it can work with my game. I do have another question. How do you update the bones position and angle according to where the new models position is?

I have enabled physics on each of the new models (at each bone parent) but I cant figure out the code to update the bone position on the model according to the parent position models.

Each parent model has its own action.
Posted By: frescosteve

Re: ragdoll - 08/25/07 00:00

How do you update the bones position and angle according to where the new models position is?
Posted By: Slin

Re: ragdoll - 08/28/07 14:20

Quote:

How do you update the bones position and angle according to where the new models position is?




This is the only point I´ve got some problems with. I´m already done with creating the skeleton out of single physikentities.The problem isn´t really the angle but the the position. Each physikentity has it´s own action and "knows" the name of the bone it is placed on.

Thanks,
Slin
Posted By: frescosteve

Re: ragdoll - 08/28/07 22:49

I also have the same problem. The hand book says you must reset the bone first if you want to set it to a certain position. I do this and it still returns strange figures.
Posted By: Metal_Man

Re: ragdoll - 08/29/07 01:45

are the physics ents constrained?

also, you dont HAVE to reset it. thats for combining multiple animations using ANM_ADD
for this you might want to check out the part of the lite-c workshops in the chapter on advanced uses for bones. Intstead of setting bones to entity positions, change the ANGLES to point the bones at their associated entities
Posted By: frescosteve

Re: ragdoll - 08/29/07 02:24

o.k. I set you "programmers" a challenge. I bet you can't do it.

1. Create a box with one bone with all verts attached. (main box 1 should be bigger than box 2)
2. Create a second box with one bone and all verts attached. (box 2)
3. Create a large box which has physics enabled. (box 3 should be bigger than box 1)
4. Create a level and put the large box about 5000 quants on x.
5. Place box 1 at position 0,0,0 and make it passable and transparent.
6. Place box 2 at position 0,0,0 and enable physics on this box.
7. Create a short function to send box 3 towards 0,0,0 (minus X). Function should run on a key press.
8. Write a script to update the position and angle of box 1 using the bone only. Use ent_bonemove, ent_bonerotate and ent_bonereset. Box 1 should equal the position of box 2.

If you done it how I have then you should notice that ent_bonemove doesnt seem to work properly. If not then you have a different problem or you are a true programmer for 3D Gamestudio and would you please send me the project with code.
Posted By: frescosteve

Re: ragdoll - 08/29/07 03:30

I have only gone and cracked the problem. I followed my own instruction as from the last post lol. I recreated a game and ran some tests. The problem with ent_bonemove is that it takes the scale of a model into account. (THIS SHOULD BE STATED IN THE MANUAL) If both models have the same scale then the can both equal the same co-ordinates. I guess ent_bonemove must devide all values in the vector (that are returned) by the scale of the model.

edit: Just found out another thing... ent_bonemove also relys on the origin. Rather than the actual bone position.
Posted By: Shadow969

Re: ragdoll - 08/29/07 08:20

You solved it? congratulations! it'll be interesting to see a video
Posted By: D3D

Re: ragdoll - 08/29/07 09:57

@ frescosteve: If it should be stated in the manual, maybe you can post the info at Blame the Manual forum. Could be helpful to others I guess!?
Posted By: frescosteve

Re: ragdoll - 09/03/07 02:07

I have posted on the Blame the Manual forum. I have also posted on the tutorial forum asking for a detailed tutorial in creating a fully working rag-doll.
Posted By: MDMDFSS

Re: ragdoll - 11/28/08 12:56

How do you want to use the ragdoll?
Is it a Human, that if you kill him he turns into a ragdoll and falls together?
Then thats cool.
Posted By: XD1v0

Re: ragdoll - 11/29/08 15:35

Guys, why you don`t wont use my Physics constrains editor,
I created PCE special for creating ragdoll and other ODE physics constrains.
My labour is unavailing really! cry
Posted By: Quad

Re: ragdoll - 11/29/08 15:38

well, i got impressed by the editor, but at first look i couldnt use it.
Posted By: MDMDFSS

Re: ragdoll - 12/09/08 15:18

I want to use this Physics constrains editor (XD1v0), but how can I get it???
Posted By: testDummy

Re: ragdoll - 12/09/08 17:35

Quoting MDMDFSS.
Quote:
I want to use this Physics constrains editor (XD1v0), but how can I get it???

Probably, some version was entered in the contest, and seemingly that version won 2nd place.
http://au.conitec.net/
© 2024 lite-C Forums