-
Notifications
You must be signed in to change notification settings - Fork 2k
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(extra-natives/five): GET_VEHICLE_GEAR_RATIO and SET_VEHICLE_GEAR_RATIO #2409
Conversation
Hey Ricky, Thank you for the PR, seems like you got it working, good job! Some prechecks: your commit titles don't follow our format, see https://github.com/citizenfx/fivem/actions/runs/8118915693/job/22194013573?pr=2409#step:4:83 could you resolve these? When you are at it can you also squash the commits? Guide: https://docs.fivem.net/docs/contributing/git/squash-guide/ |
78e3c44
to
9a901eb
Compare
9a901eb
to
a511410
Compare
should be all good now just need to let the thing run |
Should we handle or document MODIFY_VEHICLE_TOP_SPEED, SET_VEHICLE_MOD, REMOVE_VEHICLE_MOD (VMT_GEARBOX) potentially recalculating this gear ratio array and overwriting changes made by |
possibly might want to add to the corresponding decals that they might interfere with each other |
71829b8
to
56a41d6
Compare
is there anything else i need to change about this? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few more small changes and it's good to go!
…AR_RATIO and SET_VEHICLE_GEAR_RATIO
56a41d6
to
a4b03ed
Compare
@Disquse there you go all done lmk if you notice anything else that needs changing |
any updates for changes needed? |
i assume this is ready to merge then? |
Tested this code in-game, works great. Thanks for your contribution, this is a nice feature to have. Apologies for the very slow review process, I was busy with a lot of other stuff. I'm attaching a debug script I made to test this feature, just in case anyone is interested in testing it out before there are any proper resources: https://pastebin.com/yDYj0sqA |
Goal of this PR
These new natives will allow developers to create scripts to create custom gear ratios for vehicles.
How is this PR achieving the goal
I added the memory editing stuff to VehicleExtraNatives.cpp to allow me to create the 2 new natives.
The natives
float GetVehicleGearRatio(Vehicle vehicle, int gear);
void SetVehicleGearRatio(Vehicle vehicle, int gear, float ratio);
This PR applies to the following area(s)
FiveM, Vehicle, Lua, JS, C#
Successfully tested on
Game builds: 3095,2944,2802,2699,2612,2545,2372,2189,2060,1604
Platforms: Windows, Linux
Checklist