feat(extra-natives-rdr3): Add interior natives
Goal of this PR
Port interior-related natives from FiveM to RDR3, enabling interior debugging and manipulation capabilities in RedM. This includes adding comprehensive interior archetype debugging, room/portal management, and reflection probe support specifically for RDR3.
How is this PR achieving the goal
Unified Codebase:
- Integrated
InteriorExtraNatives.cppfrom FiveM into RDR3 component viacomponent.luato eliminate code duplication - Used conditional compilation (
#ifdef GTA_FIVE/#elif IS_RDR3) to handle platform-specific differences - Implemented clean accessor pattern with
DECLARE_ACCESSORmacro for consistent API across platforms
RDR3-Specific Structures:
- Added
InteriorProxy::Impl1491struct with correct memory offsets for RDR3 - Implemented
CReflectionProbestruct based on game file data analysis - Updated
CMloRoomDefto includereflectionProbesfield for RDR3
Enhanced Debugging:
- Added comprehensive
INTERIOR_DEBUGnative with archetype info, position/rotation, entities extents - Implemented systematic offset testing to verify correct struct layouts
- Added 256-byte memory dumps for both archetype and proxy structures
Ported Natives from FiveM:
Core Interior Natives:
GET_INTERIOR_ROTATIONGET_INTERIOR_ENTITIES_EXTENTS
Room Natives:
GET_INTERIOR_ROOM_COUNTGET_INTERIOR_ROOM_INDEX_BY_HASHGET_INTERIOR_ROOM_NAMEGET_INTERIOR_ROOM_FLAGSET_INTERIOR_ROOM_FLAGGET_INTERIOR_ROOM_EXTENTSSET_INTERIOR_ROOM_EXTENTSGET_INTERIOR_ROOM_TIMECYCLESET_INTERIOR_ROOM_TIMECYCLE
Portal Natives:
GET_INTERIOR_PORTAL_COUNTGET_INTERIOR_PORTAL_CORNER_POSITIONSET_INTERIOR_PORTAL_CORNER_POSITIONGET_INTERIOR_PORTAL_ROOM_FROMSET_INTERIOR_PORTAL_ROOM_FROMGET_INTERIOR_PORTAL_ROOM_TOSET_INTERIOR_PORTAL_ROOM_TOGET_INTERIOR_PORTAL_FLAGSET_INTERIOR_PORTAL_FLAGGET_INTERIOR_PORTAL_ENTITY_COUNTGET_INTERIOR_PORTAL_ENTITY_ARCHETYPEGET_INTERIOR_PORTAL_ENTITY_FLAGSET_INTERIOR_PORTAL_ENTITY_FLAGGET_INTERIOR_PORTAL_ENTITY_POSITIONGET_INTERIOR_PORTAL_ENTITY_ROTATION
New RDR3-Specific Natives:
Reflection Probe Getters:
GET_INTERIOR_ROOM_REFLECTION_PROBE_COUNTGET_INTERIOR_ROOM_REFLECTION_PROBE_EXTENTSGET_INTERIOR_ROOM_REFLECTION_PROBE_CENTER_OFFSETGET_INTERIOR_ROOM_REFLECTION_PROBE_INFLUENCE_EXTENTSGET_INTERIOR_ROOM_REFLECTION_PROBE_ROTATIONGET_INTERIOR_ROOM_REFLECTION_PROBE_PRIORITYGET_INTERIOR_ROOM_REFLECTION_PROBE_GUID
Reflection Probe Setters:
SET_INTERIOR_ROOM_REFLECTION_PROBE_EXTENTSSET_INTERIOR_ROOM_REFLECTION_PROBE_CENTER_OFFSETSET_INTERIOR_ROOM_REFLECTION_PROBE_INFLUENCE_EXTENTSSET_INTERIOR_ROOM_REFLECTION_PROBE_ROTATIONSET_INTERIOR_ROOM_REFLECTION_PROBE_PRIORITY
This PR applies to the following area(s)
- RedM
- Natives
Successfully tested on
Game builds: RDR3 Build 1491
Platforms: Windows
Checklist
- [x] Code compiles and has been tested successfully.
- [x] Code explains itself well and/or is documented.
- [x] My commit message explains what the changes do and what they are for.
- [x] No extra compilation warnings are added by these changes.
Fixes issues
N/A - New feature implementation
Example of usage with dolu_tool
I have added apiset: client on reflection probe native
dolu_tool.zip Edited dolu_tool, with stub to avoid errors with non compatible natives You can start the menu with dolu command
Native definitions look good now.
Please fix the compile errors for V, will review then.
I have fixed the GET_INTERIOR_PROXY macro for V, compiler was not happy with return type sorry :) Both are ok now
Edit: screen in game on fivem