Raised This Month: $ Target: $400
 0% 

VSH VSH, old thread (v1.42) - Information/etc.


Post New Thread Closed Thread   
 
Thread Tools Display Modes
Chdata
Veteran Member
Join Date: Aug 2012
Location: Computer Chair, Illinois
Old 07-07-2014 , 12:32   Re: VS Saxton Hale Mode, main thread (current v1.42)
#4321

Any explanation for why the Damage Dealt strange part doesn't work when backstabbing Hale?

Does it detect modified damage or something?

Is it possible to get around this so it works?
__________________

Last edited by Chdata; 07-07-2014 at 12:47.
Chdata is offline
rswallen
SourceMod Donor
Join Date: Jun 2013
Location: 127.0.0.1
Old 07-08-2014 , 20:09   Re: VS Saxton Hale Mode, main thread (current v1.42)
#4322

Quote:
Originally Posted by Chdata View Post
Any explanation for why the Damage Dealt strange part doesn't work when backstabbing Hale?

Does it detect modified damage or something?

Is it possible to get around this so it works?
Backstabs don't do any actual damage in VSH - the OnTakeDamage hook blocks it completely.
Instead, an fake event_hurt message is sent and boss's health is reduced.

If it didn't, the boss would die instantly (Backstabs deal damage equal to 200% of the target's current health and always deal critical hits, increasing the damage to 600% of the target's current health)
rswallen is offline
WildCard65
Veteran Member
Join Date: Aug 2013
Location: Canada
Old 07-09-2014 , 08:38   Re: VS Saxton Hale Mode, main thread (current v1.42)
#4323

Quote:
Originally Posted by rswallen View Post
Backstabs don't do any actual damage in VSH - the OnTakeDamage hook blocks it completely.
Instead, an fake event_hurt message is sent and boss's health is reduced.

If it didn't, the boss would die instantly (Backstabs deal damage equal to 200% of the target's current health and always deal critical hits, increasing the damage to 600% of the target's current health)
ever heard of sdkhooks damage overriding? It's a NICE feature in sdkhooks OnTakeDamage hook, just modify the damage parameter then return Plugin_Changed and voila, you modified damage
WildCard65 is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 07-09-2014 , 09:54   Re: VS Saxton Hale Mode, main thread (current v1.42)
#4324

Quote:
Originally Posted by WildCard65 View Post
ever heard of sdkhooks damage overriding? It's a NICE feature in sdkhooks OnTakeDamage hook, just modify the damage parameter then return Plugin_Changed and voila, you modified damage
...which VSH already does for backstabs. You can see line 4552 where it assigns the new damage to damage and line 4950 where it returns Plugin_Changed.

I'm not actually sure why it fires a player_hurt as well since the game itself should do that. Remember,

Quote:
Originally Posted by Powerlord
Events are just notifications of something that already happened.
so simply firing a player_hurt won't make it do any damage... you need SDKHooks_TakeDamage for that.
__________________
Not currently working on SourceMod plugin development.

Last edited by Powerlord; 07-09-2014 at 09:55.
Powerlord is offline
rswallen
SourceMod Donor
Join Date: Jun 2013
Location: 127.0.0.1
Old 07-09-2014 , 12:03   Re: VS Saxton Hale Mode, main thread (current v1.42)
#4325

Quote:
Originally Posted by Powerlord View Post
You can see line 4552 where it assigns the new damage to damage and line 4950 where it returns Plugin_Changed.
The line above that (assuming you meant line 4852), damage is set to 0.0 if it is less than the boss's health. Why? Because it's code created back when "m_iMaxHealth" was reset every frame, and thus a backstab could instantly kill a boss player. The player_hurt event was probably fired so players with damage indicators turned on could see the damage

Last edited by rswallen; 07-09-2014 at 12:08.
rswallen is offline
Chdata
Veteran Member
Join Date: Aug 2012
Location: Computer Chair, Illinois
Old 07-10-2014 , 23:15   Re: VS Saxton Hale Mode, main thread (current v1.42)
#4326

Quote:
Originally Posted by rswallen View Post
The line above that (assuming you meant line 4852), damage is set to 0.0 if it is less than the boss's health. Why? Because it's code created back when "m_iMaxHealth" was reset every frame, and thus a backstab could instantly kill a boss player. The player_hurt event was probably fired so players with damage indicators turned on could see the damage
So basically what the plugin does now...

1. Blocks the damage, if it's enough to kill Hale. Then fakes the damage to the hale plugin and with a fake damage event. (Note: It's able to change the damage).

