ScriptHookV .NET Core V1.2

Take your GTA 5 gameplay to the next level with the ScriptHookV .NET Core V1.2 Mod. The ScriptHookV .NET Core V1.2 Grand Theft Auto V Mod is what you need to make your gameplay experience more unique. Follow our detailed guide below to learn how to install and use this mod.


Screenshots

Created with the goal to upgrade ScriptHookV .NET to latest .NET Core runtime, while maintaing compatability with previous versions.

Requirements:

An asi loader and Alexander Blade’s ScriptHookV

Installation:

Extract ScriptHookVDotNetCore.asi to your game root. That’s all.

For developers:

Create a .NET 7 class library project.
Install the nuget package and start writing scripts like you would in SHVDN.
Copy the compiled dll in the native folder inside the output directory (important! File size should be larger than 4 mb) to GTAROOTCoreScripts folder.
Press End to unload all scripts, Home to reload.

Note

This project is a seperate asi plugin that only depends on ScriptHookV. It provides a new way to write scripts in latest .NET version, it does not replace SHVDN, the latter is still needed to run the scripts that’re built against it. Existing scripts will continue to work as long as you have SHVDN installed.

Experimental, might have bugs/crash

V1.2
Added CoreCLR support, you can now run scripts in managed mode. NativeAOT will remain supported but using CoreCLR is recommened due to significantly shorter compile time and being more stabe. Add true to the csproj to ensure all depedencies are copied to output folder.
The primary nuget package now uses CoreCLR by default, to use NativeAOT mode instead, switch to this package
The CoreCLR plugin model supports loading different versions of API assembly at the same time, shipping ScriptHookVDotNetCore.dll with your mod is recommended to ensure future compatability.
To enable assembly context isolation, put script assmeblies and dependecies into a seperate folder instead of directly in CoreScripts, e.g. CoreScriptsMyMod, this way the script(s) can be loaded/unloaded individually and don’t need to worry about dependency version conflict.
The in-game console now supports executing code on-the-fly, providing a convenient way to test the scripting API. Scripts can also register their own commands by marking public methods with GTA.ConsoleCommand attribute.
Added Script.FilePath to retrive the path where the script is loaded from

v1.1.0
– Fixed issue in source generator that causes duplicated script loading under some circumstances (#2)
– Added in-game console, press F6 to open by default, configurable through the ini file. The console is not as powerful as that of SHVDN, only commands registered by scripts can be executed as it’s impossible to dynamically compile and execute code in NativeAOT. To expose a function as command, mark it with GTA.ConsoleCommand attribute, most primitives and class that implements IConvertible can be converted and passed as parameters.
– Fixed an error that causes random crash probaly due to the use of fiber switching and GC by reintrducing dedicated script thread, performance degration is expected. To get better performance, mark the script class with [ScriptAttribute(NoScriptThread = true)] like those in the base script, but beware that Script.Yield() and Script.Wait() will throw an exception running in such mode.
– Save time for memory scanning each time a module is loaded by reusing NativeMemoryStruct
– Added NativeInvoker class, which allows easy and intuitive native function calling with h2-typed parameters and comments

V1.2
Added CoreCLR support, you can now run scripts in managed mode. NativeAOT will remain supported but using CoreCLR is recommened due to significantly shorter compile time and being more stabe. Add true to the csproj to ensure all depedencies are copied to output folder.
The primary nuget package now uses CoreCLR by default, to use NativeAOT mode instead, switch to this package
The CoreCLR plugin model supports loading different versions of API assembly at the same time, shipping ScriptHookVDotNetCore.dll with your mod is recommended to ensure future compatability.
To enable assembly context isolation, put script assmeblies and dependecies into a seperate folder instead of directly in CoreScripts, e.g. CoreScriptsMyMod, this way the script(s) can be loaded/unloaded individually and don’t need to worry about dependency version conflict.
The in-game console now supports executing code on-the-fly, providing a convenient way to test the scripting API. Scripts can also register their own commands by marking public methods with GTA.ConsoleCommand attribute.
Added Script.FilePath to retrive the path where the script is loaded from

v1.1.0
– Fixed issue in source generator that causes duplicated script loading under some circumstances (#2)
– Added in-game console, press F6 to open by default, configurable through the ini file. The console is not as powerful as that of SHVDN, only commands registered by scripts can be executed as it’s impossible to dynamically compile and execute code in NativeAOT. To expose a function as command, mark it with GTA.ConsoleCommand attribute, most primitives and class that implements IConvertible can be converted and passed as parameters.
– Fixed an error that causes random crash probaly due to the use of fiber switching and GC by reintrducing dedicated script thread, performance degration is expected. To get better performance, mark the script class with [ScriptAttribute(NoScriptThread = true)] like those in the base script, but beware that Script.Yield() and Script.Wait() will throw an exception running in such mode.
– Save time for memory scanning each time a module is loaded by reusing NativeMemoryStruct
– Added NativeInvoker class, which allows easy and intuitive native function calling with h2-typed parameters and comments

Credits:

Sardelka
Alexander Blade for his ScriptHookV
crosire and all contributors of ScriptHookV .NET.
Basically all scripting API are from ScriptHookV .NET, with some modifications to adapt to new runtime.

Download mod

File File size
ScriptHookVDotNetCore 8 MB
Share this mod to your friend

Leave a Reply

Your email address will not be published. Required fields are marked *