Download Latest Version Of Script Hook V

0 views
Skip to first unread message

Marthe Bernskoetter

unread,
Aug 4, 2024, 4:14:52 PM8/4/24
to consmeableasi
Youcan now run scripts in the main thread rather than a decicated thread by setting NoScriptThread of ScriptAttributes to true. Note that Script.Yield() and Script.Wait() are not available and instead throw an exception when NoScriptThread is set to true (even via some scripting API such as World.CreateVehicle() without having the model loaded in advance).

NativeHashes enums are updated (v3 API only) as some leaked source revealed all the exact native function names that exist in 1.0.2699. Compiled scripts do not take effect since enums are embedded as constants when directly used. See f2edb0e for the changes.


Despite the minor version difference, this version is basically the same as v3.2.0 but with one bug fix, additional enum values for WeaponComponentHash and WeaponAttachmentPoint, and additional properties for missing enum values of WeaponAttachmentPoint. v3.3.0 is skipped due to versioning issues.


Added VehicleType enum, Vehicle.Type, Vehicle.IsRegularAutomobile, Vehicle.IsAmphibiousAutomobile, Vehicle.IsAutomobile, Vehicle.IsRegularQuadBike, Vehicle.IsAmphibiousQuadBike, Vehicle.IsQuadBike, Vehicle.IsAmphibious, Vehicle.IsTrailer, Vehicle.IsPlane, Vehicle.IsHelicopter, Vehicle.IsBlimp, Vehicle.IsMotorcycle, Vehicle.IsBicycle, Vehicle.IsBike, Vehicle.IsBoat, Vehicle.IsTrain, and Vehicle.IsSubmarine


Added VehicleWheelBoneId enum, VehicleWheel.MemoryAddress, VehicleWheel.BoneId, VehicleWheel.LastContactPosition, VehicleWheel.SteeringLimitMultiplier, VehicleWheel.Temperature, VehicleWheel.IsTouchingSurface, VehicleWheel.IsTireOnFire, VehicleWheel.IsSteeringWheel, VehicleWheel.IsDrivingWheel, VehicleWheel.IsPunctured, VehicleWheel.IsBursted, VehicleWheel.Health, VehicleWheel.TireHealth, VehicleWheel.Fix() with a bool overload, VehicleWheel.Puncture(), and VehicleWheel.Burst()


Added new or missing peds, vehicles, weapons, weapon components, radio stations, blip sprites, explosion types, checkpoint icon type, radio station, and vehicle color to PedHash, VehicleHash, WeaponHash, WeaponComponentHash, RadioStation, BlipSprite, ExplosionType, CheckpointIcon, RadioStation, and VehicleColor enums


Fixed throwing NullReferenceException when WeaponCompoent.Active, WeaponCompoent.DisplayName, WeaponCompoent.LocalizedName is accessed via the instance for the invalid component. Now returns false or the empty string if accessed via the instance for the invalid component.


Script Hook V is the library that allows to use GTA V script native functions in custom *.asi plugins. Note that it doesn't work in GTA Online, script hook closes GTA V when player goes in multiplayer, see details in the readme.


Installation

1. Copy ScriptHookV.dll to the game's main folder, i.e. where GTA5.exe is located.

2. In order to load asi plugins you need to have asi loader installed, you can download it separately or use the latest version that comes with this distrib (dinput8.dll). You must delete previous asi loader version (dsound.dll) if you have one installed.

3. This distrib also includes a sample asi plugin - native trainer, if you need a trainer then copy NativeTrainer.asi too.


Concept

The main concept is that compiled script plugins depend only on ScriptHookV.dll, so when the game updates the only thing that user must do in order to make scripts working again is to update script hook runtime (i.e. ScriptHookV.dll).


Seriously which should i use? WhyEm's Assortment ( ) first tells me to use RDR 2 Asi Loader ( -rdr-2-asi-loader/) then it tells me to use SkriptHook ( -c.com/rdr2/scripthookrdr2) . The Red Dead Offline mod ( -red-dead-offline/page/7/) tells me to use Lenny's Simple Trainer or Outfit Changer which looks like it also contains scripthooks. This is really confusing. Couls someone pleas help me sort this out?


Ok...so which one should we use??

Don't really need the load order info, or data on merging mods. Thanks for taking the time to post that, tho.



Just need to know the right Scripthook. After a R* update, my game is crashing at launch aand I'm wondering if a Scripthook issue is at fault


