News:

One Minute Game Review by The Happy Friar: https://ugetube.com/@OneMinteGameReviews
Also on Rumble: https://rumble.com/c/c-1115371

idTech 4 (aka Doom 3 tech) Discord Server! https://discord.gg/9wtCGHa

Main Menu

Different pain anim based on weapon used?

Started by The Happy Friar, July 28, 2015, 06:22:10 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

The Happy Friar

Is that possible in the current system?  Or perhaps based on the type of damage dealt (bullet, rocket, etc)?  I know how to do semi-locational animations but (for example), chainsaw does one damage anim, pistol does one, punch does one, rocket does one vs pain in arm, head, etc.?

motorsep

Me thinks you can get $player1.getCurrentWeapon() and play pain anim if weapon matches. There is also getIdealWeapon(); in RoE and there are a few more events that might work.

The issue is that you can only determine what play is holding and not what enemy was damaged with. So you might shoot it with pistol and switch to rl quickly. So pain anim for rl would play.

I am sure there can be some hacky workaround done with scripts :)

BloodRayne

For complete accuracy, you need to focus on the projectiles. In their hit() code, pass a variable along to the entity it hit so that you can check per projectile. That way, if the player throws some handgrenades and switches to the gun (or vice versa) the anims will remain accurate. You'll also need some form of precedence then, e.g. if within the same second something is hit by both a bullet and a grenade, the visual impact of the grenade will be larger than the other way around.

motorsep

Quote from: BloodRayne on July 29, 2015, 07:46:42 AM
For complete accuracy, you need to focus on the projectiles. In their hit() code, pass a variable along to the entity it hit so that you can check per projectile. That way, if the player throws some handgrenades and switches to the gun (or vice versa) the anims will remain accurate. You'll also need some form of precedence then, e.g. if within the same second something is hit by both a bullet and a grenade, the visual impact of the grenade will be larger than the other way around.

Wouldn't that require SDK code change ?

BloodRayne

Quote from: motorsep on July 29, 2015, 09:03:30 AM
Quote from: BloodRayne on July 29, 2015, 07:46:42 AM
For complete accuracy, you need to focus on the projectiles. In their hit() code, pass a variable along to the entity it hit so that you can check per projectile. That way, if the player throws some handgrenades and switches to the gun (or vice versa) the anims will remain accurate. You'll also need some form of precedence then, e.g. if within the same second something is hit by both a bullet and a grenade, the visual impact of the grenade will be larger than the other way around.

Wouldn't that require SDK code change ?
No. You can set a variable by hooking into the script object of a projectile.

entity proj = LaunchProjectiles(blah)