Raised This Month: $182 Target: $400
 45% 

[Any] Gravity Reset


Post New Thread Reply   
 
Thread Tools Display Modes
Author
DarthNinja
SourceMod Plugin Approver
Join Date: Mar 2009
Location: PreThinkHook()
Plugin ID:
1492
Plugin Version:
1.0.2
Plugin Category:
Server Management
Plugin Game:
Any
Plugin Dependencies:
    Servers with this Plugin:
    2 
    Plugin Description:
    Resets gravity to a backup cvar at the end of the round
    Old 02-22-2010 , 19:04   [Any] Gravity Reset
    Reply With Quote #1

    [Any] Gravity Reset
    Plugin Version 1.0.2



    Description:
    Resets sv_gravity to the value of "gravreset_gravity" on round start.
    Useful if you have admins who like to change gravity, but forget/don't reset gravity.

    Should also fix the source engine bug where maps will use gravity from the previous map for props and projectiles.

    Commands:
    None

    Cvars:
    gravreset_message "1" whether to announce gravity change on round start 1/0.
    gravreset_gravity "800" gravity to reset to (800 is normal).
    sm_gravreset_version Plugin Version.
    Install Instructions:
    1. Upload the .smx file to your /sourcemod/plugins/ folder

    Notes:
    Tested on TF2, should work on any game though.
    ToDo:
    --


    Web Version History:
    • V1.0.0
      • Initial Release.
    • V1.0.1
      • Now hooks RoundStart rather then RoundEnd.
    • V1.0.2
      • Code cleanup.
      • Fixed wrong event still being hooked.


    Total downloads as prior to last edit: 193
    Attached Files
    File Type: sp Get Plugin or Get Source (GravReset.sp - 780 views - 1.3 KB)
    __________________

    Last edited by DarthNinja; 08-08-2011 at 11:50.
    DarthNinja is offline
    Mnkras
    Senior Member
    Join Date: Mar 2009
    Location: 127.0.0.1
    Old 02-22-2010 , 20:45   Re: [Any] Gravity Reset
    Reply With Quote #2

    how is this different from sticking sv_gravity 800 in the rtrigs plugin?
    __________________
    Mnkras is offline
    DarthNinja
    SourceMod Plugin Approver
    Join Date: Mar 2009
    Location: PreThinkHook()
    Old 02-23-2010 , 01:17   Re: [Any] Gravity Reset
    Reply With Quote #3

    Quote:
    Originally Posted by Mnkras View Post
    how is this different from sticking sv_gravity 800 in the rtrigs plugin?
    None really, except this requires no configuration.
    I'm going to add an alternate version that runs via timer instead of hooking roundend.
    __________________
    DarthNinja is offline
    Bacardi
    Veteran Member
    Join Date: Jan 2010
    Location: Battlefield 1 fields
    Old 04-03-2010 , 05:30   Re: [Any] Gravity Reset
    Reply With Quote #4

    So this reset gravity after round ??

    I mean, there is way reset gravity if forget leave it on server.
    But it reset after map change..
    Just add sv_gravity 800 in server.cfg

    noob comment
    Bacardi is offline
    blissend
    Member
    Join Date: Mar 2008
    Old 04-21-2010 , 15:00   Re: [Any] Gravity Reset
    Reply With Quote #5

    An old bug in TF2 maybe other source games is that if you do forget to reset the gravity to 800 before map change the grenades/stickies from the demoman class will still be in sync with the prior maps gravity. Same with ragdolls.

    It's funny to see this though. For example lets say you had ultra low gravity before map change and your server.cfg has sv_gravity 800 then that means grenades/stickies will fly ultra far and when people die they'll be matrix style falling to their deaths ever so slowly. This happens even though gravity has been reset to 800 and everything else looks normal but those things mentioned. On the other hand if you had ultra high gravity before map change then grenades/stickies will shoot out and stop dead in the air right infront of your gun... also funny but cruel to those that like playing demoman classes.

    So I was hoping this mod could reset before map change to help eliminate anyone forgetting and messing the demoman's guns up. Unless there is another way other than map changing to fix this?

    Last edited by blissend; 04-21-2010 at 15:12.
    blissend is offline
    DarthNinja
    SourceMod Plugin Approver
    Join Date: Mar 2009
    Location: PreThinkHook()
    Old 04-22-2010 , 03:46   Re: [Any] Gravity Reset
    Reply With Quote #6

    I just noticed that it was hooking RoundStart rather then RoundEnd, that has been corrected.

    Now gravity will return to normal after the round ends.
    (That would be before a map change, unless you force the map change)
    __________________

    Last edited by DarthNinja; 08-08-2011 at 11:39.
    DarthNinja is offline
    GrO
    Veteran Member
    Join Date: Jun 2010
    Location: Poland
    Old 08-24-2010 , 04:54   Re: [Any] Gravity Reset
    Reply With Quote #7

    Quote:
    Originally Posted by blissend View Post
    An old bug in TF2 maybe other source games is that if you do forget to reset the gravity to 800 before map change the grenades/stickies from the demoman class will still be in sync with the prior maps gravity. Same with ragdolls.
    It's an old annoying bug in CSS too. I wonder, when VALVe is going to fix this.

    It would be good, if this plugin could reset gravity before mapchange only, even during a forced mapchange at any time.

    Last edited by GrO; 11-08-2010 at 09:07.
    GrO is offline
    St00ne
    Veteran Member
    Join Date: Jan 2011
    Location: Annecy - France
    Old 03-10-2012 , 08:37   Re: [Any] Gravity Reset
    Reply With Quote #8

    Hi,

    The plugin currently doesn't work on CS:S. The event teamplay_round_win must be replaced by something else for cs:s I think.

    Log error:

    Code:
    L 03/10/2012 - 13:15:46: SourceMod error session started
    L 03/10/2012 - 13:15:46: Info (map "ka_soccer_2008_v6") (file "errors_20120310.log")
    L 03/10/2012 - 13:15:46: [SM] Native "HookEvent" reported: Game event "teamplay_round_win" does not exist
    L 03/10/2012 - 13:15:46: [SM] Displaying call stack trace for plugin "GravReset.smx":
    L 03/10/2012 - 13:15:46: [SM]   [0]  Line 29, /home/groups/sourcemod/upload_tmp/phpQUGI6w.sp::OnPluginStart()
    Regards,

    St00ne

    Last edited by St00ne; 07-16-2012 at 00:54.
    St00ne is offline
    Bacardi
    Veteran Member
    Join Date: Jan 2010
    Location: Battlefield 1 fields
    Old 03-10-2012 , 18:26   Re: [Any] Gravity Reset
    Reply With Quote #9

    Quote:
    Originally Posted by St00ne View Post
    Hi,

    The plugin currently doesn't work on CS:S. The event teamplay_round_win must be replaced by something else for cs:s I think.
    teamplay_round_win is for TF2, it not use round_end like most source games.

    *edit
    You can replace HookEvent part
    PHP Code:
    ........
        
    decl String:folder[64];
        
    GetGameFolderName(foldersizeof(folder));

        if (
    strcmp(folder"tf") == 0)
        {
            
    HookEvent("teamplay_round_win"Event_RoundEnd);
        }
        else
        {
            if(!
    HookEventEx("round_end"Event_RoundEnd))
            {
                
    SetFailState("Unable to find event: round_end");
            }
        }
    ........ 

    Last edited by Bacardi; 03-10-2012 at 18:34.
    Bacardi is offline
    St00ne
    Veteran Member
    Join Date: Jan 2011
    Location: Annecy - France
    Old 03-10-2012 , 19:54   Re: [Any] Gravity Reset
    Reply With Quote #10

    Quote:
    Originally Posted by Bacardi View Post
    teamplay_round_win is for TF2, it not use round_end like most source games.

    *edit
    You can replace HookEvent part
    PHP Code:
    ........
        
    decl String:folder[64];
        
    GetGameFolderName(foldersizeof(folder));

        if (
    strcmp(folder"tf") == 0)
        {
            
    HookEvent("teamplay_round_win"Event_RoundEnd);
        }
        else
        {
            if(!
    HookEventEx("round_end"Event_RoundEnd))
            {
                
    SetFailState("Unable to find event: round_end");
            }
        }
    ........ 
    Thank you, the plugin works without error now on CS:S.

    Unfortunately it doesn't do what I need:
    when I play on a ka_volleyball map, the gravity changes. When the nextmap is a normal or a soccer map, or any map with normal gravity, the gravity goes back to 800 BUT not for the ball or the weapons. Even if I change the map twice.
    These ka_volleyball maps change gravity for the models and then setting back gravity to 800 doesn't change the models gravity. It is getting on my nerves

    Last edited by St00ne; 03-10-2012 at 19:55.
    St00ne 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 18:33.


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