Gamestudio Links
Zorro Links
Newest Posts
loading historical data 1st time
by AndrewAMD. 04/14/23 12:54
Trade at bar open
by juanex. 04/13/23 19:43
Bug in Highpass2 filter
by rki. 04/13/23 09:54
Adding Limit Orders For IB
by scatters. 04/11/23 16:16
FisherN
by rki. 04/11/23 08:38
AUM Magazine
Latest Screens
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Hecknex World
Who's Online Now
3 registered members (AndrewAMD, Grant, Neb), 908 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
rki, FranzIII, indonesiae, The_Judge, storrealba
18919 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
detecting hit location #8959
05/04/02 09:10
05/04/02 09:10

A
Anonymous OP
Unregistered
Anonymous OP
Unregistered
A



How can I detect where a character was hit? Specifically, I'ld like to have characters react differently when hit in their torso, in one of their limbs, or a head shot.

-Joe Hocking
www.3darteest.com

Re: detecting hit location #8960
05/07/02 06:32
05/07/02 06:32

A
Anonymous OP
Unregistered
Anonymous OP
Unregistered
A



Hi jhocking;
try looking at the traget room script in the techdemo and note how he positions the hull size locations to display the targets messages when the targets are hit in a specific place.
[Roll Eyes]

Re: detecting hit location #8961
05/08/02 04:35
05/08/02 04:35

A
Anonymous OP
Unregistered
Anonymous OP
Unregistered
A



Thanks for the info, but unless I am mistaken (and I very well may be; the techdemo code is pretty convoluted) the techdemo code is merely blocking out areas of the static targets.

However, I am asking about moving characters. For example, I want to be able to detect shots that hit characters' arms. However, enemies move their arms around when walking, running, attacking, etc. Meanwhile, the enemies can also stand, crouch, or lie down.

Re: detecting hit location #8962
05/08/02 04:42
05/08/02 04:42
Joined: Mar 2002
Posts: 1,123
California
Cellulaer Offline
Expert
Cellulaer  Offline
Expert

Joined: Mar 2002
Posts: 1,123
California
Just a suggestion but what about vertex attaching invisible blocks to each different area of the model and when the block has a collision, it is a hit in that area.

Maybe add a vertex inside each area where you want a hit to be and attach the invisible box to that.

Think area specific bounding boxes.


Buy, Sell, & Archive Realtime 3D Content @ RedRock7.com *BETA* A5.5+ Plugin DLLs: GSADO, GSHTTP, GSImgLst, FreeMod, GSFlash, GSPython http://cellulear.slashbang.com/
Re: detecting hit location #8963
05/08/02 05:00
05/08/02 05:00

A
Anonymous OP
Unregistered
Anonymous OP
Unregistered
A



By "vertex attach" what do you mean? If you mean use vec_for_vertex to figure out the vertex position, and then move the box there every frame, how do I associate a given box to its model? That is, how do I make the character react when the box is hit?

For example, if I use "trace" to determine where a shot hits, the command will set "you" to the box. How do I then transfer information that the character was hit to the character's entity?

Re: detecting hit location #8964
05/08/02 05:12
05/08/02 05:12
Joined: Mar 2002
Posts: 1,123
California
Cellulaer Offline
Expert
Cellulaer  Offline
Expert

Joined: Mar 2002
Posts: 1,123
California
//From the attach weapon to character on the resource site (no animation frames)
create(<agentg.mdl>,nullvector,vertex_attach);

var hand_pos[3] = 0,0,0;

function vertex_attach
{
my.passable = on;
while(you){ // weapon will always "face" the second vertice from
vec_for_vertex(my.x,you,5); //vertice at "pinky" side of palm
vec_for_vertex(hand_pos.x,you,17); //vertice between thumb and pointer finger
temp.x = hand_pos.x - MY.X;
temp.y = hand_pos.y - MY.Y;
temp.z = hand_pos.z - MY.Z;
result = vec_to_angle(my_angle,temp);
my.pan = my_angle.pan;
my.tilt = my_angle.tilt;
my.roll = my_angle.roll;
wait(1);}
}

-OR-

//From animate.wdl and attaching an entity to a vertex (animation frames required)
ent_create(agent_mdl,nullvector,attach_entity);

/////////////////////////////////////////////////////////////////////////
// Desc: attaches an entity that has the same origin and the same frame cycles
//
function attach_entity()
{
my.passable = on;
while(you) // prevent empty synoym error if parent entity was removed
{
if(your.shadow == on) { my.shadow = on; }
if(you == player && person_3rd == 0)
{
my.invisible = on;
}
else
{
my.invisible = off;
}

vec_set(my.x,you.x);
vec_set(my.pan,you.pan);
my.frame = you.frame;
my.next_frame = you.next_frame;
wait(1);
}
remove(my);
}


Buy, Sell, & Archive Realtime 3D Content @ RedRock7.com *BETA* A5.5+ Plugin DLLs: GSADO, GSHTTP, GSImgLst, FreeMod, GSFlash, GSPython http://cellulear.slashbang.com/
Re: detecting hit location #8965
05/12/02 03:35
05/12/02 03:35

A
Anonymous OP
Unregistered
Anonymous OP
Unregistered
A



I agree with you Noah.
It is a good solution to use vec_for_vertex to attach an invisible block to the entity you are shooting at.
I.E. you can attach a small block to the head of the entity and if this block is hit by a bullet (event_shoot) then you can program an event that changes skin(with blood on) or emits blood particles on that area.


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