AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   [L4D & L4D2]Witch fixes[Left 4 Fix] (https://forums.alliedmods.net/showthread.php?t=315481)

Lux 04-10-2019 15:38

[L4D & L4D2]Witch fixes[Left 4 Fix]
 
1 Attachment(s)
Witch fixes stuff apart of Left 4 Fix.
https://github.com/LuxLuma/Left-4-fi...04%20fix/witch

Huge thanks to silvers in helping me learn alot of stuff about disassembly, IDA, memory patching and finding windows signatures.
Thanks Dragokas for testing L4D1 Linux.
Thanks fbef0102 for making L4D1 version of witch_allow_in_safezone.



Code:

[L4D2]Witch_Double_Startle_Fix
 - Fixes witch when wandering playing startle twice by forcing the NextThink to end the startle.

------------------------------------------------------------------------------------------------------
witch_allow_in_safezone
 - Allows witches to chase victims into safezones.

 - Extra Requirements
 - - [DHooks (Experimental Dynamic Detour support)](https://forums.alliedmods.net/showth...86#post2588686)

------------------------------------------------------------------------------------------------------
witch_prevent_target_loss
-Prevents the witch from randomly loosing target.

Note:
When used with witch_target_partch the witch will still target you over team changes, whenever Dhooks is updated with object returns I can test my fix idea.

------------------------------------------------------------------------------------------------------
witch_target_patch
 - Fixes witch going after wrong clone survivor



Installation:
1.Download the .zip files.
2.Choose What fixes to install files are named accordingly inside .zip file.
3.Open chosen files and move contents to "/addons/sourcemod" folder.
4.Restart the server.

fbef0102 07-26-2019 08:47

Re: [L4D2]Witch fixes[Left 4 Fix]
 
Very Useful, and I went to your Left-4-fix/left 4 fix/witch/ github
I saw you made many fix about witch.
And one fix I'm very interesting.
Sorry to bother you, do you have plan to do witch_allow_in_safezone.smx for left 4 dead 1?

Lux 07-27-2019 00:37

Re: [L4D2]Witch fixes[Left 4 Fix]
 
Not really in l4d2 there is a function that got added to

Code:

WitchLocomotion::IsAreaTraversable()
    CDirector::AllowWitchesInCheckpoints()

l4d1 there is no AllowWitchesInCheckpoints this was added for l4d2 i don't play l4d1 if it were easy enough for me to add support for l4d1 i would.

If you want to do it for your self my guess would be to
Detour WitchLocomotion::IsAreaTraversable() and check if the survivor is in the safezone nav area and just Set the return to true.


Ill have a look into no promises :P

fbef0102 07-27-2019 05:08

Re: [L4D2]Witch fixes[Left 4 Fix]
 
Quote:

Originally Posted by Lux (Post 2660780)
Code:

WitchLocomotion::IsAreaTraversable()
    CDirector::AllowWitchesInCheckpoints()

l4d1 there is no AllowWitchesInCheckpoints this was added for l4d2 i don't play l4d1 if it were easy enough for me to add support for l4d1 i would.

If you want to do it for your self my guess would be to
Detour WitchLocomotion::IsAreaTraversable() and check if the survivor is in the safezone nav area and just Set the return to true.

I will do it by myself and see if it works ,thanks

fbef0102 07-27-2019 07:14

Re: [L4D2]Witch fixes[Left 4 Fix]
 
Code:

WitchLocomotion::IsAreaTraversable()
In left4dead1 it really works in linux. It autually allows witches to chase survivor into saferoom!!
wow! what the wonderful fix!!!!!
However, there's a problem, I'm sorry, did not know where to find the windows signature
PHP Code:

"Games"
{
    
"left4dead"
    
{
        
"Functions"
        
{
            
"WitchLocomotion::IsAreaTraversable"
            
{
                
"signature"  "WitchLocomotion::IsAreaTraversable"
                "callconv"  "thiscall"
                "return"  "bool"
                "this"  "ignore"
            
}
        }
        
"Signatures"
        
{
            
"WitchLocomotion::IsAreaTraversable"
            
{
                
"library"        "server"
                "linux"        "@_ZNK15WitchLocomotion17IsAreaTraversableEPK8CNavArea"
                "windows"        "??????????????"
            
}
        }
    }



Lux 07-27-2019 15:49

Re: [L4D2]Witch fixes[Left 4 Fix]
 
Quote:

Originally Posted by fbef0102 (Post 2660804)
Code:

WitchLocomotion::IsAreaTraversable()
In left4dead1 it really works in linux. It autually allows witches to chase survivor into saferoom!!
wow! what the wonderful fix!!!!!
However, there's a problem, I'm sorry, did not know where to find the windows signature
PHP Code:

"Games"
{
    
"left4dead"
    
{
        
"Functions"
        
{
            
"WitchLocomotion::IsAreaTraversable"
            
{
                
"signature"  "WitchLocomotion::IsAreaTraversable"
                "callconv"  "thiscall"
                "return"  "bool"
                "this"  "ignore"
            
}
        }
        
"Signatures"
        
{
            
"WitchLocomotion::IsAreaTraversable"
            
{
                
"library"        "server"
                "linux"        "@_ZNK15WitchLocomotion17IsAreaTraversableEPK8CNavArea"
                "windows"        "??????????????"
            
}
        }
    }



Hey nice job on getting it working, ill try and get windows signiture for you later and post it.
Nice work on trying and getting it to work.

Lux 07-27-2019 17:20

Re: [L4D2]Witch fixes[Left 4 Fix]
 
Hello fbef0102 i think i found it

PHP Code:

"Games"
{
    
"left4dead"
    
{
        
"Functions"
        
{
            
"WitchLocomotion::IsAreaTraversable"
            
{
                
"signature"  "WitchLocomotion::IsAreaTraversable"
                "callconv"  "thiscall"
                "return"  "bool"
                "this"  "ignore"
            
}
        }
        
"Signatures"
        
{
            
"WitchLocomotion::IsAreaTraversable"
            
{
                
"library"        "server"
                "linux"        "@_ZNK15WitchLocomotion17IsAreaTraversableEPK8CNavArea"
                "windows"        "\x2A\x2A\x2A\x2A\x2A\x2A\x6A\x00\x8B\xF1\x6A\x03\x8B\x2A\x2A\x2A\x2A\x2A\x2A\x84"
            
}    /*    ? ? ? ? ? ? 6A 00 8B F1 6A 03 8B ? ? ? ? ? ? 84 */
        
}
    }


Enjoy let me know if it does not work.

fbef0102 07-28-2019 09:28

Re: [L4D2]Witch fixes[Left 4 Fix]
 
Quote:

PHP Code:

"windows" "\x2A\x2A\x2A\x2A\x2A\x2A\x6A\x00\x8B\xF1\x6A\x03\x8B\x2A\x2A\x2A\x2A\x2A\x2A\x84" 

Enjoy let me know if it does not work.
well when witch spawns , error occurs and servrer crashes
Code:

[DHOOKS] FATAL: Failed to find return address of original function. Check the arguments and return type of your detour setup.
PHP Code:

public void OnPluginStart()
{
    
Handle hGamedata LoadGameConfigFile(GAMEDATA);
    if(
hGamedata == null
        
SetFailState("Failed to load \"%s.txt\" gamedata."GAMEDATA);
    
    
Handle hDetour;
    
hDetour DHookCreateFromConf(hGamedata"WitchLocomotion::IsAreaTraversable");
    if(!
hDetour)
        
SetFailState("Failed to find \"WitchLocomotion::IsAreaTraversable\" signature.");
        
    if(!
DHookEnableDetour(hDetourtrueAllowWitchesInCheckpoints))
        
SetFailState("Failed to detour \"WitchLocomotion::IsAreaTraversable\".");
    
    
delete hGamedata;
}

public 
MRESReturn AllowWitchesInCheckpoints(Handle hReturn)
{
    
DHookSetReturn(hReturntrue);
    return 
MRES_Override;



Lux 07-28-2019 14:04

Re: [L4D2]Witch fixes[Left 4 Fix]
 
You want to fill in all the infomation for detours best you can, i think the nav area's are just ints as for the return looks like a bool to me.

PHP Code:

        "Functions"
        
{
            
"WitchLocomotion::IsAreaTraversable"
            
{
                
"signature"  "WitchLocomotion::IsAreaTraversable"
                "callconv"  "thiscall"
                "return"  "bool"
                "this"  "ignore"
                "arguments"
                
{
                    
"NavArea"
                    
{
                        
"type"    "int"
                    
}
                }
            }
        } 

Windows can be a real pain sometimes
PHP Code:

56 57 8B 7C 24 0C 6A 00 8B F1 
\x56\x57\x8B\x7C\x24\x0C\x6A\x00\x8B\xF1 

That is the function not wildcarded need to wildcarde the first 6bytes so other hooks can be hooked onto it.

fbef0102 07-29-2019 05:26

Re: [L4D2]Witch fixes[Left 4 Fix]
 
2 Attachment(s)
Quote:

Originally Posted by Lux (Post 2660986)
Windows can be a real pain sometimes
PHP Code:

56 57 8B 7C 24 0C 6A 00 8B F1 
\x56\x57\x8B\x7C\x24\x0C\x6A\x00\x8B\xF1 

That is the function not wildcarded need to wildcarde the first 6bytes so other hooks can be hooked onto it.

Great job, Lux
I test in l4d1 linux and windows and it works without any errors
Thanks!


All times are GMT -4. The time now is 15:38.

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