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
HIT BOXES #6180
07/27/01 05:50
07/27/01 05:50

A
Anonymous OP
Unregistered
Anonymous OP
Unregistered
A



Has anybody had any progress on hit boxes. If you don't know what these are, here is a short description:

This is where the player can have different reactions or lose different amounts of health, when hit in different areas of the body.

I thought you could use ent_vertex somehow in this, but then you would have to know which vertex's are on which parts of the body, which would take ages! Anybody think of another way of doing this?


Re: HIT BOXES #6181
07/27/01 06:28
07/27/01 06:28
Joined: May 2001
Posts: 1,261
Outarville, France
al1 Offline
Expert
al1  Offline
Expert

Joined: May 2001
Posts: 1,261
Outarville, France
The vertex number is indicated by MED on selecting a vertex. Example:



Re: HIT BOXES #6182
07/28/01 07:00
07/28/01 07:00

A
Anonymous OP
Unregistered
Anonymous OP
Unregistered
A



I know, but that would take ages, working out where every vertex was on the body. Surly there must be a quicker way.

Re: HIT BOXES #6183
07/28/01 07:32
07/28/01 07:32
Joined: Mar 2001
Posts: 1,825
London, England
Keith B [Ambit] Offline
Expert
Keith B [Ambit]  Offline
Expert

Joined: Mar 2001
Posts: 1,825
London, England
If you're talking about bullets rather than fists, then you might be able to work out vague hitboxes this way:

First, when it hits your player, check the height of the bullet (there should be some way of doing that...).
Then all you have to do is compare it with the height of the player. Eg:

If(bullet_height<=my.z) //below centre/waist
{HIT_IN_LEGS();}
if(bullet_height<=my.z+(my.max_z/1.5))&&(bullet_height>my.z) //above waist, below shoulders
{HIT_IN_CHEST();}
if(bullet_height>my.z+(my.max_z/1.5) //above shoulders
{HIT_IN_HEAD();}

The only problem would be making sure that you know the bullet height (I haven't messed around with bullets much as I'm working on a fighting game).
Hope that's of use,
Cheers,
Keith


Re: HIT BOXES #6184
07/27/01 21:45
07/27/01 21:45

A
Anonymous OP
Unregistered
Anonymous OP
Unregistered
A



This is the way I made it:

DEFINE HEAD_VERTEX,SKILL1;
DEFINE BODY_VERTEX,SKILL2;
DEFINE L_ARM_VERTEX,SKILL3;
DEFINE R_ARM_VERTEX,SKILL4;
DEFINE L_LEG_VERTEX,SKILL5;
DEFINE R_LEEG_VERTEX,SKILL6;

ACTION ENEMY{
MY.HEAD_VERTEX = 122; // or whatever you want
MY.BODY_VERTEX = 213;
MY.L_ARM_VERTEX = 31;
MY.R_ARM_VERTEX = 13;
MY.L_Leg_VERTEX = 3;
MY.R_LEG_VERTEX = 451;
...}

SKILL TEMP_1 { }
SKILL TEMP_2 { }
SKILL TEMP_3 { }
SKILL TEMP_4 { }
SKILL TEMP_5 { }
SKILL TEMP_6 { }
SKILL TEMP_7 { }
SKILL TEMP_8 { }
SKILL TEMP_9 { }
SKILL TEMP_10 { }
SKILL TEMP_11 { }
SKILL TEMP_12 { }

Put this in your Bullet event:
VEC_FOR_VERTEX(TEMP_1,YOU,YOUR.HEAD_VERTEX);
VEC_FOR_VERTEX(TEMP_2,YOU,YOUR.BODY_VERTEX);
VEC_FOR_VERTEX(TEMP_3,YOU,YOUR.L_ARM_VERTEX);
VEC_FOR_VERTEX(TEMP_4,YOU,YOUR.R_ARM_VERTEX);
VEC_FOR_VERTEX(TEMP_5,YOU,YOUR.L_LEG_VERTEX);
VEC_FOR_VERTEX(TEMP_6,YOU,YOUR.R_LEG_VERTEX);
TEMP_7 = VEC_DIST (MY.POS,TEMP_1);
TEMP_8 = VEC_DIST (MY.POS,TEMP_2);
TEMP_9 = VEC_DIST (MY.POS,TEMP_3);
TEMP_10 = VEC_DIST (MY.POS,TEMP_4);
TEMP_11 = VEC_DIST (MY.POS,TEMP_5);
TEMP_12 = VEC_DIST (MY.POS,TEMP_6);
IF (TEMP_7 < TEMP_8 && TEMP_7 < TEMP_9 && TEMP_7 < TEMP_10 && TEMP_7 < TEMP_11 && TEMP_7 < TEMP_12){
HEAD_DAMAGE();}
IF (TEMP_8 < TEMP_7 && TEMP_8 < TEMP_9 && TEMP_8 < TEMP_10 && TEMP_8 < TEMP_11 && TEMP_8 < TEMP_12){
BODY_DAMAGE();}
IF (TEMP_9 < TEMP_7 && TEMP_9 < TEMP_8 && TEMP_9 < TEMP_10 && TEMP_9 < TEMP_11 && TEMP_9 < TEMP_12){
ARM_DAMAGE();}
IF (TEMP_10 < TEMP_7 && TEMP_10 < TEMP_8 && TEMP_10 < TEMP_9 && TEMP_10 < TEMP_11 && TEMP_10 < TEMP_12){
ARM_DAMAGE();}
IF (TEMP_11 < TEMP_7 && TEMP_11 < TEMP_8 && TEMP_11 < TEMP_9 && TEMP_11 < TEMP_10 && TEMP_11 < TEMP_12){
LEG_DAMAGE();}
IF (TEMP_12 < TEMP_7 && TEMP_12 < TEMP_8 && TEMP_12 < TEMP_9 && TEMP_12 < TEMP_10 && TEMP_12 < TEMP_11){
LEG_DAMAGE();}

hope there are no typos there, but should work oh and vec_for_vertex is current Beta so wait 2 weeks and you'll have your Hitboxes.



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