AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting (https://forums.alliedmods.net/forumdisplay.php?f=107)
-   -   Grenade Gravity Ignores Server Gravity (https://forums.alliedmods.net/showthread.php?t=337238)

ThatOneGuy 04-10-2022 01:56

Grenade Gravity Ignores Server Gravity
 
I've been on here a while today and done a bunch of testing. I'm trying to make it so that a grenade thrown always behaves like it is sv_gravity = 800, even if sv_gravity is 200, or 3000, etc. Essentially, I want the nade to fly the same no matter what the server gravity is.

Here's my code


Since it wasnt working perfectly, I have it do nothing to alter the nade during normal gravity. My guess is that the split second it spawns, the trajectory vector is already altered due to the server gravity, and even after fixing its gravity, the angles/velocity are already altered, so it comes out slightly different.

Note: I've also tried setting:
PHP Code:

SetEntityGravity(iEnt1.0); 

and
PHP Code:

SetEntityGravity(iEntview_as<float>(1.0/GetEntityGravity(iEnt))); 

Also experimented with SDKHook_Spawn vs SDKHook_SpawnPost, and using a 0.1 second timer vs RequestFrame (the timer took too long and gravity was applied mid-flight).

Anyone tackle this one or have an idea how to make it perfect?


All times are GMT -4. The time now is 22:03.

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