

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 Framework 4.5.2 and the Visual C++ Redistributable Package for Visual Studio 2013 (圆4) (or loading will fail).ĭownload and install the latest Script Hook V (including the ASI loader).ĭownload Community Script Hook V. Source/core/Main.cpp: The main script entry point NET assembly (.dll) inside the "scripts" folder in your game directory and start scripting! NET and copy the ASI file into your game folder.Ĭreate (or download) a C#/VisualBasic code file (.cs. Loads, compiles and executes the scripts. Source/core/Script.hpp: Class from which all scripts have to inherit, handles the script main loop. Source/core/Native.cpp: Managed to native function call conversion.

Source/core/NativeHashes.hpp: Native function hash enumeration. The remaining files in source/scripting implement the scripting API.

Any help on improving that API is much appreciated.Įither 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. It catches exceptions and gives you all the information to get to the bottom of the problem.
