Community Script Hook V .NET
You may remember the .NET ScriptHook back from GTAIV, it allowed using the easy to learn, but extremly powerful .NET languages to write scripts that can be executed ingame.
About
This ASI plugin for the just released Script Hook V attempts to recreate this experience for GTAV. It's full source code is hosted on Github, development is community-driven and open to everybody, so contributions are warmly welcomed.
Right now it's able to load, compile and run .NET scripts and reload them while the game is running (press the "Insert" key). It also comes with a vast scripting API abstracting away the native function calls (you can still do those manually through "GTA.Native.Function.Call" though). Scripts are executed in a separate AppDomain, any exceptions thrown thus shouldn't affect the game or ScriptHook.
Thanks a lot to Alexander Blade for Script Hook V and HazardX for the inspiration with his GTAIV .NET ScriptHook.
Download Latest Binary Release
Installation
Install both the Microsoft .NET Framework 4.5.2 and the Visual C++ Redistributable Package for Visual Studio 2015 (x64) (or loading will fail).
Download and install the latest Script Hook V (including the ASI loader).
Download Script Hook V .NET and copy the ASI file into your game folder.
Create (or download) a C#/VisualBasic code file (.cs, .vb) or compiled .NET assembly (.dll) inside the "scripts" folder in your game directory and start scripting!
Contributing
Important files:
src/Main.cpp: The main script entry point
src/ScriptDomain.cpp: .NET script manager. Loads, compiles and executes the scripts.
src/Script.hpp: Class from which all scripts have to inherit, handles the script main loop.
src/Native.cpp: Managed to native function call conversion.
src/NativeHashes.hpp: Native function hash enumeration.
The remaining files implement the scripting API. Any help on improving that API is much appreciated.
Documentation
Either use notepad to edit source code scripts directly or use Visual Studio to compile them to assemblies. Going down the Visual Studio way has the advantage of syntax highlighting, code completion and Intellisense (since there is no API documentation yet). Just create a C# or VisualBasic class library project, add a reference to Script Hook V .NET (rename the ASI to DLL) in the project properties and you are ready to go.
If something doesn't work, check the log file ScriptHookVDotNet creates. It catches exceptions and gives you all the information to get to the bottom of the problem.
Visit the wiki for more help on how to get started and write scripts.
gamerzworld, Hanneswasco, PingPang and 35 others like this
社区脚本钩 V.NET。 你可能还记得.NET ScriptHook 回 GTAIV,它允许使用简单易学,但极端强大的.NET 语言来编写脚本可以执行游戏内。 关于只是这 ASI 插件发布脚本钩 V 尝试重新创建此经验为 GTAV。它的全部源代码托管在 Github,发展是社区驱动和开放给大家,这样的贡献,受到热烈欢迎。现在它是能够加载,编译和运行.NET 脚本并重新加载它们运行游戏时 (按"插入"键)。它还配有大量的脚本 API 抽象而本机函数调用 (您仍然可以手动通过"侠盗猎车手。Native.Function.Call"虽然)。在单独的应用程序域中执行的脚本,从而引发的任何异常应该不会影响游戏或 ScriptHook。 非常感谢你到亚历山大刀片式服务器脚本钩 V 和 HazardX 与他 GTAIV.NET ScriptHook 灵感。 下载最新的二进制版本 安装视觉工作室 2015 年 (64) 安装 Microsoft.NET 框架 4.5.2 和 Visual c + + 可再发行组件包 (或加载将失败)。下载并安装最新的脚本钩 V (包括 ASI 装载机)。下载脚本第.NET V 钩和 ASI 文件复制到您的游戏文件夹。创建 (或下载) C# / VisualBasic 代码文件 (.cs、.vb) 或编译的.NET 程序集 (.dll)""的脚本文件夹在您的游戏目录内和启动脚本!ContributingImportant files:src/Main.cpp: The main script entry pointsrc/ScriptDomain.cpp: .NET script manager. Loads, compiles and executes the scripts.src/Script.hpp: Class from which all scripts have to inherit, handles the script main loop.src/Native.cpp: Managed to native function call conversion.src/NativeHashes.hpp: Native function hash enumeration.The remaining files implement the scripting API. Any help on improving that API is much appreciated. DocumentationEither use notepad to edit source code scripts directly or use Visual Studio to compile them to assemblies. Going down the Visual Studio way has the advantage of syntax highlighting, code completion and Intellisense (since there is no API documentation yet). Just create a C# or VisualBasic class library project, add a reference to Script Hook V .NET (rename the ASI to DLL) in the project properties and you are ready to go.If something doesn't work, check the log file ScriptHookVDotNet creates. It catches exceptions and gives you all the information to get to the bottom of the problem. Visit the wiki for more help on how to get started and write scripts.gamerzworld, Hanneswasco, PingPang and 35 others like this
正在翻譯中..
![](//zhcntimg.ilovetranslation.com/pic/loading_3.gif?v=b9814dd30c1d7c59_8619)