Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (Aku_Aku, 7th_zorro, Ayumi), 1,050 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 3 1 2 3
Re: function ragdoll help!! [Re: Rackscha] #266004
05/15/09 13:58
05/15/09 13:58
Joined: Jul 2008
Posts: 191
M
MDMDFSS Offline OP
Member
MDMDFSS  Offline OP
Member
M

Joined: Jul 2008
Posts: 191
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 wink

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 smile

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 wink



Last edited by MDMDFSS; 05/15/09 16:13.
Re: function ragdoll help!! [Re: MDMDFSS] #266032
05/15/09 15:52
05/15/09 15:52
Joined: Dec 2008
Posts: 1,218
Germany
Rackscha Offline
Serious User
Rackscha  Offline
Serious User

Joined: Dec 2008
Posts: 1,218
Germany
ok looks fine, before you create your visible actor model: test your ragdoll bones. Just create the scelet as you have written it above and see how it falls to the ground and how arms/legs behave. if this is ok create your visible actor model.

If you want to hide the physik bones, then do the folowing: when creating the model of a physikbone, assign an action to it which makes it invisible(set(my,INVISIBLE);)

Or you simply use the pointer you receive from the ent_create function and use this pointer DIRECTLY after the creation of the physik bone model, with set(pointer,flag);

And if you have done this, the next step is to set the rotation of your actors model's bones to the rotation of the attached physikbone wink

Greets
Rackscha


MY Website with news of my projects:
(for example my current
Muliplayer Bomberman,
GenesisPrecompiler for LiteC
and TileMaster, an easy to use Tile editor)
Sparetime-Development

Re: function ragdoll help!! [Re: Rackscha] #266036
05/15/09 16:10
05/15/09 16:10
Joined: Jul 2008
Posts: 191
M
MDMDFSS Offline OP
Member
MDMDFSS  Offline OP
Member
M

Joined: Jul 2008
Posts: 191
Thats a problem I must wait for my new computer.
My computer is to bad for lite-c. averytime I try to start somthing it shows:

"Can`t open video device. Try -W3D command line option"

But in max 2weeks I have my new computer smile

Or how can I give you my ragdoll?

Last edited by MDMDFSS; 05/15/09 16:13.
Re: function ragdoll help!! [Re: MDMDFSS] #266712
05/19/09 10:50
05/19/09 10:50
Joined: Jun 2008
Posts: 151
Ukraine
XD1v0 Offline
Member
XD1v0  Offline
Member

Joined: Jun 2008
Posts: 151
Ukraine
If you want I can do examples for ragdoll code, on contest winter 2008 I do program "Physics Constrains Editor" , i did this program for easy creating entities and set physic properties to entity in editor window and set physics constrains between two entities, any entity user could attach to entity bone, when user could save this entities and physics properties to *.ent file.
But how see what A7 user could not use PCE, sure if i shall do good tutorial maybie then other understand how it works, but its hard for my english.
So i have only one way out, i can create easy examples for how create ragdoll, do you want this?

Last edited by XD1v0; 05/19/09 10:54.

A7 Commercial cool
Celeron 1700, GeForce 5500 FX 256mb, 1 Gb Ram
Re: function ragdoll help!! [Re: XD1v0] #266775
05/19/09 16:32
05/19/09 16:32
Joined: Jun 2008
Posts: 402
Germany
S
sebbi91 Offline
Senior Member
sebbi91  Offline
Senior Member
S

Joined: Jun 2008
Posts: 402
Germany
@XD1v0
You written the "Physics Constrains Editor" ?
Nice Job!!
Awesome! ^^

It's very nice but I cant use the .Ent files!
Could you explain how you set the Position of a Bone to a Ph-Objekt like in "ph_scene5.ent"

Sorry but I cant understand that script!
But I want to learn how bones and the Physik engeine works!

btw sorry for my english, i am a german user! ^^


3D-Gamestudio A8 - Commercial
Re: function ragdoll help!! [Re: sebbi91] #266848
05/20/09 10:08
05/20/09 10:08
Joined: Jun 2008
Posts: 151
Ukraine
XD1v0 Offline
Member
XD1v0  Offline
Member

Joined: Jun 2008
Posts: 151
Ukraine
Ok I try make some example, maybe video tutorial


A7 Commercial cool
Celeron 1700, GeForce 5500 FX 256mb, 1 Gb Ram
Re: function ragdoll help!! [Re: XD1v0] #266914
05/20/09 18:35
05/20/09 18:35
Joined: Jun 2008
Posts: 402
Germany
S
sebbi91 Offline
Senior Member
sebbi91  Offline
Senior Member
S

Joined: Jun 2008
Posts: 402
Germany
ok that would be very nice!

^^

Its just a tip but it will be very,very nice if you could add a "Save as Lite-C" or "Save as C-Script" function.
Because I cant get any informations from the .ent file!

It would be very usefull to understand how your ragdoll code works and easier to use the Ragdoll code!



Lg BasTi


3D-Gamestudio A8 - Commercial
Re: function ragdoll help!! [Re: XD1v0] #267005
05/21/09 11:31
05/21/09 11:31
Joined: Jul 2008
Posts: 191
M
MDMDFSS Offline OP
Member
MDMDFSS  Offline OP
Member
M

Joined: Jul 2008
Posts: 191
Das ist nicht so schlimm
Ich speche auch gut Deutsch.

Re: function ragdoll help!! [Re: MDMDFSS] #267593
05/25/09 09:38
05/25/09 09:38
Joined: Jan 2004
Posts: 3,023
The Netherlands
Helghast Offline
Expert
Helghast  Offline
Expert

Joined: Jan 2004
Posts: 3,023
The Netherlands
If darkinferno gives me permission, i created a whole new system in A7 lite-c to create ragdolls. Just wait a couple of days, i'll upload it then smile

(It looks like you used a part of my code anyway for this, am i right? the setLimit and bodyPartInit stuff (plus defined model names are exactly like mine)).

regards,


Formerly known as dennis_fantasy
Portfolio - http://www.designorhea.com/
Project - http://randomchance.cherrygames.org/
Re: function ragdoll help!! [Re: Helghast] #270439
06/08/09 11:09
06/08/09 11:09
Joined: Jul 2008
Posts: 191
M
MDMDFSS Offline OP
Member
MDMDFSS  Offline OP
Member
M

Joined: Jul 2008
Posts: 191
wow...

Page 2 of 3 1 2 3

Moderated by  HeelX, Spirit 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1