ScriptHookV .NET Core v1.2.1
23590
69
23590
69
ScriptHookV, for .NET Core
Created with the goal to upgrade ScriptHookV .NET to latest .NET Core runtime, while maintaing compatability with previous versions. See the issue and discussion here
Requirements:
An asi loader and Alexander Blade's ScriptHookV
.NET 7 desktop runtime
Installation:
Extract all contents inside the zip archive to your game root.
For developers:
Create a .NET 7 class library project.
[CoreCLR]
Install the nuget package and start writing scripts like you would in SHVDN.
Add <EnableDynamicLoading>true</EnableDynamicLoading> to your csproj, and copy output to a folder in GTAROOT\CoreScripts, e.g. GTAROOT\CoreScripts\MyScripts.
[NativeAOT]
Install this package instead and copy the compiled dll in the native folder inside the output directory (important! File size should be larger than 4 mb) to GTAROOT\CoreScripts folder.
Press End to unload all scripts, Home to reload.
See the project on GitHub for detailed guides and more information.
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
Credits:
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.
Changelogs(might not be up-to-date, see complete ones on GitHub release page):
v1.2.1
- Fix crash and native call not working in Release build
v1.2.0
v1.1.2
v1.1.1
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 strong-typed parameters and comments
Created with the goal to upgrade ScriptHookV .NET to latest .NET Core runtime, while maintaing compatability with previous versions. See the issue and discussion here
Requirements:
An asi loader and Alexander Blade's ScriptHookV
.NET 7 desktop runtime
Installation:
Extract all contents inside the zip archive to your game root.
For developers:
Create a .NET 7 class library project.
[CoreCLR]
Install the nuget package and start writing scripts like you would in SHVDN.
Add <EnableDynamicLoading>true</EnableDynamicLoading> to your csproj, and copy output to a folder in GTAROOT\CoreScripts, e.g. GTAROOT\CoreScripts\MyScripts.
[NativeAOT]
Install this package instead and copy the compiled dll in the native folder inside the output directory (important! File size should be larger than 4 mb) to GTAROOT\CoreScripts folder.
Press End to unload all scripts, Home to reload.
See the project on GitHub for detailed guides and more information.
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
Credits:
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.
Changelogs(might not be up-to-date, see complete ones on GitHub release page):
v1.2.1
- Fix crash and native call not working in Release build
v1.2.0
v1.1.2
v1.1.1
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 strong-typed parameters and comments
Först uppladdad: 21 december 2022
Senast uppdaterad: 12 mars 2023
Senast nedladdad: 2 timmar sedan
23 Kommentarer
More mods by Sardelka:
- Skapare
- .Net
463
17
1.0.0.1
By Sardelka
ScriptHookV, for .NET Core
Created with the goal to upgrade ScriptHookV .NET to latest .NET Core runtime, while maintaing compatability with previous versions. See the issue and discussion here
Requirements:
An asi loader and Alexander Blade's ScriptHookV
.NET 7 desktop runtime
Installation:
Extract all contents inside the zip archive to your game root.
For developers:
Create a .NET 7 class library project.
[CoreCLR]
Install the nuget package and start writing scripts like you would in SHVDN.
Add <EnableDynamicLoading>true</EnableDynamicLoading> to your csproj, and copy output to a folder in GTAROOT\CoreScripts, e.g. GTAROOT\CoreScripts\MyScripts.
[NativeAOT]
Install this package instead and copy the compiled dll in the native folder inside the output directory (important! File size should be larger than 4 mb) to GTAROOT\CoreScripts folder.
Press End to unload all scripts, Home to reload.
See the project on GitHub for detailed guides and more information.
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
Credits:
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.
Changelogs(might not be up-to-date, see complete ones on GitHub release page):
v1.2.1
- Fix crash and native call not working in Release build
v1.2.0
v1.1.2
v1.1.1
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 strong-typed parameters and comments
Created with the goal to upgrade ScriptHookV .NET to latest .NET Core runtime, while maintaing compatability with previous versions. See the issue and discussion here
Requirements:
An asi loader and Alexander Blade's ScriptHookV
.NET 7 desktop runtime
Installation:
Extract all contents inside the zip archive to your game root.
For developers:
Create a .NET 7 class library project.
[CoreCLR]
Install the nuget package and start writing scripts like you would in SHVDN.
Add <EnableDynamicLoading>true</EnableDynamicLoading> to your csproj, and copy output to a folder in GTAROOT\CoreScripts, e.g. GTAROOT\CoreScripts\MyScripts.
[NativeAOT]
Install this package instead and copy the compiled dll in the native folder inside the output directory (important! File size should be larger than 4 mb) to GTAROOT\CoreScripts folder.
Press End to unload all scripts, Home to reload.
See the project on GitHub for detailed guides and more information.
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
Credits:
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.
Changelogs(might not be up-to-date, see complete ones on GitHub release page):
v1.2.1
- Fix crash and native call not working in Release build
v1.2.0
v1.1.2
v1.1.1
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 strong-typed parameters and comments
Först uppladdad: 21 december 2022
Senast uppdaterad: 12 mars 2023
Senast nedladdad: 2 timmar sedan
does not work
Well... doesn't sure, but i have to trie
So with this mod/plugin or wat it is ScriptHookV.Net itself will work?
Awesome stuff!
@Sardelka So is this attempting to make older script mods work, while being up to date on scripthook? Forgive me if its a dumb question im just curious but not sure i totally understand what this is.
Thanks for making scripts .NET7 compatible! Keep up the good work!
@scarredface1017 Sorry, I didn't really understand you. Older scripts built with SHVDN won't work with this. This is an experimental asi plugin for developer seeking a way to write script in .NET 7 with little efforts migrating from SHVDN.
@KimgKomg Thanks!
@Sardelka awesome thanks for the clarification!
Good
for FiveM ?
Seems minor now, but this is the next scripting system high performance mods are gonna start using. Just a matter of time.
Awesome work as usual.
how I can use async code / await Task.Delay(x) to delay/wait a few seconds only in that particular method? Problem is that Script.Wait() does not work how I want, it Waits the entire class, but I want only one specific method to wait, and other methods still being executing code, without freezing the script.
I've tried many methods (using Timers, Stopwatches etc.) but it doesn't achieve the thing I want.
@BOPOHua coroutine is not supported, because the task scheduler may run the task in another thread, while native function can only be called from main thread, you'll have to coordinate the task yourself, e.g. using Script.Wait()
@Sardelka @Hydraxonn forgive my ignorance as a non-developer, but what exactly is the practical advantage for developers? Does it offer more functionality, or performance, or reduced complexity thus making it easier to develop for, or what?
Could you upload some example of how to script using your ScriptHookV .NET Core v1.2.1
Shv,Net has examples, I haven't seen it in yours.
@Sardelka Why my SHVDN sends me a message like this:
[14:11:42] [ERROR] Unable to load ScriptHookVDotNetCore.BaseScript.dll: System.BadImageFormatException: Could not load file or assembly 'file:///G:\Grand Theft Auto V\ScriptHookVDotNetCore.BaseScript.dll' or one of its dependencies. The module was expected to contain an assembly manifest.
File name: 'file:///G:\Grand Theft Auto V\ScriptHookVDotNetCore.BaseScript.dll'
at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
at System.Reflection.RuntimeAssembly.InternalLoadFrom(String assemblyFile, Evidence securityEvidence, Byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm, Boolean forIntrospection, Boolean suppressSecurityChecks, StackCrawlMark& stackMark)
at System.Reflection.Assembly.LoadFrom(String assemblyFile)
at SHVDN.ScriptDomain..ctor(String apiBasePath)
I never received messages like this until the update 3095 came out. Maybe you need to update ScriptHookV .NET Core?
LS Life stopped working after I moved my GTA from one laptop to another, LS life seem to be only thing not working. Please help.
Yo bro can you please make another ScriptHook V .Net but for GTA V version : 1.0.3274 i accsidentally updated it to 1.0.3274 and all my mods don't work can you please make another one but for the newest version please bro im begging you