AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Approved Plugins (https://forums.alliedmods.net/forumdisplay.php?f=8)
-   -   Water Fall Damage (https://forums.alliedmods.net/showthread.php?t=49561)

XxAvalanchexX 01-07-2007 00:48

Water Fall Damage
 
1 Attachment(s)
Water Fall Damage 0.10
Thanks to v3x's No fall damage for making me realize to hook falling on prethink and check it on postthink.

Description
Just like in Counter-Strike: Source, if you fall into shallow water, you will take fall damage as you would if you regularly fell that distance. Only if you fall into deep, swimmable water, will you not take any fall damage. This should work for all Half-Life mods.

Cvars
waterfalldmg (default 1) - controls whether or not you take damage for falling into shallow water

SweatyBanana 01-07-2007 01:59

Re: Water Fall Damage
 
Hawt.

Cheap_Suit 01-28-2007 04:41

Re: Water Fall Damage
 
I think you already realized it before v3x posted that plugin.
http://forums.alliedmods.net/showthr...14&postcount#8
or you forgot about that? Lol good job anyways. BTW, can you "force" an ent to take fall damage with
Code:
set_pev(id,pev_watertype,CONTENTS_SOLID)

Voi 01-28-2007 06:49

Re: Water Fall Damage
 
very useful plugin, gj

its funny to see how ppl fall and die on aztec :D i forgot about plugin and died many times too :P

but if he jumps into water player should take a bit less damage than jumping to the ground

XxAvalanchexX 01-28-2007 15:35

Re: Water Fall Damage
 
Cheap_Suit: Probably not with just that. Damage is based on their falling velocity when they hit the ground, and a few defines. When I was adding hostage fall damage to my plugin, I had to try to find Counter-Strike's values (they are different from the base HL ones), and this is what I came up with.

Code:
// not exact, but pretty darn close  #define PLAYER_MAX_SAFE_FALL_SPEED 488.5  #define PLAYER_FATAL_FALL_SPEED    988.5  #define DAMAGE_FOR_FALL_SPEED    100.0 / (PLAYER_FATAL_FALL_SPEED - PLAYER_MAX_SAFE_FALL_SPEED)

So far it seems to be 100% accurate after the rounding occurs. Maybe you could try this code (ie, this would make them take 10.0 fall damage):

Code:
new Float:damage = 10.0 set_pev(id,pev_watertype,CONTENTS_SOLID); set_pev(id,pev_flags,pev(id,pev_flags) & FL_ONGROUND); set_pev(id,pev_flFallVelocity,PLAYER_MAX_SAFE_FALL_SPEED + (damage / DAMAGE_FOR_FALL_SPEED));

It might have to be executed in one of the thinks.

Simon Logic 01-29-2007 09:54

Re: Water Fall Damage
 
#define MAX_SAFE_FALLSPEED_CS 500.0
#define MAX_SAFE_FALLSPEED_HL 580.0

XxAvalanchexX 01-29-2007 20:29

Re: Water Fall Damage
 
Where did you come up with the value for CS?

Simon Logic 02-13-2007 09:36

Re: Water Fall Damage
 
I have my own plugin (not released yet) which changes some HL physics. By using it (with debug messages) i detected critical speed for CS with accuracy of +-2.0. I don't think VALVe's programmers love non-round values. Thus 500 is ideal speed. When i set it I had no false damage during long lasting tests.

Voi 02-13-2007 12:37

Re: Water Fall Damage
 
cool, i would be glad to see this :)

btw if u jump at de_rats from the shelf to water pot u will die, this has to be fixed somehow

godlike 02-13-2007 12:38

Re: Water Fall Damage
 
Only if you fall into deep, swimmable water, will you not take any fall damage

please read before posting.


All times are GMT -4. The time now is 00:27.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.