Halen84 / ScriptHookRDR2DotNet-V2

An ASI plugin for Red Dead Redemption 2, which allows anyone to create scripts using any .NET language.
zlib License
54 stars 10 forks source link

Script not loaded #7

Closed Roms1383 closed 1 year ago

Roms1383 commented 1 year ago

Hi and thanks for this tool, looks amazing !

I've tried installing as specified on readme like:

I launched the game, got the console displayed with F8 as per .ini file, but it seems the .asi I built from custom project does not get loaded at all.

I tried running ListScripts() in the console:

console

My guess here is that I probably messed up some configuration settings, maybe (I'm no stranger to programming but I'm a newcomer to C#).

Any help would be very much appreciated ! :)

Roms1383 commented 1 year ago

Forgot to mention: project is Class Library (.NET Framework 4.8) and I tried with .asi built as both Debug/x64 or Release/x64.

Roms1383 commented 1 year ago

Also, the logs I could find :

ScriptHookRDR2.log

// RDR 2 SCRIPT HOOK (build Feb  9 2023, v1.0.1491.17)
//     (C) Alexander Blade 2019-2023
[16:00:45] INIT: Started
[16:00:46] INIT: Success, game version is VER_AUTO
[16:00:46] INIT: Registering script 'ScriptHookRDRDotNet.asi' (0x00007FFC8C3D14B0)
[16:01:24] INIT: Pool 1 extended
[16:01:24] INIT: Pool 2 extended
[16:01:24] INIT: Pool 3 extended
[16:01:24] INIT: Pool 4 extended
[16:04:26] CORE: Creating threads
[16:04:26] CORE: Created 2 threads (including control)
[16:04:26] CORE: Waiting to launch 'ScriptHookRDRDotNet.asi' (0x00007FFC8C3D14B0), id 31
[16:05:01] CORE: Launching main() for 'ScriptHookRDRDotNet.asi' (0x00007FFC8C3D14B0), id 31

and ScriptHookRDRDotNet.log

[16:05:21] [DEBUG] Loading API from C:\Program Files (x86)\Steam\steamapps\common\Red Dead Redemption 2\ScriptHookRDRNetAPI.dll ...
[16:05:21] [DEBUG] Resolve handler removed
[16:05:21] [DEBUG] Loading scripts from C:\Program Files (x86)\Steam\steamapps\common\Red Dead Redemption 2\scripts\ ...
[16:05:28] [DEBUG] compatibleApi resolved ScriptHookRDRNetAPI, Version=2.2.0.0, Culture=neutral, PublicKeyToken=null
Halen84 commented 1 year ago

Do not rename the compiled .dll file, its supposed to be a .dll. .asi files are programmed in C++ and are loaded by AB's scripthook. All of the other steps you did seem fine though.

Roms1383 commented 1 year ago

Indeed it was that dead simple, now it works just like it's supposed to ! Sorry I got mislead from a (probably outdated / unrelated) comment on RDR forums, thanks a lot for helping out :)