Raised This Month: $51 Target: $400
 12% 

[TF2] Projectile Gravity (v0.1.0, 2010-09-16)


Post New Thread Reply   
 
Thread Tools Display Modes
Author
jouva
Senior Member
Join Date: Jan 2010
Plugin ID:
1955
Plugin Version:
0.1.0
Plugin Category:
Fun Stuff
Plugin Game:
Team Fortress 2
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    Automatically changes the gravity of projectiles on map change
    Unapprover:
    Reason for Unapproving:
    not useful beyond setting a cvar
    Old 09-16-2010 , 03:52   [TF2] Projectile Gravity (v0.1.0, 2010-09-16)
    Reply With Quote #1

    Projectile Gravity
    Version 0.1.0

    Description
    This plugin is, so far, a quick and dirty workaround to automatically set the gravity of projectiles in TF2. These currently include:
    • Stunballs
    • Grenades
    • Sticky bombs
    • Jarate
    Huntsman arrows are ALSO affected, but unlike the list above, they are affected by the server's current gravity. The above list is affected by the gravity set at the time of the map loading. This plugin exploits that by setting a specified gravity before the new map reloads and sets back the current gravity after it has loaded.

    Also note this is my first publicly released plugin, but not my first plugin I've wrote or modified for my own purposes, or is this anywhere near my first experience with programming. So any tips for things I may have overlooked when making (other than commenting) this would be appreciated as well.

    Cvars

    • sm_projectile_gravity_version - Pretty obvious. Don't touch. :P
    • sm_projectile_gravity_enabled - Set to 1 if you want the plugin enabled on map change. 0 to disable. (Default: 1)
    • sm_projectile_gravity_value - The gravity value to use on projectiles. Works the same as sv_gravity. (Default: 400)
    Updates
    • Version 0.1.0 (2010-09-16)
      - Initial release
    Attached Files
    File Type: sp Get Plugin or Get Source (projectilegravity.sp - 921 views - 1.6 KB)
    jouva is offline
    Thrawn2
    Veteran Member
    Join Date: Apr 2009
    Old 09-16-2010 , 03:59   Re: [TF2] Projectile Gravity (v0.1.0, 2010-09-16)
    Reply With Quote #2

    it might be nicer to use
    native Phys_SetMass(entity, Float:mass);
    from VPhysics for this.
    you wouldnt have problems with huntsman arrows anymore, and you could do it per player and stuff.

    if it affects trajectory at all :]
    __________________
    einmal mit profis arbeiten. einmal.
    Thrawn2 is offline
    jouva
    Senior Member
    Join Date: Jan 2010
    Old 09-16-2010 , 04:10   Re: [TF2] Projectile Gravity (v0.1.0, 2010-09-16)
    Reply With Quote #3

    Might be a better idea, but this is a very cheap and quick work around for now as I just noticed this. I did debate some other calls, but I believe I'd need to latch on to when a new entity gets created, check if it's one of the proper types that I'd be dealing with and then set the gravity of it. There's already a native SetEntityGravity for this rather than the Phys_SetMass call, and from what I can tell that call should be sufficient for this.

    Last edited by jouva; 09-16-2010 at 04:17.
    jouva is offline
    jameless
    Veteran Member
    Join Date: Jan 2010
    Old 09-28-2010 , 20:10   Re: [TF2] Projectile Gravity (v0.1.0, 2010-09-16)
    Reply With Quote #4

    I am curious as to how well this plugin works. I have found occassionally on our server that the projectile gravity seems to break and by changing sv_gravity to 800 it doesn't always change it back properly. If this plugin works well then I could use it for the opposite reason for it's design. Is the default value of the cvar something fun to use or is that the projectile gravity normally?

    EDIT: Nevermind it only works during map change. I was hoping for something that could fix the projectile gravity upon command. Sorry for wasting your time.

    Last edited by jameless; 09-28-2010 at 20:44. Reason: didn't read it properly first time
    jameless is offline
    Reply



    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 13:37.


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