Closed ItsQuadrus closed 4 months ago
Hi. The game update 1.0.3258 broke ScriptHookVDotNet, you will need to use the nightly build (not only for GTA Coop) at least until a new stable version is released.
https://github.com/scripthookvdotnet/scripthookvdotnet-nightly/releases
If you are having the crash using the latest nightly build I suggest that you follow this issue https://github.com/scripthookvdotnet/scripthookvdotnet/issues/1454
Yeah I'm using the latest nightly build already. This bug is pretty weird and I don't really get what the Scripthook dotnet maintainer is talking about ("TLS stuff"? how? what?). I hope there will be some sort of update soon because the core issue is still pretty blurry (for me atleast).
For the record, I know what thread-local storage is, but I'm not too familiar with the SDK of Scripthook itself. I also find it pretty weird that people build on top of this library that you can only get from an HTTP-only website.
Have you tried setting AutoLoadScripts=false
in ScriptHookVDotNet.ini?
Then, if it allows you to enter story mode, open the console (F4 by default) and run the StartAllScripts()
command.
Specifies whether the domain of SHVDN should auto load scripts in the scripts folder when the first game session is starting or SHVDN is reloading (recreating a new domain). If you encounter some compatibility issues such as nondeterministic game crashes (due to flaws of multithreading implementation of SHVDN), setting this value to "false" may workaround them. You will need to load scripts via console commands when set to "false", and you can use the console command
StartAllScripts
to start all scripts in the scripts folder. Acceptable value: "true" or "false" (case-insensitive)
I set AutoLoadScripts=false
in the config. I get the exact same results.
The loading of story mode took a while so I alt tabbed out and the second I alt tabbed back in, I saw the game fully loaded but it closed itself immediately.
Tried it again, it just crashes in the loading story mode screen.
Same error. Does ScriptHookVDotNet only load when I'm not focused on the game window?
As you said:
game update 1.0.3258 broke ScriptHookVDotNet
Is downgrading a possibility? I have the game through Steam.
The "infinite loading" with alt-tab workaround is a known issue with the nightly builds, according to https://github.com/scripthookvdotnet/scripthookvdotnet/issues/1454#issuecomment-2211766743
Downgrading the Steam version is possible https://steamcommunity.com/sharedfiles/filedetails/?id=3114772292
Thanks! Looks like Scripthook Dotnet is not quite ready for the latest version yet. Is v1.0.3028.0 a recommended version for modding in general?
Any version up to 3179 will work with the stable release of SHVDN.
https://www.reddit.com/r/Gta5Modding/comments/1dogvuy/howto_guide_on_downgrading_from_3258_to_3179/
I see you've closed the issue @oldnapalm. Could you reopen it because the crash is still happening in 3179 with the stable version of SHVDN? This time it outputs the error in the log file of SHVDN:
[17:41:32] [ERROR] Failed to create console: System.NullReferenceException: Object reference not set to an instance of an object
at System.AppDomain.CreateInstanceFromAndUnwrap (System.String assemblyName, System.String typeName) [0x00000] in <f1249a148cfb4110b9a02139e12e4308>:0
at <Module>.?A0xc1aa4bd5.ScriptHookVDotnet_ManagedInit () [0x00188] in <0f1133baa2e243d2802541074a8dc0b4>:0
I believe I have downgraded correctly both GTA V and SHVDN...? I'm not sure if I'm doing something wrong.
Make sure you are using the stable release https://github.com/scripthookvdotnet/scripthookvdotnet/releases/tag/v3.6.0
Post the full ScriptHookVDotNet.log (the error above doesn't seem to be from GTA Coop).
Also check "properties - details" of GTA5.exe and ScriptHookV.log (INIT: Success, game version is VER_1_0_3179_0) to make sure the game is properly downgraded.
Full logs from earlier:
// GTA V SCRIPT HOOK (build Jun 28 2024, v1.0.3258.0)
// (C) Alexander Blade 2015-2024
[17:37:55] INIT: Started
[17:37:55] INIT: Success, game version is VER_1_0_3179_0
[17:37:55] INIT: Registering script 'ScriptHookVDotNet.asi' (0x0000000180001480)
[17:38:00] INIT: Pool 1 extended
[17:38:00] INIT: Pool 2 extended
[17:38:00] INIT: Pool 3 extended
[17:38:00] INIT: Pool 4 extended
[17:38:05] INIT: GtaThread collection size 189
[17:38:05] INIT: wnd proc 0x00000000FFFF0025
[17:38:05] INIT: IDXGISwapChain 0x00006FFFFC522580 (0x00006FFFFC391E20)
[17:38:05] INIT: IDXGISwapChain set
[17:38:05] INIT: DX init started
[17:38:05] INIT: DX feature level B000
[17:38:05] INIT: DX init succeeded
[17:41:32] CORE: Requesting thread creation
[17:41:32] CORE: Creating threads
[17:41:32] CORE: Started control thread, id 41 active 1
[17:41:32] CORE: Started thread 'ScriptHookVDotNet.asi' (0x0000000180001480), id 42 active 1
[17:41:32] CORE: Launching main() for 'ScriptHookVDotNet.asi' (0x0000000180001480), id 42
[17:41:32] [DEBUG] Loading API from .\ScriptHookVDotNet2.dll ...
[17:41:32] [DEBUG] Loading API from .\ScriptHookVDotNet3.dll ...
[17:41:32] [ERROR] Failed to create console: System.NullReferenceException: Object reference not set to an instance of an object
at System.AppDomain.CreateInstanceFromAndUnwrap (System.String assemblyName, System.String typeName) [0x00000] in <f1249a148cfb4110b9a02139e12e4308>:0
at <Module>.?A0xc1aa4bd5.ScriptHookVDotnet_ManagedInit () [0x00188] in <0f1133baa2e243d2802541074a8dc0b4>:0
When the game starts, the bottom right-hand corner does show 3179.
SHVDN is crashing before loading scripts, apparently this error is caused by missing requirement (.NET Framework 4.8)
https://github.com/scripthookvdotnet/scripthookvdotnet?tab=readme-ov-file#requirements
This is not really releated but I get this error now when I launch the game (with .NET Framework 4.8 installed) https://learn.microsoft.com/en-us/dotnet/framework/install/application-not-started?version=(null)&processName=rundll32.exe&platform=0009&osver=3&isServer=0&shimver=4.0.30319.0
I'm going to try to fix this.
Done. I had some issues but now it works really well. I'll let you know if I have any more issues with the script.
Thanks for all the help!
Hello. Thanks for maintaining this fork. The game crashes when the player enters story mode from the main menu (which AFAIK is the only way to be able to join multiplayer servers) No log is ever created in
%localappdata%\cgmp\gtacoop
.Script hook (crash occurs at 15:19:26):
Script hook dotnet:
Trace:
Everything is latest: GTA V, Script hook, Script hook dotnet, GTACoop
Any help is appreciated!