Skip to content
View in the app

A better way to browse. Learn more.

RDR2Mods.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Can we edit .gfx from an .rpf at this point? (hitmarker mod)

You're viewing a summary of the most helpful posts in this topic — about 12 minutes of reading instead of 73 minutes for all 26 posts.

Featured Replies

Hey everyone,

 

I'm very new to modding, so forgive me if I'm going about this in a hamfisted way.

 

Taking inspiration from a similar GTA5 mod, I was able to locate the sprite images for the X-hitmarker using OpenIV and a Flash decompiler. In the GTA5 mod, the author simply replaced the hitmarker sprite with a transparent image.

 

However, unlike GTA5's OpenIV support, RDR2 doesn't have edit mode, so even though I'm able to extract the .gfx file and edit it, I have no means of reinserting it into the .rpf.

 

Is there any way to accomplish this? Worst case, if I copied every file contained within the .rpf and replaced the original .gfx with the edited file, would I be able to recompile all of them back into an .rpf that RDR2 would recognize as legitimate?

  • Replies 25
  • Views 6.6k
  • Created
  • Last Reply

Top Posters In This Topic

Most Popular Posts

  • I've released it here, let me know if it works:  

  • Glad to hear you enjoy it!    That sounds a lot like memory scanning for an unknown initial value, then looking for a decreased value etc. This process will (usually) allow you to find the a

  • HughJanus
    HughJanus

    @OnyxDog78 I am using alexander blade's scripthook (with the helper libraries) and am using the DRAW_TEXT function to draw text on the screen. Pretty simple, if you want to try it.    

Glad to hear you enjoy it! 

 

That sounds a lot like memory scanning for an unknown initial value, then looking for a decreased value etc. This process will (usually) allow you to find the address in memory that stores the ammo count. From there on, by setting a breakpoint on it, you can find the code that modifies it and for instance NOP it so that it no longer does anything. Cheat Engine is a great tool for that and all you really need initially. A more powerful debugger would be x64dbg (which is free). For static analysis you could use Ghidra (free) or IDA Pro (very expensive), but I'd recommend starting out with just Cheat Engine initially.

 

Once you know what to patch, you could just write a small C++ library that scans the game's memory for the location to patch and then applies the patch. I use Visual Studio for that. Game archives vary wildly and you usually have to rely on a third party tool (like OpenIV) or try to document it yourself, usually by using a Hex Editor and studying the code to parse the files. That's a different story, though. For the hitmarker no files are touched, but only game code (compiled code) is modified to skip a certain portion used to render the hitmarker (essentially removing an if-block).

@OnyxDog78 I am using alexander blade's scripthook (with the helper libraries) and am using the DRAW_TEXT function to draw text on the screen. Pretty simple, if you want to try it.

 

 

  • Author
On 6/18/2020 at 6:33 PM, LMS said:

I'd recommend starting out with just Cheat Engine initially.

 

Just finished the tutorials & successfully added unlimited lives to Space Cadet Pinball 3D; thanks for the recommendations, that's definitely kickstarted a new hobby!

 

edit. and froze player health in Enter the Gungeon; I'm giddy like a kid

Edited by theharber

@OnyxDog78 Alexander Blade's ScriptHook includes helper libraries in which he already wrote wrapper functions for the natves, so you dont have to use hashes, but can write natives in clear text (which helps a lot, I think).

Outside of your main logic you would need stuff like this:

void DrawText(float x, float y, char* str) //method you will use to draw text on the screen
{
	UI::DRAW_TEXT(GAMEPLAY::CREATE_STRING(10, "LITERAL_STRING", str), x, y); //wrapper for 0xD79334A4BB99BAD1
}

char c[50]; //char array for storing your text
int timer; //int for storing your game timer
string text; //the text to be displayed in front of your timer variable

 

And in you main method, you can use it like:

timer = GAMEPLAY::GET_GAME_TIMER() //wrapper for 0x4F67E8ECA7D3F667
text = "Gameplay Timer: " + std::to_string(timer); //adding the timer variable to your string
strcpy(c, text.c_str()); //copying the string to the char array
DrawText(0.5, 0.5, c); //displaying the char array

 

The thing with the char array is a bit uncomfortable, but since you cant pass a string to the DRAW_TEXT method, thats the way I have been using it.

The alternative would be include the "copying a string into a char array" portion into the DRAW_TEXT method, but then you would have to have a fixed char array size, which I prefer to specify outside of the method itself (in case I need more space).

 

Bear in mind that I am a noob and others might be able to give better advice 😛

Edited by HughJanus

On 6/19/2020 at 8:57 PM, theharber said:

 

Just finished the tutorials & successfully added unlimited lives to Space Cadet Pinball 3D; thanks for the recommendations, that's definitely kickstarted a new hobby!

 

edit. and froze player health in Enter the Gungeon; I'm giddy like a kid

 

Glad to hear it's so much fun!

 

6 hours ago, OnyxDog78 said:

@HughJanus Thank you! I found the files you were talking about. I got the timers to display but they weren't the mission goal timers i thought they might be. I got TIMERA and TIMERB both to display as well, and then used SET_TIMERA & SET_TIMERB to set them to 0 to see if it affected the timed mission goals, but it didn't 😕

 

Thank you for your help though. 

 

It probably is stored in a local variable in the script that just stores the starting time.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.