1. We have added a Gift Upgrades feature that allows you to gift an account upgrade to another member, just in time for the holiday season. You can see the gift option when going to the Account Upgrades screen, or on any user profile screen.
    Dismiss Notice

modding keybinds

Discussion in 'Civ5 - Creation & Customization' started by Abremms, Sep 22, 2010.

  1. Abremms

    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.
     
  2. warpstorm

    warpstorm Yumbo? Yumbo!

    Joined:
    Dec 19, 2001
    Messages:
    7,688
    Location:
    Snack Food Capital of the World
    Look in InGame.lua, WorldView.lua, and CityView.lua
     
  3. Abremms

    Abremms Prince

    Joined:
    Mar 5, 2010
    Messages:
    436
    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.
     
  4. Shiggs713

    Shiggs713 Immortal

    Joined:
    Mar 11, 2007
    Messages:
    2,361
    Location:
    Indianapolis
    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.
     
  5. Abremms

    Abremms Prince

    Joined:
    Mar 5, 2010
    Messages:
    436
    i was using notepad++, i just went through the LUA files one by one, didn;t know you could mass search a directory >.<
     
  6. Shiggs713

    Shiggs713 Immortal

    Joined:
    Mar 11, 2007
    Messages:
    2,361
    Location:
    Indianapolis
    hell yes you can, its freakin awesome! You can find anything you need so much faster that way.
     
  7. Abremms

    Abremms Prince

    Joined:
    Mar 5, 2010
    Messages:
    436
    that IS freakin' awesome. I'll have to give it another go after i put this uppity Caesar in his place.
     

Share This Page