Raised This Month: $94 Target: $400
 23% 

Water Fall Damage


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   ALL        Category:   Gameplay        Approver:   Brad (55)
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 01-07-2007 , 01:48   Water Fall Damage
Reply With Quote #1

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
Attached Files
File Type: sma Get Plugin or Get Source (waterfalldmg.sma - 1619 views - 923 Bytes)
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
SweatyBanana
BANNED
Join Date: Sep 2005
Location: LOL
Old 01-07-2007 , 02:59   Re: Water Fall Damage
Reply With Quote #2

Hawt.
SweatyBanana is offline
Send a message via AIM to SweatyBanana Send a message via Yahoo to SweatyBanana
Cheap_Suit
Veteran Member
Join Date: May 2004
Old 01-28-2007 , 05:41   Re: Water Fall Damage
Reply With Quote #3

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)
__________________
HDD fried, failed to backup files. Sorry folks, just don't have free time anymore. This is goodbye.
Cheap_Suit is offline
Voi
Veteran Member
Join Date: Sep 2006
Location: Gdansk, Poland
Old 01-28-2007 , 07:49   Re: Water Fall Damage
Reply With Quote #4

very useful plugin, gj

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

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

Last edited by Voi; 01-28-2007 at 07:51.
Voi is offline
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 01-28-2007 , 16:35   Re: Water Fall Damage
Reply With Quote #5

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.
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
Simon Logic
Senior Member
Join Date: Nov 2006
Location: RF
Old 01-29-2007 , 10:54   Re: Water Fall Damage
Reply With Quote #6

#define MAX_SAFE_FALLSPEED_CS 500.0
#define MAX_SAFE_FALLSPEED_HL 580.0
__________________
my modest stuff: AXN 1.6.1 | plugins | bsp2csdm
Simon Logic is offline
Send a message via Skype™ to Simon Logic
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 01-29-2007 , 21:29   Re: Water Fall Damage
Reply With Quote #7

Where did you come up with the value for CS?
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
Simon Logic
Senior Member
Join Date: Nov 2006
Location: RF
Old 02-13-2007 , 10:36   Re: Water Fall Damage
Reply With Quote #8

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.
__________________
my modest stuff: AXN 1.6.1 | plugins | bsp2csdm

Last edited by Simon Logic; 02-13-2007 at 10:42.
Simon Logic is offline
Send a message via Skype™ to Simon Logic
Voi
Veteran Member
Join Date: Sep 2006
Location: Gdansk, Poland
Old 02-13-2007 , 13:37   Re: Water Fall Damage
Reply With Quote #9

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
__________________
Voi is offline
godlike
Senior Member
Join Date: Apr 2005
Old 02-13-2007 , 13:38   Re: Water Fall Damage
Reply With Quote #10

Only if you fall into deep, swimmable water, will you not take any fall damage

please read before posting.
__________________
Read the rules before posting something stupid: click here

Any questions about amxx PM me
godlike is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 23:25.


Powered by vBulletin®
Copyright ©2000 - 2020, vBulletin Solutions, Inc.
Theme made by Freecode