PDA

View Full Version : Key Binding Troubles



aZzy
10-28-2010, 06:06 AM
Hey Guys,
Im trying to toggle between 2 cameras,
First person and third person (shoulder view).

i have set bindings in the the defaultinput.ini


.Bindings=(Name="GBA_ChangeCamera",Command="ChangeCamera")

is in the
;-----------------------------------------------------------------------------------------
; BINDINGS USED TO ORGANIZE ALL GAME BINDABLE ACTIONS IN ONE PLACE FOR SYSTEMS SUCH AS UI
; GBA - GAME BINDABLE ACTION
; "_Gamepad" - IS USED WHEN A CONTROLLER IS USING AN ALTERED MAPPING FOR AN ACTION
;-----------------------------------------------------------------------------------------

Part of defaultinput.ini

and


.Bindings=(Name="M",Command="GBA_ChangeCamera")

in the

;-----------------------------------------------------------------------------------------
; Game Keyboard/Mouse Bindings
;-----------------------------------------------------------------------------------------

part of defaultinput.ini

Now this is where im having the problem, how do i put it into coding, i take it that i would need to put the code in my aZkorpPlayerController.uc class (aZkorp being my Custom Folder)

i want it to swap between 3rd and 1st person view when i press "m"
if in third person it goes to first person, if its in 1st person it goes to third person.

Any help would be greatly appreciated.
Thanks,
aZzy

zero0
10-28-2010, 11:12 AM
That key binding is going to call an exec function "ChangeCamera" which needs to be provided in your PlayerController.

Switching cameras could be as simple as flipping a boolean, or dynamically loading a new camera archetype (via DynamicLoadObject) . There are lots of ways you could set it up, such as the exec function taking the camera class name.

I would probably implement both cameras independently. Get the game working with one, then get it working with the other (there are lots of camera examples out there). Each camera will extend the base Camera class etc. (see the camera guide as well - http://udn.epicgames.com/Three/CameraTechnicalGuide.html)

Flipping between them should then be easy.

aZzy
10-28-2010, 05:47 PM
That link was very helpful, thankyou mate.

aZzy

aZzy
10-29-2010, 08:51 AM
Hey,

The cameras worked fine, but i am wondering why i cant move the crosshair up or down.. also there is no cross hair.

I am trying my hardest to learn Unreal Script but there is somethings i just cant get to work,

Key Bindings, so when i press "m" it will toggle between 3rd person and 1st person. by that i mean if it is in 3rd person it will go to 1st person and if its in 3rd person it will go to 1st person.

Making the cross hair accurate when in any other view other then 1st person and lastly

making the cross hair visible =P

any help on this would be greatly appreciated.

Thanks guys
aZzy.