What does the American dream mean today? For Niko Bellic fresh off the boat from Europe, it is the hope he can escape from his past. For his cousin, Roman, it is the vision that together they can find fortune in Liberty City, gateway to the land of opportunity. As they slip into debt and get dragged into a criminal underworld by a series of shysters, thieves and sociopaths, they discover that the reality is very different from the dream in a city that worships money and status, and is heaven for those who have them and a living nightmare for those who don't.
This ASI plugin allows you to run ingame GTAIV scripts written in any .Net language. Those languages are easy to learn and use, while they are still extremely powerful. One noteable aspect of this hook is, that the scripting functions are organized in a .Net-typical class structure, which makes finding functions intuitive and easy. And since you are able to develop scripts with Visual Studio, you'll get all benefits like code highlighting and IntelliSense. You need an Asi Loader program (either xliveless, Yaasil or Asi Loader).
Some may also be interested in the full C++/CLI sourcecode of the GTAIV .Net Script Hook.
Max. supported game versions:
GTA IV 220.127.116.11
This ASI plugin allows you to run ingame GTAIV scripts written in any .Net language. Those languages are easy to learn and use, while they are still extremely powerful.
One noteable aspect of this hook is, that the scripting functions are organized in a .Net-typical class structure, which makes finding functions intuitive and easy.
And since you are able to develop scripts with Visual Studio, you'll get all benefits like code highlighting and IntelliSense.
You need an AsiLoader to use this plugin in GTAIV. See the Requirements section below for more info.
Special thanks to Aru for his help and for his C++ Script Hook. This plugin wouldn't be possible without it.
This software is provided 'as-is', without any explicit or implied warranty. The author(s) cannot be held accountable for any damage that might be caused by this software or any of it's components.
Required to run this plugin are:
- A valid installation of GTA IV or EFLC patched to any of the following versions:
GTA IV: version 18.104.22.168 up to version 22.214.171.124
EFLC: version 126.96.36.199 up to version 188.8.131.52
- Microsoft .Net Framework 4 and the Microsoft Visual C++ 2010 Redistributable Package (x86) installed on your machine
- Any AsiLoader installed for GTA IV (either xliveless, Yaasil or Asi Loader).
I included download links below. If the application crashes or behaves in an unwanted manner then download and install those updates/tools.
- Microsoft .Net Framework 4 - DOWNLOAD
- Microsoft Visual C++ 2010 Redistributable Package (x86) - DOWNLOAD (Make sure to install the linked x86 version, even on x64 systems!)
If you get a "MSVCR100.dll not found" error:
Try installing the Microsoft Visual C++ 2010 Redistributable Package! Make sure to install the linked x86 version, even on x64 systems!
If you get crashes and are using GTA IV version 184.108.40.206 or older, try to install this older version of the C++ ScriptHook, which works fine with the current .Net ScriptHook.
Extract the complete archive into your GTAIV installation folder.
Extract the complete archive into your GTAIV installation folder.
Make sure that the ScriptHookDotNet.asi file is in your main GTAIV folder, or any other folder that is supported by your AsiLoader.
The ScriptHook.dll (which is aru's C++ ScriptHook) should always be located in your main GTAIV folder, otherwise the .Net ScriptHook will be unable to find it! (thanks to Zach for pointing this out)
There may already be a ScriptHook.dll present. This is fine, because many mods use this file. In this case, check which one of the two files is newer and keep that.
Only the ScriptHookDotNet.asi and ScriptHook.dll files are required to run scripts.
All files in the "scripts\for Developers" subfolder are only required if you want to write own scripts. Look at the "Writing new scripts" section for more infos on this.
Scripts for the DotNet Script Hook have to be copied to the "scripts" subfolder of your GTAIV installation directory. You may have to create the folder if it is not there.
DotNet scripts may have one of the following file formats:
*.vb - for plain VisualBasic.Net scripts
*.cs - for plain C# scripts
*.net - for compiled scripts in any .Net language
*.net.dll - for compiled scripts in any .Net language
Writing new scripts
You should extract the "for Coders" folder from this archive to any folder you want. It contains example projects for you to start with. You could just edit the vb or cs script files with Notepad and copy the resulting script to the "scripts" subfolder of your GTAIV directory.
You can use the Class Reference Documentation to find out which classes or methods are available.
However, coding will be MUCH more comfortable and easy if you use Visual Studio 2010 to edit your scripts. Look below for a free download. Open the SLN Project files with Visual Studio to get ready-to-compile script examples. Use those examples as a base for your own scripts.
If you want to create a completely new VS project, make sure that you add a reference to the included ScriptHookDotNet.dll.
This file is ONLY required for coding. On runtime, your scripts will automatically use the ScriptHookDotNet.asi that is located in your GTAIV directory. Thus you don't need to bundle your script with one of those files when you want to release it. If you don't want to release the plain vb or cs script files, you can use the compiled DLL. You just have to make sure that the file ends to ".net.dll" or just ".net"!
If a script does not run, take a look at the logfile ScriptHookDotNet.log . It will write down all errors that occur during compiling or runtime.
Do NOT include ScriptHookDotNet.asi or ScriptHookDotNet.dll or ScriptHook.dll in the release of your script! Link to this thread instead!
- Free Visual Studio Express 2010 downloads (registration is free too)
Just delete the ScriptHookDotNet.asi from your GTAIV folder.
Scripts contained in the "scripts" subfolder can remain there if you wish to keep them. They wont run or interfere with the game when ScriptHookDotNet.asi is deleted.
Version 220.127.116.11 BETA:
- Fixed Blip.Delete always causing an exception.
- Added Vehicle.LightsOn property to determine whether the front lights are turned on. (by LMS)
- Changed Vehicle.FixTire to also restore the correct tire model. (by LMS)
- Some more NonExistingObjectException checks.
Not all script functions have been tested. Some of them may not work as desired or may even lead to crashes.
Infos for Webmasters
Feel free to add this plugin as a download to your site as long as you give proper credit. However, as long as it is technically possible, please DON'T upload it to other webservers. Best way would be to link to this thread or at least direct-link my download from your page to assure that people always get the latest version!