Get the name of the last bone that collided
Get the name of the last bone that collided
If a pawn attacks with a melee weapon that has some bones and you want to get the name of the bone that collided the target pawn,
and then use DamageAtBone to inflict damage according the weapon bone that collided, Is there any appropriate command for this?
The reason is that a sword with "damage area" bones,one at middle one next and one at the tip would do more damage towards the tip.
I am not sure i have checked all commands in the manual, from what i remember theres a getlastbonehit command for knowing which place a projectile hit a pawn,which is not what i describe.
and then use DamageAtBone to inflict damage according the weapon bone that collided, Is there any appropriate command for this?
The reason is that a sword with "damage area" bones,one at middle one next and one at the tip would do more damage towards the tip.
I am not sure i have checked all commands in the manual, from what i remember theres a getlastbonehit command for knowing which place a projectile hit a pawn,which is not what i describe.
Re: Get the name of the last bone that collided
I checked again,and the getlastbonehit is the only that could be used.
I hope the "hit" means it will work for melee weapons collision,but i am not that good in scripting to do a test.
string GetLastBoneHit();
Returns the name of the bone last hit.
I hope the "hit" means it will work for melee weapons collision,but i am not that good in scripting to do a test.
string GetLastBoneHit();
Returns the name of the bone last hit.
- QuestOfDreams
- Site Admin
- Posts: 1520
- Joined: Sun Jul 03, 2005 11:12 pm
- Location: Austria
- Contact:
Re: Get the name of the last bone that collided
Weapon actors do not perform any collision detection.
GetLastBoneHit() just returns the last bone of the pawn's actor that was hit by a projectile.
GetLastBoneHit() just returns the last bone of the pawn's actor that was hit by a projectile.
Re: Get the name of the last bone that collided
Its the master pawn bones that collide the target pawn,the weapon bones are just for moving the weapon ,and has the same skeleton in order to function.
So,now what,maybe ask for a new command?
So,now what,maybe ask for a new command?
Re: Get the name of the last bone that collided
You might be able to use the GetBoneToBone command to figure out which weapon bone gets the damage when the weapon hit the target pawn. Use the bone returned from the GetLastBoneHit command along with the GetBoneToBone command and compare the distance to each bone in the weapon. The closest weapon bone gets the damage.
NOTE: I've never written a script for RF but I am a programmer.
NOTE: I've never written a script for RF but I am a programmer.
Re: Get the name of the last bone that collided
I had already thought it but i want simpler and shorter (and cleaner scripts)
Since there is a get last bone hit command why not having another command
that works for bone to bone collision so we know which of the Pawn bones has hit the target bones.
If this new command can be created easily,
then next and i would not mind to also to know which of the target bones was collided,(head,arm,torso,leg etc).
Since there is a get last bone hit command why not having another command
that works for bone to bone collision so we know which of the Pawn bones has hit the target bones.
If this new command can be created easily,
then next and i would not mind to also to know which of the target bones was collided,(head,arm,torso,leg etc).
- QuestOfDreams
- Site Admin
- Posts: 1520
- Joined: Sun Jul 03, 2005 11:12 pm
- Location: Austria
- Contact:
Re: Get the name of the last bone that collided
I should have made this clearer in my first post: the only actors that currently perform collision detection at the bone bounding box level are projectiles. So it won't be as simple as just adding a new script command...
Re: Get the name of the last bone that collided
Ok,thanks- i will better simplify it,and use damageatbone using only one bone at a time from the skeleton that is located near the sword tip,(somewhat before the tip,so it seems like you need to thrust it deep enough to hit stab or cut the target).
This way with damageatbone the damage will be done to the overall target bounding box,and if a tall ogre swings a spiked ball in chain to your face, you can crouch and the ball's bone will pass above you.
About the GetBoneToBone,i thought it can be used to check if the bones of an attached tail.
I hope that around 20 attack animation frames are enough time to use damageatbone (for general damage) and GetBoneToBone -to know if the tail bone has been hit.
I assume i should have a different script for dealing each opponent,otherwise all the attacks will check if the tail bone has hit even when you fight a human wizard.
This way with damageatbone the damage will be done to the overall target bounding box,and if a tall ogre swings a spiked ball in chain to your face, you can crouch and the ball's bone will pass above you.
About the GetBoneToBone,i thought it can be used to check if the bones of an attached tail.
I hope that around 20 attack animation frames are enough time to use damageatbone (for general damage) and GetBoneToBone -to know if the tail bone has been hit.
I assume i should have a different script for dealing each opponent,otherwise all the attacks will check if the tail bone has hit even when you fight a human wizard.
- darksmaster923
- Posts: 1857
- Joined: Wed Jan 03, 2007 10:32 pm
- Location: Huntington Beach, California, USA
- Contact:
Re: Get the name of the last bone that collided
Kind of ugly, but you can always check the distance to the player, and if the enemy is within a certain radius, the attack does more damage, or less damage and such.
Herp derp.
Re: Get the name of the last bone that collided
I would like to check if the sword bone gets near the shieild bones first,so i can do damage to the shield accessory and not the enemy itself,
but i am not sure if it can be done,maybe the cpu can test many distances between bones during an attack that lasts 20 frames.
If i manage to check when the sword gets to the sheild first,i would also like to place an actor explosion so it seems like the shield explodes to pieces on the floor.
but i am not sure if it can be done,maybe the cpu can test many distances between bones during an attack that lasts 20 frames.
If i manage to check when the sword gets to the sheild first,i would also like to place an actor explosion so it seems like the shield explodes to pieces on the floor.