TwoPlayerMod icon indicating copy to clipboard operation
TwoPlayerMod copied to clipboard

Implemented camera controls to face compass points

Open jakefisher opened this issue 9 years ago • 6 comments

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).

jakefisher avatar Mar 06 '16 15:03 jakefisher

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

BenjaminFaal avatar Mar 11 '16 08:03 BenjaminFaal

Camera controls now should be working on newest commit

jakefisher avatar Mar 11 '16 12:03 jakefisher

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!

BenjaminFaal avatar Mar 11 '16 12:03 BenjaminFaal

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).

jakefisher avatar Mar 11 '16 15:03 jakefisher

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.

BenjaminFaal avatar Mar 12 '16 08:03 BenjaminFaal

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.

jakefisher avatar Mar 12 '16 15:03 jakefisher