modding keybinds

Abremms

Prince
Joined
Mar 5, 2010
Messages
436
thgis might be a stupid question, but is it possible to change the keybinds? i really want to switch the scroll keys from the arrows to WASD.
 
Look in InGame.lua, WorldView.lua, and CityView.lua
 
Look in InGame.lua, WorldView.lua, and CityView.lua

thanks for the tip, but no joy.

i found where the scrolling keybinds are, in WorldView.lua, and while changing them disables scrolling with the arrows, i can't seem to get other keys to work. I'm a complete noob at .lua though. its coded like this:

Spoiler :

DefaultMessageHandler[KeyEvents.KeyDown] =
function( wParam, lParam )
if ( wParam == Keys.VK_LEFT ) then
Events.SerialEventCameraStopMovingRight();
Events.SerialEventCameraStartMovingLeft();
return true;
elseif ( wParam == Keys.VK_RIGHT ) then
Events.SerialEventCameraStopMovingLeft();
Events.SerialEventCameraStartMovingRight();
return true;
elseif ( wParam == Keys.VK_UP ) then
Events.SerialEventCameraStopMovingBack();
Events.SerialEventCameraStartMovingForward();
return true;
elseif ( wParam == Keys.VK_DOWN ) then
Events.SerialEventCameraStopMovingForward();
Events.SerialEventCameraStartMovingBack();
return true;
elseif ( wParam == Keys.VK_NEXT or wParam == Keys.VK_OEM_MINUS ) then
Events.SerialEventCameraOut( Vector2(0,0) );
return true;
elseif ( wParam == Keys.VK_PRIOR or wParam == Keys.VK_OEM_PLUS ) then
Events.SerialEventCameraIn( Vector2(0,0) );
return true;
elseif ( wParam == Keys.VK_ESCAPE and InStrategicView() ) then
ToggleStrategicView();
return true;
end
end


I tried changing the Keys.VK_LEFT to Keys.VK_A, i also tried simply KEY_A, but my knowledge of LUA is limited to a few hours asking Google the wrong questions.

i get the impression that its linked so a master keybind list elsewhere that i cannot find. its not in any of the LUA or XML files unless i missed something.

oh wells.
 
you should use notepad++ and search the civ directly for the keybinds your are looking for. Its search function is about 1000 times better than windows.
 
i was using notepad++, i just went through the LUA files one by one, didn;t know you could mass search a directory >.<
 
hell yes you can, its freakin awesome! You can find anything you need so much faster that way.
 
hell yes you can, its freakin awesome! You can find anything you need so much faster that way.

that IS freakin' awesome. I'll have to give it another go after i put this uppity Caesar in his place.
 
Top Bottom