Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(redm/script): Add fxmanifest metadata for overriding train track and trolley cable files #2430

Closed
wants to merge 1 commit into from

Conversation

Sage-of-Mirrors
Copy link
Contributor

Goal of this PR

Allow a resource developer to replace the default traintracks.xml and trolleyCableTracks.xml files, thus allowing for RedM servers to have proper custom train tracks. And trolley cables, if so desired.

How is this PR achieving the goal

The fxmanifest metadata statements replace_traintrack_file <path> and replace_trolley_cable_file <path> have been added. When present, they store their paths to global variables in a patch, located at gta-core-rdr3/src/PatchTrainTrackFileOverride.cpp. The patch intercepts any calls to LoadTrackXML(), and if either of the override paths are valid, it will pass them into the track loading native rather than the default filepaths that were passed in.

This PR applies to the following area(s)

RedM, Server, ScRT: Lua

Successfully tested on

Game builds: b1311

Platforms: Windows

Checklist

  • Code compiles and has been tested successfully.
  • Code explains itself well and/or is documented.
  • My commit message explains what the changes do and what they are for.
  • No extra compilation warnings are added by these changes.

Fixes issues

resolves #2424

@github-actions github-actions bot added invalid Requires changes before it's considered valid and can be (re)triaged RedM Issues/PRs related to RedM ScRT: Lua Issues/PRs related to the Lua scripting runtime triage Needs a preliminary assessment to determine the urgency and required action and removed invalid Requires changes before it's considered valid and can be (re)triaged labels Mar 20, 2024
@Sage-of-Mirrors
Copy link
Contributor Author

This resource can be used on a server to test overriding traintracks.xml: tracktest.zip. It adds rough track nodes corresponding to the Great Plains and Mexico from RDR1. A resource that allows the player to spawn a train and manipulate junctions is required to see more than the trace() statements in the log.

@github-actions github-actions bot added invalid Requires changes before it's considered valid and can be (re)triaged and removed triage Needs a preliminary assessment to determine the urgency and required action labels Mar 20, 2024
@Sage-of-Mirrors
Copy link
Contributor Author

Closing because I fucked up the git history.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid Requires changes before it's considered valid and can be (re)triaged RedM Issues/PRs related to RedM ScRT: Lua Issues/PRs related to the Lua scripting runtime
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[RedM] Cannot override base-game railway data
1 participant