Freelancer Community Network
Reminder: Internet Explorer 6 or below are NOT supported.
HomeHome
ForumForum
WikiWiki
DownloadsDownloads
ForgeForge
Multiplayer Connection Tutorial
Collapse/Expand Random Image
Collapse/Expand Login
Username:

Password:

Remember me



Lost Password?

Register now!
Collapse/Expand Chat
Collapse/Expand Who's Online
81 user(s) are online (30 user(s) are browsing Forum)

Members: 0
Guests: 81

more...
Collapse/Expand Donations
Monthly costs: -30€
Income (ads): +5€
Donations (last month): +0€

Current balance: 55€
(last updated 04/2021)

Please make a donation if you want to help keeping The-Starport online:

Thanks!
Collapse/Expand Links
Collapse/Expand Advertisement
There are currently 36 users playing Freelancer on 47 servers.
November. 30, 2021

Browsing this Thread:   1 Anonymous Users



 Bottom   Previous Topic   Next Topic  Register To Post



Npc spawn distance

Joined:
2009/12/27 3:46
Group:
Registered Users
Posts: 28
Offline
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

Posted on: 9/16 14:51
Top
Re: Npc spawn distance
Just popping in
Joined:
9/1 21:25
Group:
Registered Users
Posts: 6
Offline
Looks like this is hardcoded:

Code:

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.

Posted on: 9/17 17:59
Top
Re: Npc spawn distance
Just popping in
Joined:
9/1 21:25
Group:
Registered Users
Posts: 6
Offline
Ha, coincidentally this is the same offset that can be used to eliminate the problem with invisible station lasers at long ranges.

Posted on: 9/17 18:30
Top
Re: Npc spawn distance

Joined:
2009/12/27 3:46
Group:
Registered Users
Posts: 28
Offline
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

Code:
<PropertyGroup>
    <_BuildSuffix>
:VCEnd</_BuildSuffix>
  </PropertyGroup>

  <Target Name="PreBuildEvent" Condition="'$(PreBuildEventUseInBuild)'!='false'">
    <Message Text="%(PreBuildEvent.Message)" Condition="'%(PreBuildEvent.Message)' != '' and '%(PreBuildEvent.Command)' != ''"  Importance="High" />
    <Exec Command="%(PreBuildEvent.Command)$(_BuildSuffix)" StdOutEncoding="%(PreBuildEvent.StdOutEncoding)" StdErrEncoding="%(PreBuildEvent.StdErrEncoding)" Condition="'%(PreBuildEvent.Command)' != ''"/>
  </Target>

  <Target Name="PreLinkEvent" Condition="'$(PreLinkEventUseInBuild)'!='false'">
    <Message Text="%(PreLinkEvent.Message)" Condition="'%(PreLinkEvent.Message)' != '' and '%(PreLinkEvent.Command)' != ''" Importance="High" />
    <Exec Command="%(PreLinkEvent.Command)$(_BuildSuffix)" StdOutEncoding="%(PreLinkEvent.StdOutEncoding)" StdErrEncoding="%(PreLinkEvent.StdErrEncoding)" Condition="'%(PreLinkEvent.Command)' != ''"/>
  </Target>

  <Target Name="PostBuildEvent" Condition="'$(PostBuildEventUseInBuild)'!='false'">
    <Message Text="%(PostBuildEvent.Message)" Condition="'%(PostBuildEvent.Message)' != '' and '%(PostBuildEvent.Command)' != ''" Importance="High" />
    <Exec Command="%(PostBuildEvent.Command)$(_BuildSuffix)" StdOutEncoding="%(PostBuildEvent.StdOutEncoding)" StdErrEncoding="%(PostBuildEvent.StdErrEncoding)" Condition="'%(PostBuildEvent.Command)' != ''"/>
  </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.

Posted on: 9/19 16:19
Top
Re: Npc spawn distance
Just popping in
Joined:
2015/9/13 18:49
Group:
Registered Users
FLServer Admins
$$$ Supporters $$$
Senior Members
Posts: 16
Offline
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.

Posted on: 9/19 22:12
Top