-
-
Notifications
You must be signed in to change notification settings - Fork 438
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
Add getVehicleEntryPoints #2566
Add getVehicleEntryPoints #2566
Conversation
are these points hardcoded or are they somehow affiliated with the seat or door dummy? |
Looking at the underlying logic of GetPositionToOpenCarDoor which is used by the game to figure out what point to get the ped to before making it enter the vehicle (it also causes the endless going around the vehicle as it tries to line up per the ALIGN task) it does seem to calculate these from some of the vehicle's dummies. Unfortunately I can't say for certain what these exact dummies are and how it derives these entry points from it. |
…nto feature/entry-points
…asa-blue.git into feature/entry-points
0a738a3
to
07c19f2
Compare
Good idea! Is the code ready? |
Yes, it's been ready for quite a while. Just waiting for this to be reviewed. |
…E/mtasa-blue into feature/entry-points
Hmm, bit of an oversight I need to solve. Didn't consider that changing to CVector as per your request @TracerDS it would also make the non-OOP version return a vector which is not expected. Any suggestions on how to best solve that scenario? |
0500406
to
2b32d79
Compare
Fixes #2565
This PR adds a new function called getVehicleEntryPoints which returns a table containing the positions to 4 possible entry points to a vehicle. Note that this does not directly relate to the amount of doors a vehicle has as vehicles with two doors can have multiple entry points to the same door. This usually influences the type of animation that is being used which is most prominent with bikes (stepping onto the bike vs jumping onto it).
This function can be used alongside setPedEnterVehicle to make a ped enter a specific seat by first moving the ped to a entry point retrieved through getVehicleEntryPoints and then using setPedEnterVehicle to make them enter. At this time setPedEnterVehicle gives you no such control.
The non-OOP version returns a table containing 4 tables itself which hold the x, y, z coordinates of each entry point. The OOP version returns a table containing 4 Vector3's instead. When no entry points exist for a vehicle it will return false.
Test resources for both the non-OOP as OOP version of this function are provided on the bottom of this PR. These test resources display the entry points for each vehicle near you as seen in the screenshot below:
entrypoints.zip
entrypoints-oop.zip