Red dead redemption 2 script hook

4 May 2022 UPDATE:
For anyone still following this thread, Alexander Blade's Script Hook RDR2 just received an update! It can be found here: http://www.dev-c.com/rdr2/scripthookrdr2/

And for those who use it, Lenny's Mod Loader and the RDR2 Asi Loader have also received updates recently. Links below:

https://www.rdr2mods.com/downloads/rdr2/tools/76-lennys-mod-loader-rdr/
https://www.rdr2mods.com/downloads/rdr2/tools/9-rdr-2-asi-loader/

I'll do some further testing, but so far it appears all my mods are working again. I hope yours will too!

----------------------------------------------

27 April 2022 UPDATE:
For those stumbling upon this post and missing the date this was originally posted on, the fix below will not work for the current issues with Script Hook caused by today's game patch. I'll make sure to include the fix for it here whenever modders upload one for those who are interested!

----------------------------------------------

Below is the OLD fix mentioned above, this is from 2021. Ignore this.

Today's patch stopped AB's Script Hook from working correctly, either failing to do anything at all, or causing the game to crash etc. There's a quick and easy fix for this which appears to be working well.

Script Hook RDR2 (found here: http://www.dev-c.com/rdr2/scripthookrdr2/ ) normally requires 2 files to work:

ScriptHookRDR2.dll
dinput8.dll

You need to add ''ScriptHookRDR2.dll'' to the game's directory as normal, but ''dinput8.dll'' needs to be replaced with the ''version.dll'' file found in the ''rdr2_asi_loader_02.zip'' download here: https://www.rdr2mods.com/downloads/rdr2/tools/9-rdr-2-asi-loader/

That's all there is to it. This should solve most, if not all issues with mods previously caused by Script Hook specifically.

Full credit for this fix goes to the actual modder(s). I merely came across it on Discord, found out it worked and wanted to share it here for more players to see.

If you still wanna play with mods, you might consider downgrade de exe file. I could post a link, but not sure if it isn't against the rules. Anyway, you can try to search on google for the 1436.28 version of the exe file. From what I know works both on epic and steam versions.

When the the new lenny mod loader and/or scripthook are updated you just change it back.

I don't recommend to downgrade versions if you play online.

I recently felt like playing the game again so i redownloaded it a few days ago and now it gives me this error message.

It says that my current version is not supported and i looked it up and it says i have v. 1.0.1491.16

What now? Do i just wait? I downloaded this on thursday and it's been like this since and im confused.

Red dead redemption 2 script hook

Red dead redemption 2 script hook

Script Hook RDR 2 is the library that allows you to use RDR 2 script native functions in custom *.asi plugins. By Alexander Blade.

Note that it doesn’t work in RDR Online, script hook closes RDR 2 when the player goes in multiplayer, see details in the readme.

This distrib also includes the latest Asi Loader and Native Trainer.

Installation

Copy ScriptHookRDR2.dll to the game’s main folder, i.e. where RDR2.exe is located.
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).
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 ScriptHookRDR2.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. ScriptHookRDR2.dll).

Credits:

Alexander Blade

  • Red dead redemption 2 script hook

    Red dead redemption 2 script hook
  • Red dead redemption 2 script hook

    Red dead redemption 2 script hook
  • Red dead redemption 2 script hook

    Red dead redemption 2 script hook
  • Red dead redemption 2 script hook

    Red dead redemption 2 script hook
  • Red dead redemption 2 script hook

    Red dead redemption 2 script hook
  • Red dead redemption 2 script hook

    Red dead redemption 2 script hook
  • Red dead redemption 2 script hook

    Red dead redemption 2 script hook
  • Red dead redemption 2 script hook

    Red dead redemption 2 script hook

File information

Last updated

25 November 2022 4:13PM

Original upload

28 April 2022 11:30PM

Virus scan

  • Description
  • Files 1
  • Images 2
  • Videos 0
  • Posts 274
  • Bugs 9
  • Logs
  • Stats

About this mod

A working ScriptHook for the latest game patch. Build 1491.16

Requirements Permissions and credits Changelogs

A working ScriptHook for the latest game patch. Build 1491.16

Developers:

To use the below listed exports, link the provided library in your project!

New Features:
1. Added native: DRAW_LINE
How to use:
void DRAW_LINE(float fromX, float fromY, float fromZ, float toX, float toY, float toZ, int r, int g, int b, int a) { invoke<void>(0xec2ab68b,fromX,fromY, fromZ, toX, toY, toZ, r, g, b, a); } // 0xec2ab68b
Add this line to your natives.h file.

2. Added native: SET_TEXT_FONT
How to use:
void SET_TEXT_FONT(int fontType) { invoke<void>(0x3EDE2F10, fontType); } // 0x3EDE2F10
Add this line to your natives.h file.

3. Added native: SET_TEXT_JUSTIFICATION
How to use:
/* 0=Center,1=Left,2=Right */
void SET_TEXT_JUSTIFICATION(int justifyType) { invoke<void>(0x1B929974, justifyType); } // 0x1B929974
Add this line to your natives.h file.

4. Added export: getStaticPtr (called Locals in the decompiled scripts)

Add this line to your main.h file:
DLL_IMPORT uint64_t* getStaticPtr(const char* scriptName, int staticIndex);

Usage:
uint64_t* static = getStaticPtr("script_name" 12345);
LOG(*static)// to read
*static = 0xCOFFEEBABE// to write


5. Added export: switchLabel (Switch text labels from the game with your own, this will allow you to provide your custom text in input boxes)
Add this line to your main.h file:
DLL_IMPORT void switchLabel(const char* oldLabel, const char* newLabel);

6. Added export: getCommandFromHash (Returns a pointer to the command of the provided hash)
Add this line to your main.h file:
DLL_IMPORT void* getCommandFromHash(uint64_t hash);

Unload/Load Mods Keybind: ENDEnjoy!