2. Doesn't block the damage if his health is lower than what the backstab should do. I haven't tested it, but given this, it should be possible for the "final stab" to count damage. Technically, because of that, it should mean that iChangeDamage is actually subtracted from hale's health twice (in ontakedamage when we fake it and in player_hurt where Hale tracks taking damage from players). But it doesn't matter, because he's dead and it never shows.

Additional information:

damage = bNueDisguised ? 13.333333 : 67.333333;

This code runs on my server only during backstabs.

The actual damage that happens after OnTakeDamage is finished, is 40 (knife default damage) or 202 (Hale's default damage). Basically, if it's a backstab, the damage is multiplied by 3. But it's also non-lethal.

So yeah, thanks. It should be entirely possible and now I understand what's going on enough to experiment.

I'm not actually in a position to be able to test things on a server right now, so...

PHP Code:
                if (bIsBackstab)
                {
                    
// Note: Just change this to a linear formula. This method of scaling is needless.
                    
new Float:changedamage = ( (Pow(float(HaleHealthMax)*0.00142.0) + 899.0) - (float(HaleHealthMax)*(Stabbed/100)) ); //HaleHealthMax*(0.12 - Stabbed / 90);
                    
new iChangeDamage RoundFloat(changedamage);

                    
//Damage[attacker] += iChangeDamage;

                    /*if (HaleHealth > iChangeDamage)
                    {
                        damage = 0.0;
                    }
                    else
                    {*/
                    
damage changedamage/3;
                    
/*}

                    HaleHealth -= iChangeDamage;
                    HaleRage += iChangeDamage;

                    if (HaleRage > RageDMG)
                    {
                        HaleRage = RageDMG;
                    }*/ 
And I suppose that fake event hurt can be removed.

PHP Code:
                    /*new Handle:stabevent = CreateEvent("player_hurt", true);

                    SetEventInt(stabevent, "userid", GetClientUserId(client));
                    SetEventInt(stabevent, "health", HaleHealth);
                    SetEventInt(stabevent, "attacker", GetClientUserId(attacker));
                    SetEventInt(stabevent, "damageamount", iChangeDamage);
                    SetEventInt(stabevent, "custom", TF_CUSTOM_BACKSTAB);

                    SetEventBool(stabevent, "crit", true);
                    SetEventBool(stabevent, "minicrit", false);
                    SetEventBool(stabevent, "allseecrit", true);

                    SetEventInt(stabevent, "weaponid", TF_WEAPON_KNIFE);

                    FireEvent(stabevent);*/ 
Also my vsh is 12810 lines '^'

Also I hate nested comments, but run into that problem a lot sometimes. Wat do?
__________________

Last edited by Chdata; 07-10-2014 at 23:23.
Chdata is offline
Chdata
Veteran Member
Join Date: Aug 2012
Location: Computer Chair, Illinois
Old 07-11-2014 , 01:45   Re: VS Saxton Hale Mode, main thread (current v1.42)
#4327

Basically I suppose it applies crit damage differently than normal crits. Anyone know if the critical kills part ever levels on no-crit servers? Backstabs aren't registered as crits on those which is why I think it handles crits differently.

(sorry double posting while on mobile)

Edit: Unless backstab detection is as bad as headshot detection (I ran a modded sniper server - it fails often and sometimes end up completely broken) and the only way this mod is truly detecting backstabs is if the stab would kill Hale. Then again... we could still use that couldn't we?

Ugh, wish my PC were working right now.
__________________

Last edited by Chdata; 07-11-2014 at 06:32.
Chdata is offline
FlaminSarge
Veteran Member
Join Date: Jul 2010
Old 07-11-2014 , 20:43   Re: VS Saxton Hale Mode, main thread (current v1.42)
#4328

Github (BitBucket?) is a thing that VSH should be on. I should do it sometime soon. Maybe.

Then people can contribute easily.
Kinda.
__________________
Bread EOTL GunMettle Invasion Jungle Inferno 64-bit will break everything. Don't even ask.

All plugins: Randomizer/GiveWeapon, ModelManager, etc.
Post in plugin threads with questions.
Steam is for playing games.
You will be fed to javalia otherwise.
Psyduck likes replays.
FlaminSarge is offline
Advokat
Member
Join Date: Mar 2014
Location: Australia
Old 07-11-2014 , 23:59   Re: VS Saxton Hale Mode, main thread (current v1.42)
#4329

At the very least it would allow us to do minor things like submit reskinned item support updates (like festives and such) relatively easily.
Advokat is offline
Chdata
Veteran Member
Join Date: Aug 2012
Location: Computer Chair, Illinois
Old 07-12-2014 , 13:08   Re: VS Saxton Hale Mode, main thread (current v1.42)
#4330

I've never understood github. But I do have a otbs reformatted vsh1.42 and one k&R (which I use).
__________________
Chdata is offline
Closed Thread



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 02:21.


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