FAForever Forums
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Login

    Possible to change ACU zoom level?

    Scheduled Pinned Locked Moved Game Issues and Gameplay questions
    16 Posts 7 Posters 839 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • UvesoU Offline
      Uveso
      last edited by

      simply add:

              local cam = GetCamera('WorldCamera')
              cam:SetTargetZoom(150)
      
      function ACUSelectCG()
          local curTime = GetSystemTimeSeconds()
          local diffTime = curTime - lastACUSelectionTime
          if diffTime > 1.0 then
              ConExecute('UI_SelectByCategory +nearest COMMAND')
          else
              ConExecute('UI_SelectByCategory +nearest +goto COMMAND')
              local cam = GetCamera('WorldCamera')
              cam:SetTargetZoom(150)
          end
      
          lastACUSelectionTime = curTime
      end
      
      1 Reply Last reply Reply Quote 2
      • T Offline
        Treos
        last edited by

        Thanks a lot. Let me just make sure I understand:

        1. the code above, should it go into the game.pref file? I don't see those definitions Strogo listed in my game.pref file, so perhaps it goes elsewhere?
        2. if it should indeed go into the game.pref file, mine only has one instance of "goto": in the "Profile" section, under "UserKeyMap = {", it says "Backspace = 'goto_commander',". Should it go somewhere there, or am I looking in the wrong place?

        Thanks again for any pointers!

        1 Reply Last reply Reply Quote 0
        • UvesoU Offline
          Uveso
          last edited by

          @Treos

          i'm really sorry for the confusion.

          My comment was aimed to Jip.
          "simply add" means that Jip could simply add this to the base game code inside the file "misckeyactions.lua"

          You can't change this on your side without a mod, but this is the function and location we talk about:
          https://github.com/FAForever/fa/blob/deploy/fafdevelop/lua/keymap/misckeyactions.lua#L196

          Since this function uses the command "GetSystemTimeSeconds" its working in UI-game-state,
          means it should be possible to change this with an UI mod on client side.

          1 Reply Last reply Reply Quote 0
          • UvesoU Offline
            Uveso
            last edited by Uveso

            well, it is possible to do this with an Ui mod:

            http://faforever.uveso.de/BetterACUSelectZoom-v1.zip

            Its using the keybinding for "Select ACU (control group)"

            1 Reply Last reply Reply Quote 1
            • maggeM Offline
              magge Global Moderator
              last edited by

              Shouldn't it be 'go to ACU' instead of select ACU? I tried both keybindings without any other mod, but unfortunately it does not work for me. Am I doing something wrong?

              Want to become a Moderator? || Open volunteer positions
              UvesoU 1 Reply Last reply Reply Quote 0
              • UvesoU Offline
                Uveso @magge
                last edited by

                @magge said in Possible to change ACU zoom level?:

                Am I doing something wrong?

                Well hard to say, what have you done?

                1. make sure you activated the mod inside the game mod manager
                2. validate that you have a keybinding for "Select ACU (control group)"
                3. press the key for "Select ACU (control group)" twice. (doublepress within 1 second)
                1 Reply Last reply Reply Quote 0
                • maggeM Offline
                  magge Global Moderator
                  last edited by

                  I missed the "double press"

                  I think the expected behavior is just to press once 'go to ACU' and the camera has the fixed setting immediately, but thanks for your mod.

                  Want to become a Moderator? || Open volunteer positions
                  1 Reply Last reply Reply Quote 0
                  • UvesoU Offline
                    Uveso
                    last edited by

                    @magge
                    well since its a mod you can change it like you want.

                        if diffTime > 1.0 then
                            ConExecute('UI_SelectByCategory +nearest COMMAND')
                        else
                            ConExecute('UI_SelectByCategory +nearest +goto COMMAND')
                            local cam = GetCamera('WorldCamera')
                            cam:SetTargetZoom(150)
                        end
                    

                    diffTime is the time between now and the last keypress.
                    if diffTime > 1.0 then
                    so the line with "+nearest COMMAND" will be executed if you slowly press the key.
                    But when you press the key twice inside 1 second the other lines with SetTargetZoom will be executed.

                    Now, if you want this on every key press, then you can change it.

                    open this file inside the mod:
                    \Mods\BetterACUSelectZoom\hook\lua\keymap\misckeyactions.lua

                    delete everything in this textfile and replace it with this:

                    function ACUSelectCG()
                        ConExecute('UI_SelectByCategory +nearest +goto COMMAND')
                        local cam = GetCamera('WorldCamera')
                        cam:SetTargetZoom(150)
                    end
                    

                    save it, restart the game and try again.

                    1 Reply Last reply Reply Quote 1
                    • maggeM Offline
                      magge Global Moderator
                      last edited by magge

                      @Uveso Thank you very much.

                      Edit after 20 days:

                      I thought the mod was broken after the latest patch, but the hot keys for all mods were reset, and you need to rebind them again. Just FYI, if anyone has the same problem, wondering why it does not work suddenly.

                      Want to become a Moderator? || Open volunteer positions
                      1 Reply Last reply Reply Quote 0
                      • T Offline
                        Treos
                        last edited by

                        Magge is right: just make sure you bind the hotkey to "Select ACU (control group)" and not "Go to ACU". Then the mod works - thanks Uveso.

                        1 Reply Last reply Reply Quote 0
                        • First post
                          Last post