• Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Login
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 1.2k 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.
  • T
    Treos
    last edited by 15 Apr 2022, 02:28

    Hi all, I often use the "select ACU" hotkey that automatically zooms in on the ACU. Is it possible to change some setting to reduce the zoom level?

    I fiddled with the in-game "Zoom Pop" setting but it didn't seem to impact anything. Thanks for any pointers.

    1 Reply Last reply Reply Quote 0
    • J
      Jip
      last edited by 15 Apr 2022, 11:23

      I'm not sure.

      The hotkey takes us to:

          ['acu_select_cg'] = {action = 'UI_Lua import("/lua/keymap/misckeyactions.lua").ACUSelectCG()',
              category = 'selection', order = 33,},
          ['acu_append_cg'] = {action = 'UI_Lua import("/lua/keymap/misckeyactions.lua").ACUAppendCG()',
              category = 'selection', order = 34,},
      

      Which takes us to:

      local lastACUSelectionTime = 0
      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')
          end
      
          lastACUSelectionTime = curTime
      end
      
      function ACUAppendCG()
          local selection = GetSelectedUnits() or {}
          ACUSelectCG()
          AddSelectUnits(selection)
      end
      

      And that contains the +goto command, which then maps your camera to your selection (the commander). But I don't know how to set its arguments. Maybe @Strogo knows more about it.

      A work of art is never finished, merely abandoned

      1 Reply Last reply Reply Quote 0
      • Z
        ZLO
        last edited by 15 Apr 2022, 12:58

        i am not sure but, in interface settings there was "zoom pop distance" slider, does not that change what you want to change?

        TA4Life: "At the very least we are not slaves to the UI" | http://www.youtube.com/user/dimatularus | http://www.twitch.tv/zlo_rd

        1 Reply Last reply Reply Quote 0
        • E
          Ensor
          last edited by Ensor 15 Apr 2022, 16:05

          After minimal testing I have to conclude that the <Zoom Pop Distance> does nothing for the desired result, wether at 0 or 160 it does not seem to actually effect the zoom height.

          Instead what you can do is use <Select Your ACU>
          Screenshot-2022-04-15-ACU.png

          Comma == zoom to & select your ACU
          Spacebar == select your ACU

          1 Reply Last reply Reply Quote 0
          • M
            magge Global Moderator
            last edited by 15 Apr 2022, 17:02

            I am in the same boat, I use the 'Go to your ACU' and the camera is instantly in the face of the ACU. You always have to zoom out to make it useful.

            Join a FAFtastic Team

            1 Reply Last reply Reply Quote 0
            • S
              Strogo
              last edited by 15 Apr 2022, 18:11

              "UI_SelectByCategory [+add] [+nearest] [+idle] [+goto] categoryExpression\n"
                      "+add :            add to current selection\n"
                      "+nearest :        select only nearest unit matching category\n"
                      "+idle :           select only idle units\n"
                      "+inview:          select only units in the current view\n"
                      "+goto:            goto the unit if it's already selected\n"
              

              No zoom argument here, but this will work too:

              ConExecute('UI_SelectByCategory +nearest +goto COMMAND')
              Camera:SetZoom(zoom,seconds)
              
              1 Reply Last reply Reply Quote 0
              • U
                Uveso
                last edited by 15 Apr 2022, 19:22

                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
                  Treos
                  last edited by 16 Apr 2022, 23:46

                  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
                  • U
                    Uveso
                    last edited by 17 Apr 2022, 03:33

                    @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
                    • U
                      Uveso
                      last edited by Uveso 17 Apr 2022, 04:08

                      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
                      • M
                        magge Global Moderator
                        last edited by 17 Apr 2022, 22:22

                        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?

                        Join a FAFtastic Team

                        U 1 Reply Last reply 18 Apr 2022, 13:09 Reply Quote 0
                        • U
                          Uveso @magge
                          last edited by 18 Apr 2022, 13:09

                          @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
                            magge Global Moderator
                            last edited by 18 Apr 2022, 18:08

                            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.

                            Join a FAFtastic Team

                            1 Reply Last reply Reply Quote 0
                            • UvesoU
                              Uveso
                              last edited by 18 Apr 2022, 19:11

                              @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
                                magge Global Moderator
                                last edited by magge 5 Sept 2022, 02:53 19 Apr 2022, 04:08

                                @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.

                                Join a FAFtastic Team

                                1 Reply Last reply Reply Quote 0
                                • T
                                  Treos
                                  last edited by 10 May 2022, 02:40

                                  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