Compatibility with fastman92limitadjuster
Is plugin-sdk compatible with fastman92limitadjuster (FLA)? FLA is a necessary plugin for projects like SAxVCxLC and Gta Underground.
I belive that some addresses in plugin-sdk need to be switchable depending on wheather FLA is running or not (and perhaps depending on which limit hacks are active). Fastman92 wrote a guideline for this: http://gtaforums.com/topic/733982-fastman92-limit-adjuster/?p=1066099922
Info. When downloading FLA the source code is included. There you can find the file: fastman92_limit_adjuster_4_3\fastman92 limit adjuster 4.3\source code\fastman92 limit adjuster\fastman92 limit adjuster\howToMakePluginsCompatible.txt
I have found the following update from version 4.2 to 4.3:
4.2:
0x40122D - holds a pointer to CStreaming::ms_modelInfoPtrs array (0x0xA9B0C8 by default)
4.3:
(0x4C5538+3)- holds a pointer to CStreaming::ms_modelInfoPtrs array (0x0xA9B0C8 by default)
Recently I started to host an FLA compatible version of GarageExtender. The mod created by Link2012 uses some of the old files from plugin-sdk, so the issue is very similar.
The current version of GarageExtender uses the addresses for FLA 4.2. I have tested it now with FLA 4.3 and it does not work reliably for the reason described in the previous post (changed addresses). Hence, a solution is neede how to detect the version of FLA and to detect if FLA is running at all. The solution must be backward compatible with older versions of FLA that are in use and will be used.
To detect if FLA is running, a possibility is (a) to check which modules are loaded in memory or (b) check if the FLA asi file is present in the folder. I am not sure at what time it is safe to assume that all modules are loaded.
To detect the version of FLA the file size can be checked (which is different each time), or the comment in FLA log file can be read. However, the time when the log file is created maybe too late.
There is really no need to check the FLA version. Just tell me what's the problem and I'll tell you the best solution. Be precise when asking. Tell me what's the exact problem instead of saying something doesn't work like many would.
4.2: 0x40122D - holds a pointer to CStreaming::ms_modelInfoPtrs array (0x0xA9B0C8 by default) 4.3: (0x4C5538+3)- holds a pointer to CStreaming::ms_modelInfoPtrs array (0x0xA9B0C8 by default)
The old one still works in HOODLUM.
The newer address is better, because it valid for compact/HOODLUM EXE and it will never need to be changed anymore.
It's a part of this simple function:
void __cdecl CModelInfo::SetModelInfo(int index, CBaseModelInfo* pModelInfo) { CModelInfo::ms_modelInfoPtrs[index] = pModelInfo; }
The FLA should always be loaded first unless the ASI loader is not well made. For this reason the file is called $fastman92limitAdjuster.asi $ should come before any other letter, when sorted.
When other plugin loads, the FLA is already loaded (if it exists) or not.
Moved discussion with fastman92 here due to addition topics to discuss.
Compatibility will be implemented in future versions.