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

Implemented camera controls to face compass points #12

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

jakefisher
Copy link

Players are able to set camera to face in North, South, West or East by using the DPad in the direction they wish the camera to face.
Controls are transformed to match the direction the camera is facing (in most if not all cases, I couldn't quickly find any where my characters weren't doing so).
Minimap also updates to face the direction of the camera.
Possible improvements could be made to allow for free camera rotation or 8 points, but the effort required to make this happen might outweigh the benefit (plus a constant line of reference may help players orient themselves).

@BenjaminFaal
Copy link
Owner

Sorry for the late response, please update your code to the newest commit so i can test and merge it.

@jakefisher
Copy link
Author

Camera controls now should be working on newest commit

@BenjaminFaal
Copy link
Owner

Better, but please change the int camDirection to an Enum something like this:

enum CameraDirection { North, East, South, West }

And maybe even save the value to the settings and read it back when the mod starts.

Currently the LeftDpad button (and maybe other Dpad buttons in the future) is used to detonate grenades and other throwable weapons.

I think we have to move this mechanism to Player 1's control, also please add documentation to your code. And please comply with C#'s naming conventions. This will make the code more readable for you, for me and for others.

Its surely a nice addition and i thank you for your input!

@jakefisher
Copy link
Author

Changed to using enums, moved camera controls to numpad or P1 controller left stick+LB.

Tidied up code and added some more comments, please let me know if there is still stuff that could be improved (my C# knowledge is based off the hackiest C that just about runs).

I have left settings alone as I don't want to mess up any of the rest of the config values (also it's pretty quick to switch in game).

@BenjaminFaal
Copy link
Owner

Looking much better like this, but there is a small problem, when player 1 is in a vehicle it wont work because Game.IsControlPressed(0, GTA.Control.Cover) returns false i think.

Players in vehicles can now switch camera angle by using the same
controller buttons (RB + Angle) or X + Numpad
@jakefisher
Copy link
Author

Players in vehicles can now switch camera angle by using the same
controller buttons (RB + Angle) or Duck(X) + Numpad.
Unfortunately Q (cover on foot) is bound to radio by default and so a different key is needed in a vehicle.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants