HitBoxes and multipul attributes Pickels we need your help.

Topics regarding Scripting with Reality Factory
User avatar
fps
Posts: 504
Joined: Mon Sep 26, 2005 9:54 pm
Location: in a magical land devoid of hope, happiness, and sanity.

HitBoxes and multipul attributes Pickels we need your help.

Post by fps »

i was looking through some of my professionaly made store bought games recently and noticed that many first preson shooters use a hit dectection system were foes have many different hit boxes on the different parts of their bodies, this system allows for features such as head shots, detecting being shot from behind, and wounding a foe by shooting them in the foot. it also uses different wounded animations corresponding to where the foe was hit.

HERES WHERE RF COMES INTO THE PICTURE.

I believe that this would be possible by turning the our foes bounding boxes off and creating pawns attached to said foes bones with bounding boxes that dectect damage and send an order to that pawns script telling it to animate and and recieve damage acordingly.

this would reduce the size of the areas that appear as empty space around the pawns that you can hit with bullets, thus making the game FEEL more lifelike. this also means that shooting the bounding boxes of extremities such as legs and arms could be made to detect damage but send a damage to the foe that is less, (a shot to the head might kill instantly but a shot to the lower leg area would just wound).

AND yet more can be done with this. if the foes feet have seperate bounding boxes attached to their bones then the pawns feet will be pulled to and stay level with the floor even if in the animations . this would be great for terrain areas
Last edited by fps on Sun Nov 20, 2005 5:34 pm, edited 1 time in total.
User avatar
AndyCR
Posts: 1449
Joined: Wed Jul 06, 2005 5:08 pm
Location: Colorado, USA
Contact:

Post by AndyCR »

good idea, though id do it with per-bone collision detection, which rf already has.
Guest

Post by Guest »

PerBone collision detection?!?
we have that?
How does it work in reality factory?
how can I intergrate it into my pawns scripts?
Will it work as well as the plan discussed above should theoretically work?

I think if it works like the name makes it sound like it works it could really improve my game and others that other people are working on too.

Thank you,
fps
User avatar
AndyCR
Posts: 1449
Joined: Wed Jul 06, 2005 5:08 pm
Location: Colorado, USA
Contact:

Post by AndyCR »

here you go.

char* GetLastBoneHit();

Returns the name of the bone last hit.
Guest

Post by Guest »

i still dont think i fully understand how to use this and i am not sure where this command would go in the script.
could you give me some more details?
User avatar
AndyCR
Posts: 1449
Joined: Wed Jul 06, 2005 5:08 pm
Location: Colorado, USA
Contact:

Post by AndyCR »

i believe you would use it like this: (warning psuedocode)

if(getLastBoneHit() == "head")
{
newOrder("dieHead");
} else {
newOrder("dieNormal");
}

for head hit detection in this case.
User avatar
fps
Posts: 504
Joined: Mon Sep 26, 2005 9:54 pm
Location: in a magical land devoid of hope, happiness, and sanity.

Post by fps »

would this go in the first few lines of the "pain" order?

also would it work if i set it up like this?
(psudo code also)

(Hit Order)
if the value of an attribute(Shot) goes down but is still higher than zero
}
if(getLastBoneHit() == "head")
{
newOrder("DieHeadShot");
} else {
if(getLastBoneHit("torso") == "")
}
newOrder("PainTorsoShot");
} else {
newOrder("PainNormalShot");
}
{
if the value of an attribute(Punched) goes down but is still higher than zero
}
if(getLastBoneHit() == "head")
{
newOrder("PainKnockOutPunched");
} else {
if(getLastBoneHit("torso") == "")
}
newOrder("PainWindedPunched");
} else {
newOrder("PainNormalPunched");
}



Now lets say that the attributes are checked and the return a zero, in the top of the script the ShotDead order and the PunchedDead order will be called accordingly.



(ShotDead)
}
if(getLastBoneHit() == "head")
{
newOrder("DieHeadShot");
} else {
if(getLastBoneHit("torso") == "")
}
newOrder("DieTorsoShot");
} else {
newOrder("DieNormalShot");
}


(PunchedOrder)
}
if(getLastBoneHit() == "head")
{
newOrder("DiePunchedHead");
} else {
if(getLastBoneHit("torso") == "")
}
newOrder("DieTorsoPunched");
} else {
newOrder("DieNormalPunched");
}



Please read that through and tell me if it needs to be fixed.


Another thing as you may have noticed is that i am checking 2 different attrubutes in this script....the problem is is that i have never gotten it to work.

Do you know how to and how i would go about modifying and setting my pawns scripts to check multipul attributes?
and if so could you please walk me through it?
I could post my base script so you could see what we are working with if you need me to, should I?
I want to be able to check for the following attributes but not all need per bone collision detection, just the starred stuff:
Shot *
ShotSilenced*
Punched *
Knifed*
EletricalShock *
ArmorPeircing *
Explosive*
HighExplosive
LazerBurn*
Fire
DirectFire (hit by a flamethrower style weapon)
HighDirectImpact (hit directly by a mortar)
ExplosionShockwave*
FlashBanged
Smoke
Gassed



Thanks,
Fps
User avatar
AndyCR
Posts: 1449
Joined: Wed Jul 06, 2005 5:08 pm
Location: Colorado, USA
Contact:

Post by AndyCR »

I'm afraid I have not learned enough scripting to help you with that... Pickles, are you there? Pickles could help you immensely.
User avatar
fps
Posts: 504
Joined: Mon Sep 26, 2005 9:54 pm
Location: in a magical land devoid of hope, happiness, and sanity.

Post by fps »

i will try to get him to help me with this.
ummm...
How do i get him to help me with this?
Should i like change the name of the post to include "Pickles are you out there?" at the end or somthing?






God i ask a lot of questions :roll:
User avatar
fps
Posts: 504
Joined: Mon Sep 26, 2005 9:54 pm
Location: in a magical land devoid of hope, happiness, and sanity.

Post by fps »

hmmmm.... :?
thats odd.
I don't see pickels name on the member list.
Or in the rest of the scripting fourm for that matter.
He was on the old fourms, is he still here?
User avatar
AndyCR
Posts: 1449
Joined: Wed Jul 06, 2005 5:08 pm
Location: Colorado, USA
Contact:

Post by AndyCR »

He comes on under Guest. He might see it. There are also others more than knowledgeable enough to help you, if they see it and have time to do so.
Jay
RF Dev Team
Posts: 1232
Joined: Fri Jul 08, 2005 1:56 pm
Location: Germany

Post by Jay »

I am not sure if RF072A already has it, but i've heard of an 'interface' for pawns that allows every pawn to access the variables of every other pawn. It works like this:

(PawnName).(FieldName) = (Value);

FieldName is one of those variables you make with those [] brackets. (Like DAMAGE[2] or IDLEANIMATION[Idle]) Look in the premade scripts and you will know what i mean.

in a scripted player that has already targeted an enemy it looks like this:

if(ACTION == "Attack")
{
if(WEAPON == "Knife")
{
self.target_name.KNIFED = self.target_name.KNIFED + DAMAGE;
}//WEAPONKNIFE
}//ACTIONATTACK


I don't know more, but i hope this helps.
Everyone can see the difficult, but only the wise can see the simple.
-----
User avatar
AndyCR
Posts: 1449
Joined: Wed Jul 06, 2005 5:08 pm
Location: Colorado, USA
Contact:

Post by AndyCR »

and just for the record, i believe in that case PawnName refers to the szEntityName set in the level editor.
Jay
RF Dev Team
Posts: 1232
Joined: Fri Jul 08, 2005 1:56 pm
Location: Germany

Post by Jay »

Yup that's right.
Everyone can see the difficult, but only the wise can see the simple.
-----
Guest

Post by Guest »

i think you are talking about the foe detecting what kind of weapon the player had when it was killed, right.
ive toyed with this idea before but i decided against it because it would to limiting and it would not allow for the game to function correctly with allied pawns, it would not make sence if an allied tank caused flashbang damage beacause that was the weapon the player had selected at the time.
There has got to be a way for the script of a pawn to check for more than one damage attribute, Right?
I dont know for shure and all of my previous attempts have failed.
I would be willing to narrow the list of damages decteted if i needed to.


Sombody has got to know the answer.

I will change the name of the post and see if i can draw some more eyes this way.
So far this post has helped me immensly.

Thank you,
Fps
Post Reply