View Full Version : Remap Keys and invert YMouse for camera look
Hi all,
First, a BIG thanks for letting us try/use UDK... brings back memory of when I used to do maps for D... err another game that used to have an editor :D.
The first thing I always do when I install a new game (or an old one of that matter) is change the keys for movement from WASD to ESDF, and invert the Y axis for mouse look so that I can use the flying type camera control (or above the head focus).
I've been able to play around with some ini files and finally found the one I needed to change the keys, but I can't find what I need to change to invert the Y mouse axis for camera look. Any help would be much appreciated .. specially since I really can't change years of habit (and I mean a LOT of years).
btw, this is for when testing maps inside the editor AND outside it. So far my movement keys work perfectly on both... Just need the mouse camera invert thingy.
Thanks in advance...
Regards,
M
desigpa
11-07-2009, 04:31 PM
I too would like to know how to edit the keyboard shortcuts...
MadGrenadier
11-07-2009, 05:04 PM
I think its all done like this: (correct me if I'm wrong)
C:\UDK\UDK-2009-11\UTGame\Config (or wherever you installed)
Open up UTInput.ini and thats where it all seems to be [Engine.Playerinput] being in game and [UnrealEd.EditorViewportInput] being editor.
desigpa
11-07-2009, 06:11 PM
That looks like the right place. Thank you!
Aye, that's one of the file I edited for changing some keyboard shortcuts... still cant' change the mouse Y axis though :/ Any clues?
Unreal McCoy
11-08-2009, 08:36 AM
When in game you can enter the command 'InvertMouse 1' into the console. It'll also remember the settings for your next session.
For the folks new to Unreal - press the Tab key to bring up the console.
ZixXer
11-08-2009, 08:54 AM
for mouse invert: View > Preferences > Drag moves canvas
Unreal McCoy
11-08-2009, 09:08 AM
for mouse invert: View > Preferences > Drag moves canvas
That option doesn't seem to have any effect. I think what Melk wants is to be able to hold the right mouse button down in the editor view and then move the mouse forward and have his camera look down instead of up.
Melk did you manage to invert the Y-axis in the viewport?
I looked absolutely everywhere i didn't find anything about it, it's very frustrating, i am sure there is only one line to change/add in one of the ini files
ProfessorGenesis
01-25-2010, 01:09 PM
Thanks for the tip.
This works.
I'll look for a more permanent version of this in UnrealScript within this forum.
If anyone has already found this then feel free to direct me.
Thanks again!!
UNREAL ROCKS!!!
BluePlanetGames
01-25-2010, 02:00 PM
This is the important bit of code in Engine.PlayerInput:
// Look up/down.
aLookup += aMouseY;
if (bInvertMouse)
{
aLookup *= -1.f;
}
If you are using the default UTPlayerController, it seems that it loads the InvertY value from the client's player profile. I'm at work right now, so I'm not completely sure where that is.
If you want a permanent solution, you can extend UTPlayerInput like this
(Disclaimer: once again, I'm at work and I haven't tested it, but it should work)
class NewPlayerInput extends UTPlayerInput;
event PlayerInput( float DeltaTime )
{
local vector Dir;
local float Dist, Ang, Leeway, OffAmount;
local int Quad, CurrentSel, PrevItem, NextItem, CurrentWeaponIndex;
local UTHud Hud;
local array<QuickPickCell> Cells;
HUD = UTHud(MyHud);
if ( Hud != none && Hud.bShowQuickPick && (Hud.QuickPickDeltaAngle != 0.0) )
{
//@warning: assumption of input scale in DefaultInput.ini
Dir.X = aTurn;
Dir.Y = aLookup / 0.75;
// skew the results a little as the input doesn't entirely give us a normal
// particularly when pressing near a cardinal direction (could get e.g. X=1.0,Y=0.3)
if (Dir.X >= 0.99)
{
Dir.X -= Abs(Dir.Y);
}
else if (Dir.X <= -0.99)
{
Dir.X += Abs(Dir.Y);
}
else if (Dir.Y >= 0.99)
{
Dir.Y -= Abs(Dir.X);
}
else if (Dir.Y <= -0.99)
{
Dir.Y += Abs(Dir.X);
}
Dist = VSize(Dir);
if (Dist > 0.6)
{
Ang = (static.GetHeadingAngle(Normal(Dir)) * 57.2957795) + 90;
Ang += Hud.QuickPickDeltaAngle * 0.5;
if (Ang < 0)
{
Ang = 360 + Ang;
}
Quad = int(Abs(Ang) / Hud.QuickPickDeltaAngle);
// give some more leeway towards retaining current selection
CurrentSel = Hud.QuickPickCurrentSelection;
PrevItem = (Quad == 0) ? (Hud.QuickPickNumCells - 1) : (Quad - 1);
NextItem = (Quad + 1) % Hud.QuickPickNumCells;
Leeway = Hud.QuickPickDeltaAngle * 0.20;
OffAmount = Abs(Ang) % Hud.QuickPickDeltaAngle;
if ( Hud.bQuickPickMadeNewSelection && CurrentSel != -1 && Quad != CurrentSel &&
(CurrentSel == NextItem || CurrentSel == PrevItem) )
{
if (OffAmount < Leeway || OffAmount > Hud.QuickPickDeltaAngle - Leeway)
{
Quad = Hud.QuickPickCurrentSelection;
}
}
else
{
if (UTPawn(Pawn) != None)
{
UTPawn(Pawn).GetQuickPickCells(Hud, Cells, CurrentWeaponIndex);
}
else if (UTVehicleBase(Pawn) != None)
{
UTVehicleBase(Pawn).GetQuickPickCells(Hud, Cells, CurrentWeaponIndex);
}
if (Cells.length > 0 && Cells[Quad].Icon == None)
{
if (Cells[PrevItem].Icon != None && OffAmount < Leeway)
{
Quad = PrevItem;
}
else if (Cells[NextItem].Icon != None && OffAmount > Hud.QuickPickDeltaAngle - Leeway)
{
Quad = NextItem;
}
}
}
Hud.QuickPick(Quad);
}
aLookup = 0.0;
aTurn = 0.0;
}
aLookup *= -1.0f;
Super.PlayerInput(Deltatime);
}
sirtoggle
05-21-2010, 08:47 PM
Yay, this works for gamepads also.
Powered by vBulletin® Version 4.1.6 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.