Jump to content

Scaling falling damage based on gravity in SP


Recommended Posts

So I had found out that falling damage is affected by gravity in MP when I set g_gravity to a low value like 20 and walked off a high ledge and took no damage, where as I set it to a high value like 5000 and walked off an obstacle about box sized and took like 12 damage. Obviously it doesn't work this way in SP, however I had come across PM_CrashLandDelta were falling damage is reduced if there's standing water and directly above it there was another commented out PM_CrashLandDelta were there was actually some code that scaled the damage by calculating the velocity on landing just as I saw in PM_CrashLand in the MP code. This change seemed easy at first, the problem is, is that the commented out PM_CrashLandDelta has 5 different arguments and the current one only has two. The current on is PM_CrashLandDelta( vec3_t prev_vel, int waterlevel ) and the commented out one is PM_CrashLandDelta( vec3_t org, vec3_t prevOrg, vec3_t prev_vel, float grav, int waterlevel ). prev_vel and int waterlevel are the only two that the current one has and I don't know how to get the other three in function. I don't know where they need to be in order for it to work correctly. If anyone knows a way to do this help would be appreciated, thanks in advance for any answers.

 

Hmm, I probably should've posted this on a different board such as Coding and Scripts rather than Modding Assistance.

Asgarath83 likes this
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...