How to set hotkeys

Discussion in 'Modding' started by Original-Cossacks-Player, Sep 21, 2016.

  1. Original-Cossacks-Player

    Original-Cossacks-Player Active Member

    Look in the "hotkeys.cfg" found in: C:\Program Files\Steam\steamapps\common\Cossacks 3\data\game\var

    Heres what's available:

    hotkeys : section.begin
    // buildings
    [*] : struct.begin
    Key = C
    Action = build|%nat%cen
    struct.end
    [*] : struct.begin
    Key = H
    Action = build|%nat%hou
    struct.end
    [*] : struct.begin
    Key = L
    Action = build|%nat%bla
    struct.end
    [*] : struct.begin
    Key = B
    Action = build|%nat%bar
    struct.end
    [*] : struct.begin
    Key = E
    Action = build|%nat%aca
    struct.end
    [*] : struct.begin
    Key = S
    Action = build|%nat%sta
    struct.end
    [*] : struct.begin
    Key = R
    Action = build|%nat%art
    struct.end
    [*] : struct.begin
    Key = D
    Action = build|%nat%dip
    struct.end
    [*] : struct.begin
    Key = K
    Action = build|%nat%ba2
    struct.end
    [*] : struct.begin
    Key = J
    Action = build|%nat%tem
    struct.end
    [*] : struct.begin
    Key = I
    Action = build|%com%mil
    struct.end
    [*] : struct.begin
    Key = O
    Action = build|%com%sto
    struct.end
    [*] : struct.begin
    Key = M
    Action = build|%com%mar
    struct.end
    [*] : struct.begin
    Key = N
    Action = build|%com%gol
    struct.end
    [*] : struct.begin
    Key = N
    Action = build|%com%iro
    struct.end
    [*] : struct.begin
    Key = N
    Action = build|%com%coa
    struct.end
    [*] : struct.begin
    Key = P
    Action = build|%com%por
    struct.end
    [*] : struct.begin
    Key = T
    Action = build|%com%tow
    struct.end
    [*] : struct.begin
    Key =
    Action = build|%com%wwa
    struct.end
    [*] : struct.begin
    Key =
    Action = build|%com%swa
    struct.end
    // unit commands
    [*] : struct.begin
    Key = A
    Action = unit|attack
    struct.end
    [*] : struct.begin
    Key = S
    Action = unit|standground
    struct.end
    [*] : struct.begin
    Key = C
    Action = unit|nostandground
    struct.end
    [*] : struct.begin
    Key = F
    Action = squad|fill
    struct.end
    [*] : struct.begin
    Key =
    Action = squad|disband
    struct.end
    [*] : struct.begin
    Key = G
    Action = unit|cancelguard
    struct.end
    [*] : struct.begin
    Key = G
    Action = unit|guard
    struct.end
    [*] : struct.begin
    Key = E
    Action = unit|enableattack
    struct.end
    [*] : struct.begin
    Key = D
    Action = unit|disableattack
    struct.end
    [*] : struct.begin
    Key = R
    Action = unit|attackpoint
    struct.end
    [*] : struct.begin
    Key = J
    Action = squad|rank
    struct.end
    [*] : struct.begin
    Key = K
    Action = squad|column
    struct.end
    [*] : struct.begin
    Key = L
    Action = squad|square
    struct.end
    [*] : struct.begin
    Key = Ctrl+S
    Action = unit|stop
    struct.end
    [*] : struct.begin
    Key = U
    Action = unit|unloadall
    struct.end
    // interface
    [*] : struct.begin
    Key = Alt+M
    Action = interface|minimap
    struct.end
    [*] : struct.begin
    Key = Q
    Action = interface|viewcollision
    struct.end
    [*] : struct.begin
    Key = Ctrl+Alt+A
    Action = select|militaryunits
    Repeat = True
    struct.end
    [*] : struct.begin
    Key = Ctrl+A
    Action = select|allunits
    Repeat = True
    struct.end
    //[*] : struct.begin
    // Key = Shift+A
    // Action = select|militaryunits
    // Repeat = True
    //struct.end
    [*] : struct.begin
    Key = Ctrl+B
    Action = select|allbuildings
    Repeat = True
    struct.end
    [*] : struct.begin
    Key = Ctrl+P
    AlternativeKey = `
    Action = select|idlepeasants
    //Repeat = True
    struct.end
    [*] : struct.begin
    Key = Ctrl+`
    Action = select|allpeasants
    Repeat = True
    struct.end
    [*] : struct.begin
    Key = Ctrl+M
    Action = select|idlemines
    //Repeat = True
    struct.end
    [*] : struct.begin
    Key = Z
    Action = select|unitsofsametype
    Repeat = True
    struct.end
    [*] : struct.begin
    Key = Shift+Z
    Action = select|addunitsofsametype
    Repeat = True
    struct.end
    [*] : struct.begin
    Key = Ctrl+Shift+Z
    Action = select|addallunitsofsametype
    Repeat = True
    struct.end
    [*] : struct.begin
    Key = Ctrl+Z
    Action = select|allunitsofsametype
    Repeat = True
    struct.end
    //[*] : struct.begin
    // Key = P
    // Action = event|eventmainmenu|bprofile
    // Up = True
    //struct.end
    [*] : struct.begin
    Key = C
    Action = event|eventmainmenu|bcampaign
    Up = True
    struct.end
    [*] : struct.begin
    Key = R
    Action = event|eventmainmenu|brandommap
    Up = True
    struct.end
    [*] : struct.begin
    Key = S
    Action = event|eventmainmenu|bsettings
    Up = True
    struct.end
    [*] : struct.begin
    Key = E
    Action = event|eventmainmenu|beditor
    Up = True
    struct.end
    [*] : struct.begin
    Key = L
    Action = event|eventmainmenu|bloadgame
    Up = True
    struct.end
    [*] : struct.begin
    Key = X
    Action = event|eventmainmenu|bexit
    Up = True
    struct.end
    [*] : struct.begin
    Key = M
    Action = event|eventmainmenu|bmultiplayer
    Up = True
    struct.end
    section.end
     
    condor_fly likes this.
  2. Original-Cossacks-Player

    Original-Cossacks-Player Active Member

    So to decipher some important ones:

    Alt+M = interface|minimap (makes map smaller)

    Ctrl+Alt+A = selects all military units

    Ctrl+Z = selects all units of the same type
     
    [OC] Penwyn and condor_fly like this.
  3. Original-Cossacks-Player

    Original-Cossacks-Player Active Member

    If you edit the file make sure you don't set the same keys/key combinations twice as it will more than likely crash the game.
     
    [OC] Penwyn likes this.
  4. [KGR]CATWEAZEL

    [KGR]CATWEAZEL Moderator Staff Member

    Important is as well Ctrl+Alt+B in my opinion.
    Selects all Buildings.
     
    [OC] Penwyn likes this.
  5. Original-Cossacks-Player

    Original-Cossacks-Player Active Member

    Yes true, just don't accidentally press delete LOL!!
     
  6. Anatotitan

    Anatotitan Active Member

    There used to be a command to select all ships (Ctrl+S), it doesn't work now.

    Also, pressing space bar in Cossacks 1 would result in the screen centering on the currently selected unit. That was practical for example to go to idle mines and fill them without having to look on every mine wether it was the idle one. This space bar function seems to be gone aswell.
     
  7. kannerke

    kannerke Member

    I also missed the spacebar so far
     
  8. Furious Peasant

    Furious Peasant Active Member

    Very helpfull. Big thanks.
     
  9. Kuń

    Kuń New Member

    There's no key that displays health bars on units (like tilde before). :(
     
    Johny, Furious Peasant and Anatotitan like this.
  10. Johny

    Johny Active Member

    Sadly, many hotkeys missing. Also showing "blocked areas" by Q key etc.
     
    Furious Peasant likes this.
  11. [WW]Prototype

    [WW]Prototype Active Member

    where are UP,DOWN,LEFT,RIGHT keys ???
     
  12. [KGR]-^K[o]K^-

    [KGR]-^K[o]K^- Moderator Staff Member

    I hope developers add key bindigs, I really hate Ctrl + P = select all idle peasant. Alt Gr + P it should be like it was in Cossacks: Back to War :)
     
  13. Skul

    Skul New Member

    Use AutoHotKey to bind it to whatever you want.
    I have select all idle console peasants on Ctrl+E. It emulates Ctrl+P in Cossacks 3.
     
  14. [WW]Prototype

    [WW]Prototype Active Member

    try to change it for example for just one key,for example Q
     
  15. Fix bug build storage for Poland - Debug.zip
    Copy the files to: "Cossacks 3/mod"
    Install the .json file via Mod Manager
    [​IMG]

    [​IMG]
     

    Attached Files:

  16. Skul

    Skul New Member

    Try this:
    Code:
    #IfWinActive, ahk_exe cossacks.exe
    
    QKey := "vk51"
    PKey := "vk50"
    
    Global Modifiers
    
    SetTimer, Modifiers, 10
    
    Modifiers:
    {
    Modifiers := GetModifiers()  
    }
    Return
    
    *$vk51:: ; Any Q Down
    {
        if (Modifiers = "OnlyCTRL")
            Send {ctrl down}{%QKey%}{ctrl up}  ; Send CTRL+Q
        else if (Modifiers = "OnlyALT")
            Send {ALT down}{%Qkey%}{ALT up}  ; Send ALT+Q
        else if (Modifiers = "None")
            Send {ctrl down}{%PKey%}{ctrl up}  ; Send CTRL+P
    
    }
    Return
    
    *vk51 Up:: ; Any Q Up
    {
        GetKeyState, QKey, %QKey%
        GetKeyState, PKey, %PKey%
       
        If (QKey = "D") ; If Q Key is down
            Send {%QKey% Up} ; Send Q Key up
        If (PKey = "D") ; If P key is down
            Send {%PKey% Up} ; Send P key up
    }
    Return
    
    GetModifiers()
    {
        GetKeyState, CTRLState, vkA2 ; LCTRL
        GetKeyState, ALTState, vk12 ; ALT
        GetKeyState, SHIFTState, vkA0 ; LSHIFT
    
    
        If ((CTRLState = "U") & (ALTState = "U") & (SHIFTState = "U"))
            Return "None"
    
        If ((CTRLState = "D") & (ALTState = "U") & (SHIFTState = "U"))
            Return "OnlyCTRL"
        If ((CTRLState = "U") & (ALTState = "D") & (SHIFTState = "U"))
            Return "OnlyALT"
        If ((CTRLState = "U") & (ALTState = "U") & (SHIFTState = "D"))
            Return "OnlySHIFT"
           
       
        If ((CTRLState = "D") & (ALTState = "D") & (SHIFTState = "U"))
            Return "CTRL+ALT"
        If ((CTRLState = "D") & (ALTState = "U") & (SHIFTState = "D"))
            Return "CTRL+SHIFT"
        If ((CTRLState = "U") & (ALTState = "D") & (SHIFTState = "D"))
            Return "ALT+SHIFT"
       
        If ((CTRLState = "D") & (ALTState = "D") & (SHIFTState = "D"))
            Return "CTRL+ALT+SHIFT"  
    }
    I have remapped a lot of keys in Cossacks 3 for myself using this method, like creating and accessing 5-9 groups(CTRL+5 to 9) or choosing all idle peasants... And it works fine for me.
     
  17. [KGR]-^K[o]K^-

    [KGR]-^K[o]K^- Moderator Staff Member

    Hello, i would like to ask and please you if somebody dont know how to change:
    ctrl + shift + click = +5 units in a queue to this --> ctrl + shift + click = +100 units in a queue?

    Can someone please make autohotkey for market in Cossacks 3 ?


    Thank you very much

    This is autohotkey for Cossack: Back to War
    Code:
    SetDefaultMouseSpeed, 0
    
    
    
    eat:= 0
    iron:= 1
    wood:= 2
    coal:= 3
    stone:= 4
    gold:= 5
    
    
    
    
    
    ;Ďđîäŕćŕ:            0x008FC014     -     Ďŕň÷ 1.35ŕ        /        0x008FBE34 - Ęëŕńńčęŕ.    /    0x008ff780    -    Ďîěîđ
    ;Ďîęóďęŕ:            0x008FC018     -     Ďŕň÷ 1.35ŕ        /        0x008FBE38 - Ęëŕńńčęŕ.    /    0x008ff784    -    Ďîěîđ 
    ;Ęîë-âî ďđîäŕćč:        0x008FC010     -     Ďŕň÷ 1.35ŕ        /        0x008FBE30 - Ęëŕńńčęŕ.    /    0x008ff788    -    Ďîěîđ
    
    
    sell:= 0x008FBE34
    buy:= 0x008FBE38
    q:= 0x008FBE30
    
    
    y:= A_ScreenHeight - 120
    
    
    obm(Address, Data)
    {
    
    ProcessName = dmcr.exe
    ;Address = 0x008FC010
    ;Data = 3000
    Size = 4
    VarSetCapacity(Buf, Size, 0)
    
    NumPut(Data, Buf, 0, "UInt")
    
    PROCESS_VM_WRITE = 0x20
    PROCESS_VM_OPERATION = 0x8
    Process, Exist, %ProcessName%
    PID := ErrorLevel
    
    hProcess := DllCall("OpenProcess", "UInt", PROCESS_VM_WRITE | PROCESS_VM_OPERATION
                                     , "Int",  False
                                     , "UInt", PID)
    Ret := DllCall("WriteProcessMemory", "UInt", hProcess
                                       , "UInt", Address
                                       , "UInt", &Buf
                                       , "UInt", Size
                                       , "UInt", 0)
    
    DllCall("CloseHandle", "UInt", hProcess)
    }
    
    f1::
    obm(sell, gold)
    obm(buy, coal)
    obm(q, 10000)
    MouseClick, left, 325, %y%, 5
    obm(sell, coal)
    obm(buy, gold)
    obm(q, 810000)
    MouseClick, left, 325, %y%
    
    obm(sell, gold)
    obm(buy, iron)
    obm(q, 10000)
    MouseClick, left, 325, %y%, 5
    obm(sell, iron)
    obm(buy, gold)
    obm(q, 790000)
    MouseClick, left, 325, %y%
    
    obm(sell, wood)
    obm(buy, gold)
    obm(q, 10000)
    MouseClick, left, 325, %y%, 5
    obm(sell, gold)
    obm(buy, wood)
    obm(q, 380000)
    MouseClick, left, 325, %y%
    
    obm(sell, wood)
    obm(buy, stone)
    obm(q, 10000)
    MouseClick, left, 325, %y%, 5
    obm(sell, stone)
    obm(buy, wood)
    obm(q, 530000)
    MouseClick, left, 325, %y%
    
    obm(sell, wood)
    obm(buy, eat)
    obm(q, 10000)
    MouseClick, left, 325, %y%, 5
    obm(sell, eat)
    obm(buy, wood)
    obm(q, 600000)
    MouseClick, left, 325, %y%
    SetNumber(6)
    RETURN
    
    f2::
    obm(sell, iron)
    obm(buy, coal)
    obm(q, 10000)
    MouseClick, left, 325, %y%, 5
    obm(sell, coal)
    obm(buy, iron)
    obm(q, 900000)
    MouseClick, left, 325, %y%
    
    obm(sell, stone)
    obm(buy, iron)
    obm(q, 10000)
    MouseClick, left, 325, %y%, 5
    obm(sell, iron)
    obm(buy, stone)
    obm(q, 1700000)
    MouseClick, left, 325, %y%
    
    obm(sell, stone)
    obm(buy, eat)
    obm(q, 10000)
    MouseClick, left, 325, %y%, 2
    
    obm(sell, wood)
    obm(buy, eat)
    obm(q, 10000)
    MouseClick, left, 325, %y%, 5
    obm(sell, eat)
    obm(buy, wood)
    obm(q, 600000)
    MouseClick, left, 325, %y%
    
    obm(sell, wood)
    obm(buy, gold)
    obm(q, 10000)
    MouseClick, left, 325, %y%, 5
    obm(sell, gold)
    obm(buy, wood)
    obm(q, 830000)
    MouseClick, left, 325, %y%
    
    obm(sell, stone)
    obm(buy, wood)
    obm(q, 1000)
    MouseClick, left, 325, %y%, 15
    obm(sell, wood)
    obm(buy, stone)
    obm(q, 200000)
    MouseClick, left, 325, %y%
    SetNumber(6)
    RETURN
    
    f5::
    obm(sell, gold)
    obm(buy, coal)
    obm(q, 10000)
    MouseClick, left, 325, %y%, 6
    obm(sell, coal)
    obm(buy, gold)
    obm(q, 950000)
    MouseClick, left, 325, %y%
    
    obm(sell, gold)
    obm(buy, iron)
    obm(q, 10000)
    MouseClick, left, 325, %y%, 6
    obm(sell, iron)
    obm(buy, gold)
    obm(q, 750000)
    MouseClick, left, 325, %y%
    
    obm(sell, iron)
    obm(buy, wood)
    obm(q, 4000)
    MouseClick, left, 325, %y%, 6
    obm(sell, wood)
    obm(buy, iron)
    obm(q, 120000)
    MouseClick, left, 325, %y%
    
    obm(sell, coal)
    obm(buy, stone)
    obm(q, 4000)
    MouseClick, left, 325, %y%, 6
    obm(sell, stone)
    obm(buy, coal)
    obm(q, 390000)
    MouseClick, left, 325, %y%
    
    obm(sell, iron)
    obm(buy, eat)
    obm(q, 4000)
    MouseClick, left, 325, %y%, 6
    obm(sell, eat)
    obm(buy, iron)
    obm(q, 450000)
    MouseClick, left, 325, %y%
    SetNumber(6)
    RETURN
    
    f6::
    obm(sell, gold)
    obm(buy, coal)
    obm(q, 10000)
    MouseClick, left, 325, %y%, 6
    obm(sell, coal)
    obm(buy, gold)
    obm(q, 830000)
    MouseClick, left, 325, %y%
    
    obm(sell, gold)
    obm(buy, iron)
    obm(q, 10000)
    MouseClick, left, 325, %y%, 6
    obm(sell, iron)
    obm(buy, gold)
    obm(q, 760000)
    MouseClick, left, 325, %y%
    
    obm(sell, wood)
    obm(buy, stone)
    obm(q, 10000)
    MouseClick, left, 325, %y%, 6
    obm(sell, stone)
    obm(buy, wood)
    obm(q, 320000)
    MouseClick, left, 325, %y%
    
    obm(sell, wood)
    obm(buy, eat)
    obm(q, 10000)
    MouseClick, left, 325, %y%, 6
    obm(sell, eat)
    obm(buy, wood)
    obm(q, 550000)
    MouseClick, left, 325, %y%
    SetNumber(6)
    RETURN
    
    f9::
    obm(sell, coal)
    obm(buy, iron)
    obm(q, 10000)
    MouseClick, left, 325, %y%, 5
    obm(sell, iron)
    obm(buy, coal)
    obm(q, 900000)
    MouseClick, left, 325, %y%
    
    obm(sell, wood)
    obm(buy, coal)
    obm(q, 10000)
    MouseClick, left, 325, %y%, 5
    obm(sell, coal)
    obm(buy, wood)
    obm(q, 1650000)
    MouseClick, left, 325, %y%
    
    obm(sell, gold)
    obm(buy, eat)
    obm(q, 1000)
    MouseClick, left, 325, %y%, 10
    obm(sell, eat)
    obm(buy, gold)
    obm(q, 650000)
    MouseClick, left, 325, %y%
    
    obm(sell, stone)
    obm(buy, gold)
    obm(q, 4000)
    MouseClick, left, 325, %y%, 5
    obm(sell, gold)
    obm(buy, stone)
    obm(q, 795000)
    MouseClick, left, 325, %y%
    SetNumber(6)
    RETURN
    
    f10::
    obm(sell, gold)
    obm(buy, coal)
    obm(q, 10000)
    MouseClick, left, 325, %y%, 6
    obm(sell, coal)
    obm(buy, gold)
    obm(q, 650000)
    MouseClick, left, 325, %y%
    
    obm(sell, gold)
    obm(buy, iron)
    obm(q, 10000)
    MouseClick, left, 325, %y%, 6
    obm(sell, iron)
    obm(buy, gold)
    obm(q, 700000)
    MouseClick, left, 325, %y%
    
    obm(sell, wood)
    obm(buy, stone)
    obm(q, 10000)
    MouseClick, left, 325, %y%, 6
    obm(sell, stone)
    obm(buy, wood)
    obm(q, 320000)
    MouseClick, left, 325, %y%
    SetNumber(6)
    RETURN
    
    f7::
    Send, {SHIFTDOWN}
    MouseClick, left, 375, %y%, 25
    Send, {SHIFTUP}
    RETURN
    
    f8::
    Send, {SHIFTDOWN}
    MouseClick, left, 160, %y%, 10
    Send, {SHIFTUP}
    RETURN
    
    SetNumber(n)
    {
    Send, {Control down}
    SetKeyDelay, 10, 10,
    Send, %n%
    Send, {Control up}
    }
     
    Last edited: Nov 15, 2016
  18. Daddio

    Daddio Moderator Staff Member

    How does this work?

    Do you program hot keys to do certain functions in the game?
     
  19. [KGR]-^K[o]K^-

    [KGR]-^K[o]K^- Moderator Staff Member

    It works very well, but only for Cossacks: Back to War :)
    But i do not used it all the time, first 7-8 years of playing i do not know that program exist. One friend told me about it and explain me how to change it for specific market.

    So normally in Diplo
    hold "Shift " and left mouse click = +5 Dragoons (for 1000 Dragoons you must like idiot do 200 clicks of mouse every game and honestly that destroy my mouse button, no thank you)

    If you have autohotkey you just simple press "F7" = 125 Dragoons (so if you press 8 times "F7" = 1000 Dragoons)

    And what next autohotkey can do with one click of "F1" ? This:
    5x 10 000 Gold --> Coal
    810 000 Coal --> Gold
    ...
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice