snobel on 18/3/2017 at 09:20
Quote Posted by R Soul
I had to use ProcessMonitor to find it on my own PC.
For the record, you can find most T3-related stuff through the
Thief 3 Sneaky Upgrade start menu program group. :p
Quote Posted by gnartsch
Obviously the T3Main.exe was not detected as 'thief3' - and thus the code did not even try to load SneakyOptions.ini, but cam_mod.ini instead.
That's my observation too - it expects darkinst.cfg to be present as well. But with newer versions of the SU installed the exe file
is named "Thief3.exe". Edit: Except for that one recent beta with the Steam option.
Another way for NDL to detect T3 is to look for "Thief 3" in the data.sGameVersion string passed to it.
Quote:
Even if it had detected Thief3 it would not work for me, since the code assumes the SneakyOptions.ini within
Code:
Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + "\\Documents\\Thief - Deadly Shadows\\Options\\SneakyOptions.ini"
On my system this isn't true at all. It is actally in
D:\Games\Thief3\Options.
There is a registry key pointing to it.
Yes - the Options folder is inside the SaveGamePath. But if all you need is the FM install path, get it from the initial data.sRootPath value instead.
I'm not sure that's all, though - a small test program which just loads NDL works fine for me as long as those two files mentioned are present. But with the same code in Sneaky.dll there's an exception when calling SelectFM. So it looks like that issue is on my end. Will investigate, but will probably have to wait for the next release. :(
R Soul on 18/3/2017 at 16:47
The reason I didn't just use sGameVersion in the first place was that Thief 1 and 2 both identify as Thief 2 because they are the same exe just with a config variable for T1.
Rather than do a special check for sGameVersion containing "Thief 3" I modified my exe name check to see if the name contains a '3'
R Soul on 18/3/2017 at 19:32
Quote Posted by snobel
Yes - the Options folder is inside the SaveGamePath. But if all you need is the FM install path, get it from the initial data.sRootPath value instead.
Thanks for the suggestion. That unmanaged stuff is a bit of a mystery to me, but I found a simple way to convert the IntPtr to a string, so NDL now uses that instead.
Download link for 1.4.7:
(
http://www.mediafire.com/file/kr4x39v7gbytept/NewDarkLoader1.4.7.zip)
If this improves things I'll update the first post, but it's hard to be sure if Sneaky.dll is getting its own crash.
Clock on 18/3/2017 at 21:42
Quote Posted by R Soul
Thanks for the suggestion. That unmanaged stuff is a bit of a mystery to me, but I found a simple way to convert the IntPtr to a string, so NDL now uses that instead.
Download link for 1.4.7:
(
http://www.mediafire.com/file/kr4x39v7gbytept/NewDarkLoader1.4.7.zip)
If this improves things I'll update the first post, but it's hard to be sure if Sneaky.dll is getting its own crash.
This could be embarrassing, but I just looked at my install of NDL and the version I have been using was 1.4.3 !!!
Now it doesn't look like the upgrades leading to 1.4.7 are critical, so I'm assuming my particular problem isn't due to an old install.
Nevertheless, should I uninstall 1.4.3, or just re-install over the old version.
R Soul on 18/3/2017 at 23:12
Just re-install. Strictly speaking there is no installation. I think 'installation' is when a program isn't just extracted somewhere, but it's registered with Windows as an installed program, and does things like creates registry entries, puts files in other folders (e.g. system32) etc. NewDarkLoader is just extracted into a folder, with a few minor changes to tell the game to use it.
EnYB0La on 19/3/2017 at 03:02
Great! Thanks Robin. I'll take a look at the source code.
Clock on 20/3/2017 at 15:28
Quote Posted by R Soul
Just re-install. Strictly speaking there is no installation. I think 'installation' is when a program isn't just extracted somewhere, but it's registered with Windows as an installed program, and does things like creates registry entries, puts files in other folders (e.g. system32) etc. NewDarkLoader is just extracted into a folder, with a few minor changes to tell the game to use it.
Just a quick note to say I've been preoccupied with other things but will get back to spending time with this issue soon. I'll post the results. Thanks R Soul for your efforts.
snobel on 20/3/2017 at 18:33
Definitely an improvement - now NDL is launched correctly, and FMs can be run. :thumb:
If I click "Play Thief 3" or "Exit" then it crashes: The SelectFM call works fine but on return some stack space before and after the 'data' struct passed to NDL has been overwritten with zeroes. (This includes the function return address, so no wonder it crashes.) When starting an FM this doesn't happen.
Can you check on your side if the data passed to NDL gets handled differently in those cases?
Edit: Looks like 512 bytes of memory at the address pointed to by the sRootPath field gets overwritten with zeroes, and then the contents of the data struct gets written back?
Edit 2: If I make the sRootPath buffer 512 bytes, then the crash goes away. I'll do that if for some reason you can't heed the nMaxRootLen? (Btw. there should be no reason to change that string when exiting or launching the original game?)
R Soul on 20/3/2017 at 20:22
There's no need for NDL to do anything to the sRootPath value. There's no interface option to change it. I might have had the value sent back to the calling program in case I decided to let the user change it, or I might have just copied some code from Thief Fan Mission Manager without knowing what it meant.
Here's a version of 1.4.7 that doesn't change the value:
(
http://www.mediafire.com/file/41256cwwq6oad2b/NewDarkLoader1.4.7_2.zip)
snobel on 20/3/2017 at 21:33
That one works fine. :thumb: