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

[TF2] Health w/o Decay


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Max_Damage
Junior Member
Join Date: Jun 2009
Old 06-11-2011 , 22:55   [TF2] Health w/o Decay
Reply With Quote #1

I've looked through every 'health' post in this section of the forum.
Is there still any way from setting max health to a player that actually works w/o decay?
__________________
Max_Damage is offline
Tylerst
Veteran Member
Join Date: Oct 2010
Old 06-11-2011 , 23:10   Re: [TF2] Health w/o Decay
Reply With Quote #2

sm_cvar tf_boost_drain_time "9999999"
Tylerst is offline
Max_Damage
Junior Member
Join Date: Jun 2009
Old 06-11-2011 , 23:13   Re: [TF2] Health w/o Decay
Reply With Quote #3

Quote:
Originally Posted by Tylerst View Post
sm_cvar tf_boost_drain_time "9999999"
Thanks, I know that one, but I'm looking to do it with a plugin.
__________________
Max_Damage is offline
Tylerst
Veteran Member
Join Date: Oct 2010
Old 06-12-2011 , 00:09   Re: [TF2] Health w/o Decay
Reply With Quote #4

A bit hackish, but this is the only way I know of(would also work with a repeating timer):
PHP Code:
public OnGameFrame()
{
     for (new 
i=1;i<MaxClientsi++)
     {
          if (
IsClientInGame(i)&&IsPlayerAlive(i))
          {
               
TF2_AddCondition(iTFCond_Healing1.0);
          }
     }


Other than that, you could set health OnGameFrame and use SDKhooks to reduce it OnTakeDamage.

Also, Using TF2Items, there is an overheal decay disable attribute for mediguns(Attribute 14);

Last edited by Tylerst; 06-12-2011 at 00:12.
Tylerst is offline
Max_Damage
Junior Member
Join Date: Jun 2009
Old 06-12-2011 , 14:44   Re: [TF2] Health w/o Decay
Reply With Quote #5

What you wrote works. But I'm looking to increase the ceiling of max_health.
Example: Scout has max health of 125, is there a way to permanently increase it to 150 w/o decay.
I kept reading that changing m_iMaxHealth works before some patch, but not anymore.
__________________
Max_Damage is offline
Tylerst
Veteran Member
Join Date: Oct 2010
Old 06-12-2011 , 20:26   Re: [TF2] Health w/o Decay
Reply With Quote #6

Quote:
Originally Posted by Max_Damage View Post
What you wrote works. But I'm looking to increase the ceiling of max_health.
Example: Scout has max health of 125, is there a way to permanently increase it to 150 w/o decay.
I kept reading that changing m_iMaxHealth works before some patch, but not anymore.
I think that used to work yes, but not anymore.

If you want to permanently increase scouts to 150 health though, you can edit the tf/scripts/playerclasses/scout.ctx file with a ctx decompiler/recompiler and change the health_max value to 150.

That will permanantly change the base health, and obey all the equipment/medigun overhealing rules.(IE, medigun will overheal to 225, sandman will reduce to 135 health, etc.)

I just realized, If you want a plugin to do it, you could use TF2items to do it, with attribute 26(max health additive bonus)

You would just need to edit the tf2items.weapons config file to add that attribute to a scout item(IE, add it on every scout primary, or every scout secondary, or every scout melee, so as not to stack them)

Edit: I just tested this successfully, it gave scouts with the z flag 150 base health
Attached Files
File Type: txt tf2items.weapons.txt (379 Bytes, 164 views)

Last edited by Tylerst; 06-12-2011 at 20:49.
Tylerst is offline
Thrawn2
Veteran Member
Join Date: Apr 2009
Old 06-13-2011 , 06:25   Re: [TF2] Health w/o Decay
Reply With Quote #7

the smoothest way would probably be to use this.
__________________
einmal mit profis arbeiten. einmal.
Thrawn2 is offline
bl4nk
SourceMod Developer
Join Date: Jul 2007
Old 06-13-2011 , 07:32   Re: [TF2] Health w/o Decay
Reply With Quote #8

Why not try changing m_iMaxHealth on PostThink using SDKHooks?
bl4nk is offline
Max_Damage
Junior Member
Join Date: Jun 2009
Old 06-13-2011 , 17:42   Re: [TF2] Health w/o Decay
Reply With Quote #9

Quote:
Originally Posted by bl4nk View Post
Why not try changing m_iMaxHealth on PostThink using SDKHooks?

Not quite at that level of SourceMod knowledge, can you elaborate?
__________________
Max_Damage is offline
Tylerst
Veteran Member
Join Date: Oct 2010
Old 06-13-2011 , 18:52   Re: [TF2] Health w/o Decay
Reply With Quote #10

I'm guessing he meant something like this, but that would only cause the hp to fluxuate between 125 and 150 since the game resets it per frame.
PHP Code:
#include <sourcemod>
#include <tf2>
#include <tf2_stocks>
#include <sdkhooks>
public OnPluginStart()
{
     for (new 
1<= MaxClientsi++)
     {
          if(
IsClientInGame(i)) 
          {
               
SDKHook(iSDKHook_PostThinkPostThinkHook);
          }  
     }  
}
public 
OnClientPutInServer(client)
{
     
SDKHook(clientSDKHook_PostThinkPostThinkHook);
}
 
public 
PostThinkHook(client)
{
     if(
TF2_GetPlayerClass(client)&TFClass_Scout)
     {
          
TF2_SetPlayerResourceData(clientTFResource_MaxHealth150)
     }



Quote:
Originally Posted by Thrawn2 View Post
the smoothest way would probably be to use this.
I had no idea that extension existed, this works perfectly!

There ya go Max, just install the attached extension and plugin.
Have fun

Edit:Added extension attachment
Attached Files
File Type: sp Get Plugin or Get Source (ScoutHealth150.sp - 249 views - 157 Bytes)
File Type: zip TF2_PlayerClassData-7b7d463fb3e2.zip (53.4 KB, 135 views)

Last edited by Tylerst; 06-13-2011 at 19:05.
Tylerst 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 10:28.


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