ok thanks.
But now is it hard to but everithing together.
So I looked at the cranesimulator script and saw the (I think) perfeckt way to make a ragdoll... I do the ragdoll (almost) the same as the cranesimulator, thest not with a crane but with a humen.
So everithing new you see in my script is writen um for this function.
I try it like this:
(please correct if im wrong)
________________________________________________________________________________
// set rotation limits
void setLimit(VECTOR* vec1, VECTOR* vec2) {
vec_set(tempH1, vec1); //Hinges
vec_set(tempH2, vec2);
}
//vector, to set limets
VECTOR temp_pelvis
VECTOR temp_abs;
VECTOR temp_torso;
VECTOR temp_head;
VECTOR temp_legup_l;
VECTOR temp_legup_r;
VECTOR temp_legdown_l;
VECTOR temp_legdown_r;
VECTOR temp_armup_l;
VECTOR temp_armup_r;
VECTOR temp_armdown_l;
VECTOR temp_armdown_r
//a define for bodyparts
#define bodyPart skill1
STRING* head_mdl = "head.mdl"; // head
STRING* torso_mdl = "torso.mdl"; // upper body
STRING* abs_mdl = "abs.mdl"; // middle body
STRING* pelvis_mdl = "pelvis.mdl"; // lower body
STRING* leftarmup_mdl = "arm_up_left.mdl"; // left arm
STRING* leftarmdown_mdl = "arm_down_left.mdl";
STRING* rightarmup_mdl = "arm_up_right.mdl"; // right arm
STRING* rightarmdown_mdl = "arm_down_right.mdl";
STRING* leftlegup_mdl = "leg_up_left.mdl"; // left leg
STRING* leftlegdown_mdl = "leg_down_left.mdl";
STRING* rightlegup_mdl = "leg_up_right.mdl"; // right leg
STRING* rightlegdown_mdl = "leg_down_right.mdl";
//The rotation limet dosn`t reeley work, so I try it with var`s
var rt_pelvis;
var rt_abs;
var rt_torso;
var rt_head;
var rt_legup_l;
var rt_legup_r;
var rt_legdown_l;
var rt_legdown_r;
var rt_armup_l;
var rt_armup_r;
var rt_armdown_l;
var rt_armdown_r;
//I want a center of the body, also the pelvis:
function ragdoll1
{
temp_pelvis = my;
BodyPartInit(20, temp_pelvis); //Now i mack the bodypart
rd_pelvis = phcon_add(PH_HINGE, temp_pelvis, temp_pelvis);
phcon_setparams1(rt_pelvis, temp_pelvis.x, tempH1, nullvector);
phcon_setparams2(rd_pelvis, temp2, nullvector, nullvector);
//Now I do it like in the crane simulator, thest with humenboby
// left upper leg
vec_for_vertex(temp, temp_pelvis, 23); // attach it
temp_legup_l = ent_create(leftlegup_mdl,temp, 0); // create bodypart
setLimit(vector(0,1,0), vector(-90,15,0)); // set Limet
BodyPartInit(5, temp_legup_l); // make constraint
rd_con_legup_l = phcon_add(PH_HINGE, temp_legup_l, temp_pelvis);
phcon_setparams1(rd_con_legup_l, temp_legup_l.x, tempH1, nullvector);
phcon_setparams2(rd_con_legup_l, tempH2, nullvector, nullvector);
// left lower leg
vec_for_vertex(temp, temp_legup_l, 9);
temp_legdown_l = ent_create(leftlegdown_mdl, temp, 0);
setLimit(vector(0,1,0), vector(0,120,0));
BodyPartInit(20, temp_legdown_l); // make constraint
rd_con_legdown_l = phcon_add(PH_HINGE, temp_legdown_l, temp_legup_l);
phcon_setparams1(rd_con_legdown_l, temp_legdown_l.x, tempH1,
nullvector);
phcon_setparams2(rd_con_legdown_l, tempH2, nullvector, nullvector);
// right upper leg
vec_for_vertex(temp, temp_pelvis, 22);
temp_legup_r = ent_create(rightlegup_mdl, temp, 0);
setLimit(vector(0,1,0), vector(-90,15,0));
BodyPartInit(5, temp_legup_r);
// make constraint
rt_legup_r = phcon_add(PH_HINGE, temp_legup_r, temp_pelvis);
phcon_setparams1(rt_legup_r, temp_legup_r.x, tempH1, nullvector);
phcon_setparams2(rt_legup_r, tempH2, nullvector, nullvector);
// right lower leg
vec_for_vertex(temp, temp_legup_r, 9);
temp_legdown_r = ent_create(rightlegdown_mdl, temp, 0);
setLimit(vector(0,1,0), vector(0,120,0));
BodyPartInit(20, temp_legdown_r);
// make constraint
rd_con_legdown_r = phcon_add(PH_HINGE, temp_legdown_r, temp_legup_r);
phcon_setparams1(rt_legdown_r, temp_legdown_r.x, tempH1, nullvector);
phcon_setparams2(rt_legdown_r, tempH2, nullvector, nullvector);
// abs
vec_for_vertex(temp, temp_pelvis, 21);
temp_abs = ent_create(abs_mdl, temp, 0);
setLimit(vector(0,1,0), vector(-15,15,0));
BodyPartInit(20, temp_abs);
// make constraint
rd_con_abs = phcon_add(PH_HINGE, temp_abs, temp_pelvis);
phcon_setparams1(rt_abs, temp_abs.x, tempH1, nullvector);
phcon_setparams2(rt_abs, tempH2, nullvector, nullvector);
//torso
vec_for_vertex(temp, temp_abs, 17);
temp_torso = ent_create(torso_mdl, temp, 0);
setLimit(vector(0,1,0), vector(-15,15,0));
BodyPartInit(55, temp_torso);
// make constraint
rd_con_torso = phcon_add(PH_HINGE, temp_torso, temp_abs);
phcon_setparams1(rt_torso, temp_torso.x, tempH1, nullvector);
phcon_setparams2(rt_torso, tempH2, nullvector, nullvector);
// left upper arm
vec_for_vertex(temp, temp_torso, 21);
temp_armup_l = ent_create(leftarmup_mdl, temp, 0);
setLimit(vector(1,0,0), vector(-70,80,0));
BodyPartInit(5, temp_armup_l);
// make constraint
rd_con_armup_l = phcon_add(PH_HINGE, temp_armup_l, temp_torso);
phcon_setparams1(rt_armup_l, temp_armup_l.x, tempH1,nullvector);
phcon_setparams2(rt_armup_l, tempH2, nullvector, nullvector);
// left lower arm
vec_for_vertex(temp, temp_armup_l, 9);
temp_armdown_l = ent_create(leftarmdown_mdl, temp, 0);
setLimit(vector(1,0,0), vector(270,0,0));
BodyPartInit(20, temp_armdown_l);
// make constraint
rt_armdown_l = phcon_add(PH_HINGE, temp_armdown_l, temp_armup_l);
phcon_setparams1(rt_armdown_l, temp_armdown_l.x,tempH1, nullvector);
phcon_setparams2(rd_con_armdown_l, tempHinge2, nullvector, nullvector);
// right upper arm
vec_for_vertex(temp, temp_torso, 22);
temp_armup_r = ent_create(rightarmup_mdl, temp, 0);
setLimit(vector(1,0,0), vector(-70,80,0));
BodyPartInit(5, temp_armup_r);
// make constraint
rt_armup_r = phcon_add(PH_HINGE, temp_armup_r, temp_torso);
phcon_setparams1(rt_armup_r, temp_armup_r.x, tempH1, nullvector);
phcon_setparams2(rd_con_armup_r, tempHinge2, nullvector, nullvector);
// right lower arm
vec_for_vertex(temp, temp_armup_r, 9);
temp_armdown_r = ent_create(rightarmdown_mdl, temp, 0);
setLimit(vector(1,0,0), vector(0,90,0));
BodyPartInit(20, temp_armdown_r);
// make constraint
rt_armdown_r = phcon_add(PH_HINGE, temp_armdown_r, temp_armup_r);
phcon_setparams1(rt_armdown_r, temp_armdown_r.x, tempH1, nullvector);
phcon_setparams2(rt_armdown_r, tempH2, nullvector, nullvector);
// head
vec_for_vertex(temp, temp_torso, 23);
temp_head = ent_create(head_mdl, temp, 0);
setLimit(vector(0,1,0), vector(-40,40,0));
BodyPartInit(25, temp_head);
// make constraint
rt_head = phcon_add(PH_HINGE, temp_head, temp_torso);
phcon_setparams1(rt_head, temp_head.x, tempH1, nullvector);
phcon_setparams2(rt_head, tempH2, nullvector, nullvector);
//Now I creat the actor and hide it. But how can I hide that model?
//Man I need somthing like a 3dgs school, then physics is almost the onley thing I can work with
you = ent_create("ragdoll.mdl", nullvector, 0); //model
//But how it`s going on?
________________________________________________________________________________
Please you can tell me that thats right, then I can`t feel my finger anymore
But after conecting bodyparts and seting Limets, what should I do then?
Then this script should be a death funktion, and I can`t belive that after seting limets (and bodyparts) that it`s already finish.
But that would be cool