Npc spawn distance
-
Hello,
Im working on a mod that use flhook, I notice it overrules the distance offsets in the content.dll and server.dll for spawn distance and persistence. they both seemed cap at 6500. anyone know how to tell flhook to expand its range for the npc spawns?
Thanks
Jericus
-
Looks like this is hardcoded:
hModServerAC = GetModuleHandle("server.dll"); if (hModServerAC) { // Patch the NPC visibility distance in MP to 6.5km (default // is 2.5km) float fDistance = 6500.0f * 6500.0f; WriteProcMem((char *)hModServerAC + 0x86AEC, &fDistance, 4); FARPROC fpHook = (FARPROC)HkCb_GetRoot; ReadProcMem((char *)hModServerAC + 0x84018, &fpOldGetRootProc, 4); WriteProcMem((char *)hModServerAC + 0x84018, &fpHook, 4); }
I guess the easiest way to change it would be to fork FLHook and make the change in the source code. No idea why they’re doing this here though. Maybe you can just remove it? Though it is in a file called “CrashCatcher.cpp”…
Edit: And it should be noted that this is in the playercntl plugin, not FlHook itself. So if you want to get rid of the behaviour for testing puposes, maybe try disabling it? Just speculation though. I don’t have much experience with this myself.
-
Thank you so much. no i have run into another problem
when i try to recompile it. i get this error.
Severity Code Description Project File Line Suppression State
Error MSB3073 The command "copy …\flhookplugin\trunk\sdk\libs*.lib libs
copy …\flhookplugin\trunk\sdk\headers*.h headers\:VCEnd" exited with code 1. Player Control C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets 145
<propertygroup><_BuildSuffix> :VCEnd</propertygroup> <target name="PreBuildEvent" condition="'$(PreBuildEventUseInBuild)'!='false'"><message text="%(PreBuildEvent.Message)" condition="'%(PreBuildEvent.Message)' != '' and '%(PreBuildEvent.Command)' != ''" importance="High"></message></target> <target name="PreLinkEvent" condition="'$(PreLinkEventUseInBuild)'!='false'"><message text="%(PreLinkEvent.Message)" condition="'%(PreLinkEvent.Message)' != '' and '%(PreLinkEvent.Command)' != ''" importance="High"></message></target> <target name="PostBuildEvent" condition="'$(PostBuildEventUseInBuild)'!='false'"><message text="%(PostBuildEvent.Message)" condition="'%(PostBuildEvent.Message)' != '' and '%(PostBuildEvent.Command)' != ''" importance="High"></message></target>
it point to that for the error.
How do i tell it a new directory for the flhook.lib?
thanks
Jericus
ps Im learn this as I go, sorry if it a dumb question.
-
Just noticed from your file paths you might be using the old svn version of FLHook.
The newer FLHook is on Github: https://github.com/Friendly0Fire/FLHook
Should be easier to make the edit and compile.