Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Detach a part of an object ?

Author
Message
Hell_666
17
Years of Service
User Offline
Joined: 11th Jul 2009
Location: France
Posted: 23rd Jul 2010 15:05
Hi, I would like detach a part of an object in DBPro, for example I want detach the head or a leg of an AI, I thought to limbs, but I don't know how do this, has someone an idea ?

Thanks

Eternal suffering ...

I'm french
HowDo
23
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 23rd Jul 2010 15:12 Edited at: 23rd Jul 2010 15:21
have a look at this link should show how to do it.

http://forum.thegamecreators.com/?m=forum_view&t=126981&b=6

edit
Press the 'c' key to see limb 11 change.
work out how the function works, just relooked at it and its may look more complicated than it is.

Dark Physics makes any hot drink go cold.
Hell_666
17
Years of Service
User Offline
Joined: 11th Jul 2009
Location: France
Posted: 23rd Jul 2010 15:24
I'll work with it, thanks a lot

Eternal suffering ...

I'm french
Van B
Moderator
23
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 23rd Jul 2010 15:33
You won't be able to do very much with a bone animated model, so if this is a bone animated character, then you really have to look at other options.

One method I've used in the past is to simply scale the limb to nothing and spawn a gib. A gib is a part of a body, like the head, an arm, leg, whatevery you want to break off. I would have a few gibs loaded in already, and use them when shooting limbs - it depends on how you want to handle them, I mean are the gibs physics objects, how will they move after they are spawned?.


Health, Ammo, and bacon and eggs!
Hell_666
17
Years of Service
User Offline
Joined: 11th Jul 2009
Location: France
Posted: 23rd Jul 2010 15:37
Scale the limb to nothing, great idea

Move the gibs are more difficult ... I think I'll spawn gibs and I'll let the gibs fall on the floor.

Thanks

Eternal suffering ...

I'm french
Hell_666
17
Years of Service
User Offline
Joined: 11th Jul 2009
Location: France
Posted: 23rd Jul 2010 15:48
It works, thanks a lot

Eternal suffering ...

I'm french
Van B
Moderator
23
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 23rd Jul 2010 16:15
Cool - it's fun huh, to shoot bits off your enemies, not enough games do that these days.


Health, Ammo, and bacon and eggs!
Hell_666
17
Years of Service
User Offline
Joined: 11th Jul 2009
Location: France
Posted: 23rd Jul 2010 16:16
Yes, I must find how detect the part of the body that's hit when I fire, and I can choose if it's the legs, arms or the head that must fall

Eternal suffering ...

I'm french
Van B
Moderator
23
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 23rd Jul 2010 17:11
Ahh, you could do a distance check, like check the collision point if you have one, and go for the limb that is closest to that point - like step through them and keep note of the limb position that is closest. That's what I did, although I used that for collision too - it would be much more accurate to wait on a bullet collision. Even an estimated collision position would probably do it.

It always helps to draw a skeleton and mark off your bone numbers on that, then you can check the sequence. I mean, you might only have 5 gigs, legs x2, arms x2, and head - but your character might have 30 bones!. So it's a good idea to check the mid-bones too, like the knee bone, hip bone, ankle bone, and any bones on the foot are a leg, so if any of those limbs get hit then that's a gib. Without that, you might shoot a guy in the belly and knock his leg off. The more bones you check for distance, the more accurate it would be.

Something awesome though is if you add in particle effects, like blood particles when shot, but have a particle emitter that can be stuck onto a limb, like keep track of object and limb number, and spawn blood particles. Then you can have the guy bleed out. It's great if you can align the particles onto the terrain as well, so they drop and coagulate around the wound. I'm pretty sick I admit it - but it's a good thing where FPS games are concerned. I mean, in an old FPS game I was working on, one of the weapons was a clawhammer, I had darts too (like for a dartboard!) and a bottle that breaks then becomes even more threatening with it's sharp edges. Smash a bottle over one guys head then jab it in another guys neck .
Anyhoo, I'd love to see a video of your effect when it's done, even a screenshot would suffice - nobody seems to work on FPS games these days; I find them pretty interesting things to work on, interesting but time consuming.