We'd like to make a few basic hook scripts that we can all share -- for things like pre-formatting commit messages. Git has hook scripts for that that are normally stored under /.git/hooks/. However, those scripts are not propagated when people do a clone and they are not version controlled.


Theoretically, you could create a hooks directory (or whatever name you prefer) in your project directory with all the scripts, and then symlink them in .git/hooks. Of course, each person who cloned the repo would have to set up these symlinks (although you could get really fancy and have a deploy script that the cloner could run to set them up semi-automatically).


and redirects Git to look for hooks inside the .\hooks (or whatever name you choose) directory. This directory should mimic .\.git\hooks in terms of file name (minus the .sample) and structure.


Most of the modern programming languages, or rather their build tools, support plugins to manage Git hooks. That means all you need to do is configure your package.json, pom.xml, etc. files, and anyone in your team will have no option but to comply unless they change the build file.


We are using Visual Studio solutions (and thus projects) which have pre and post build events. I'm adding an additional project named 'GitHookDeployer'. The project self modifies a file in the post build event. That file is set to copy to the build directory. Thus the project is build every time and is never skipped. In the build event, it also makes sure that all git hooks are in place.


Yes, there are several tools to help you manage Git hooks. Each of them is tailored to tackle the problem from a different perspective, and you might need to understand all of them to get the one that is best for you or your team. GitHooks.com offers a lot of reading about hooking, and several tools available today.


One of those tools, written by me and offered for free as an open-source project, is called hooks4git. It is written in Python (because I like it), but the idea is to handle all items listed above in a single configuration file called .hooks4git.ini, which lives inside your repository and can call any script you want to call, in any language.


But this kind of deep linking does not seem to support Microsoft Word? When I link to a comment and/or a section of body text in MS Word, the Hook link only opens the MS Word document, but does no go to the specific section of the document.


These are the scripts I use, but they could doubtless be improved (in particularly using a random number as a unique id is obviously bad, but for purely personal use the risk of collisions is too low to justify the time investment in writing something better).


One disadvantage of deep-linking is that currently you lose the context of what has been hooked to other parts of the document (or to the document as a whole). This is particularly severe here, because the granularity of the deep-link is a particular text range (not even a page, as with the PDF scripts). It might be useful if the interface could show both hooks to the link itself and other hooks with the same base URL?


When we introduced deep linking, we had a big debate internally about whether to show all the links and pulled back from it. I think giving users the choice with a command is probably the best way to go.


@lawyerboy : I tried to follow the instructions a few times, but in vain. But tonight I tried again and, wauw, it worked. I can now deep link to EVERY sentence in a Word Document. FANTASTIC! - THANK YOU SO MUCH! Gonna be a huge win in finishing my PhD!!


I have, however, one problem with MS Word Deep Link from two critical applications I use all the time. You see, when I link to a Word document with your code (Open Item - Get Name - Get Adress) it works perfectly fine when linking to another Word Document or linking from Apple Notes or Dynalist. When you click on the MS Word Hook link, the document pops right up at the exact line.


One minor change is the script checks if there is any text selection. If no text is selected, Hookmark will just create a regular link. If people prefer getting a deep linking regardless of text selection, I can take out this change.


Common use cases for Git hooks include encouraging a commit policy, altering the project environment depending on the state of the repository, and implementing continuous integration workflows. But, since scripts are infinitely customizable, you can use Git hooks to automate or optimize virtually any aspect of your development workflow.


The built-in scripts are mostly shell and PERL scripts, but you can use any scripting language you like as long as it can be run as an executable. The shebang line (#!/bin/sh) in each script defines how your file should be interpreted. So, to use a different language, all you have to do is change it to the path of your interpreter.


For instance, we can write an executable Python script in the prepare-commit-msg file instead of using shell commands. The following hook will do the same thing as the shell script in the previous section.


Notice how the first line changed to point to the Python interpreter. And, instead of using $1 to access the first argument passed to the script, we used sys.argv[1] (again, more on this in a moment).


Hooks are local to any given Git repository, and they are not copied over to the new repository when you run git clone. And, since hooks are local, they can be altered by anybody with access to the repository.


As an alternative, Git also provides a Template Directory mechanism that makes it easier to install hooks automatically. All of the files and directories contained in this template directory are copied into the .git directory every time you use git init or git clone.


This is just one example of the pre-commit hook. It happens to use existing Git commands to run tests on the changes introduced by the proposed commit, but you can do anything you want in pre-commit including executing other scripts, running a 3rd-party test suite, or checking code style with Lint.

3a8082e126
Reply all
Reply to author
Forward
0 new messages