AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [Half-Life] Ham_TakeHealth but for armor chargers (https://forums.alliedmods.net/showthread.php?t=139823)

Flipper_SPb 10-05-2010 15:25

[Half-Life] Ham_TakeHealth but for armor chargers
 
I use Ham_TakeHealth to change capacity of wall mounted healthkit (just return 2 * health )
How to do the same with HEV chargers?

I tried to use Ham_Use, but function calls much faster then armor adds to player.

Arkshine 10-05-2010 16:11

Re: [Half-Life] Ham_TakeHealth but for armor chargers
 
If you use HL, you have cvars for that. sk_ something. See skill.cfg

Flipper_SPb 10-05-2010 16:23

Re: [Half-Life] Ham_TakeHealth but for armor chargers
 
I can change the healthkit only.

PHP Code:

sk_healthcharger1        "50"
sk_healthcharger2        "40"
sk_healthcharger3        "25" 

sk_healthcharger1 works for multiplayer

There are:

PHP Code:

sk_suitcharger1        "75"
sk_suitcharger2        "50"
sk_suitcharger3        "35" 

But it doesn't work for multiplayer. Suitcharger in HLDM has 30 armor points.

Arkshine 10-05-2010 16:36

Re: [Half-Life] Ham_TakeHealth but for armor chargers
 
Like you can see in the HLSDK-multiplayer :

healthkit : if ( pPlayer->TakeHealth( gSkillData.healthkitCapacity, DMG_GENERIC ) )
battery : m_iJuice = static_cast<int>(gSkillData.suitchargerCapaci ty);

It uses the cvars.

Flipper_SPb 10-05-2010 16:46

Re: [Half-Life] Ham_TakeHealth but for armor chargers
 
Unfortunately cvar that I need is hardcoded in hlsdk.

PHP Code:

void CHalfLifeMultiplay::RefreshSkillDatavoid )
{
// load all default values
 
CGameRules::RefreshSkillData();

// override some values for multiplay.

 // suitcharger
 
gSkillData.suitchargerCapacity 30


Arkshine 10-05-2010 17:24

Re: [Half-Life] Ham_TakeHealth but for armor chargers
 
So, modify manually m_iJuice when the item spawn.

Flipper_SPb 10-06-2010 03:26

Re: [Half-Life] Ham_TakeHealth but for armor chargers
 
And how to do that?
Ham_TakeHealth better than changing sk_healthcharger1 because I can get double health for the same time.

Arkshine 10-06-2010 04:58

Re: [Half-Life] Ham_TakeHealth but for armor chargers
 
m_iJuice is an offset, the value is 62 for windows.

Hook Ham_Spawn with "func_recharge" and as post, and use set_pdata_int( entity, 62, your_new_value );

Quote:

Ham_TakeHealth better than changing sk_healthcharger1 because I can get double health for the same time.
I don't understand what you are saying and I don't see the point to hook TakeHealth if the cvar work unless if the value may not the same.

Flipper_SPb 10-06-2010 05:48

Re: [Half-Life] Ham_TakeHealth but for armor chargers
 
Quote:

Originally Posted by Arkshine (Post 1316813)
m_iJuice is an offset, the value is 62 for windows.

Ok. Thank you.




Quote:

Originally Posted by Arkshine (Post 1316813)
I don't understand what you are saying and I don't see the point to hook TakeHealth if the cvar work unless if the value may not the same.

If I use TakeHealth and return (health * 2), I get HP two times faster.

Arkshine 10-06-2010 05:52

Re: [Half-Life] Ham_TakeHealth but for armor chargers
 
I don't get, whatever you change gSkillData.healthkitCapacity or changing the param on the fly in TakeHealth, it's the same result...


All times are GMT -4. The time now is 10:18.

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