Health, Ammo, and bacon and eggs!
HowDo
23
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 23rd Jul 2010 18:16
check out LIMB COLLISION command in help files.

Dark Physics makes any hot drink go cold.
Hell_666
17
Years of Service
User Offline
Joined: 11th Jul 2009
Location: France
Posted: 23rd Jul 2010 21:42
Thanks for your help, it's help me a lot

I'll post a video when it will be ready

Eternal suffering ...

I'm french
Hell_666
17
Years of Service
User Offline
Joined: 11th Jul 2009
Location: France
Posted: 23rd Jul 2010 23:14
Hmmm ... I have a problem, to detect what limb is hit I move an invisible cube from the camera with the same angle that the camera, but when the cube through the AI's head, it's not detected.

I've made a limb to my cube for the "limb collision" command from the object's mesh, so the the problem isn't this, I use correctly (I believe) the "limb collision" command

Any idea ? thanks

Eternal suffering ...

I'm french
Hell_666
17
Years of Service
User Offline
Joined: 11th Jul 2009
Location: France
Posted: 24th Jul 2010 16:16
The collision doesn't work with my 4 method, but it works on a blank project, can you help me ? This is the codes :

Works :




Doesn't works :



Eternal suffering ...

I'm french
HowDo
23
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 24th Jul 2010 16:30
here the snippet that shows how to use limb collsion



Dark Physics makes any hot drink go cold.
Hell_666
17
Years of Service
User Offline
Joined: 11th Jul 2009
Location: France
Posted: 24th Jul 2010 17:20
Why you use the limb -1 to test the limb collision ? It' doesn't exist but it works, why ?

Thanks.

Eternal suffering ...

I'm french
HowDo
23
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 24th Jul 2010 17:23
that what the master Lee said to use its one of his codes.

Dark Physics makes any hot drink go cold.
Hell_666
17
Years of Service
User Offline
Joined: 11th Jul 2009
Location: France
Posted: 24th Jul 2010 17:29
Oh, ok

Sorry but it doesn't work Can you say me what I've forgotten ? Thanks.



The collision isn't detected ...

Eternal suffering ...

I'm french
HowDo
23
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 24th Jul 2010 17:32 Edited at: 24th Jul 2010 17:34
try this
edit
needed a number 132 instead of 1



Dark Physics makes any hot drink go cold.
Hell_666
17
Years of Service
User Offline
Joined: 11th Jul 2009
Location: France
Posted: 24th Jul 2010 17:38 Edited at: 24th Jul 2010 17:41
It doesn't works ... The test doesn't detect the collision ... Strange

Edit : I try with 132 and I'll post.

Eternal suffering ...

I'm french
HowDo
23
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 24th Jul 2010 17:43
so do you get a true for object 132 exist?
It should show -1 for limbcheck if you've not hit it, and 132 if you have.

Dark Physics makes any hot drink go cold.
Hell_666
17
Years of Service
User Offline
Joined: 11th Jul 2009
Location: France
Posted: 24th Jul 2010 17:46
Yes, the object exist, I see the cube appear and through the head, I've not hidden it yet .

It doesn't work

Eternal suffering ...

I'm french
HowDo
23
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 24th Jul 2010 17:47
is the cube object 132 or the head?

Dark Physics makes any hot drink go cold.
Hell_666
17
Years of Service
User Offline
Joined: 11th Jul 2009
Location: France
Posted: 24th Jul 2010 17:49 Edited at: 24th Jul 2010 17:51
132 = cube
obj = entire object of the AI
entityprofile(entid).headlimb = the head limb of the object "obj"

I've verified if the object 132 (cube) exist with a print and yes it exists . I don't see why it doesn't works

Eternal suffering ...

I'm french
Hell_666
17
Years of Service
User Offline
Joined: 11th Jul 2009
Location: France
Posted: 26th Jul 2010 22:29 Edited at: 26th Jul 2010 22:29
I can't detect what limb is hit, so, for the time being, I "destroy" the head when the AI die.

This is a screen (made with FPSC X9 - Alien VS Preadator New Hope):



PS : I'll reduce the head size, it's too big ^^

Eternal suffering ...

I'm french

Login to post a reply

Server time is: 2026-07-25 05:32:41
Your offset time is: 2026-07-25 05:32:41