Page 1 of 2 1 2 LastLast
Results 1 to 10 of 12

Thread: No way to create key binding to track hero

  1. #1

    No way to create key binding to track hero

    If you have the option "Hold Select Hero To Follow" enabled, then holding down the spacebar has this effect...

    1. Centers the view on your hero.
    2. Selects your hero.
    3. Follows your hero as you move
    4. Allows you to edge pan to offset the view while still tracking as your hero moves.


    The autoexec.cfg key binding that enables the same effect without having to hold the space bar down the whole game is...

    bind "SPACE" "+dota_camera_follow;+dota_camera_follow"

    However, since the May 2016 patch this key binding now only works with cheats enabled or in spectator mode, and it appears there is now no way to replicate this behaviour at all when playing online.

    I've played Dota on and off for a year now and but only tried to play online for the first time today, at which point I find out that my view controls don't work.

    I'm simply not capable of playing having to either 1) Hold the space bar down the whole game, or 2) Manually edge pan the view the entire game, and while it is possible to create a binding that tracks with your hero located at the center of the screen this is not playable either since having your hero locked at the center of the screen greatly restricts vision.

    In short (after much experimentation) this binding was the only way I'd discovered that made the game at all playable for me, and now I discover that although the binding works playing offline against bots I can't use it to play online. This means that now I want to play online I can't play at all until I find a replacement for this configuration.

    Does anyone know of some way to replicate this behaviour, or could we have the client fixed so that basic view control configuration that has worked for years can be re-enabled.

    Thanks.

  2. #2
    Basic Member
    Join Date
    Feb 2017
    Posts
    6
    This seems related: https://steamcommunity.com/app/570/d...0763307136966/
    But well, you can always duct tape your space key down.

  3. #3
    Basic Member 2slow4flo's Avatar
    Join Date
    Aug 2016
    Posts
    138
    1. Console: dota_camera_hold_select_to_follow 1

    2. Go to options -> hotkeys -> Assign a key to Select Hero

    This key is used to center camera on your hero & will follow your hero if you hold the key. If you still need a control group for your hero assign a control group key to group 10 and bind your old Select Hero key there. You have to add the heroes to the control group once for each hero though.
    The King has arrived.

  4. #4
    Basic Member aveyo's Avatar
    Join Date
    Aug 2012
    Location
    EU West
    Posts
    2,307

    Proposed solution

    You just need to adapt.
    Sure, you should not have to fight the game for proper controls.
    Lucky you, I've been an advocate of this and provided alternatives before the autoexec.cfg kill and even after it.
    I am confident you will find my proposition very useful:

    - first, you need two keys instead, one to enter follow mode, and one to exit it.
    bind CAPSLOCK "dota_camera_center"; // enter follow mode for the current selected unit (won't change selection to hero, so just use SPACE before it)
    bind SPACE "+dota_camera_follow"; // exit follow mode and selects hero (changes selection)

    - second, adjusting Hold Select Hero to Follow option will also toggle exit follow mode on camera grip.
    dota_camera_hold_select_to_follow 0; // using camera grip (mouse3) will exit follow mode, just like edge pan does
    but that's not what you need, right:
    dota_camera_hold_select_to_follow 1; // using camera grip (mouse3) will not exit follow mode, only edge pan will

    - and since this works so well with camera grip, why not also use the mouse wheel for the two binds?
    By default the mouse wheel is used to zoom, but that's not so important, and people using it for inventory slots..
    ..well, that's bad practice since it's a wheel, not a proper button, it has no on key up/ on key down events.
    bind MWHEELUP "dota_camera_center"; // enter follow mode for the current selected unit (won't change selection to hero, so just use MWHEELDOWN before it)
    bind MWHEELDOWN "+dota_camera_follow"; // exit follow mode and selects hero (changes selection)



    To summarize, you need to:
    A. reassign / clear any keys that are already used in the GUI Hotkeys setup, so that the binds done in autoexec.cfg work properly in-game:
    - SPACE is usually assigned to Recent Event, you should just set it as the Select Hero key
    - CAPSLOCK (or whatever key you chose), make sure you don't use it for something else
    - MWHEELUP is usually assigned to Camera Zoom In, you should set it to ALT + MWHEELUP instead (or + key)
    - MWHEELDOWN is usually assigned to Camera Zoom Out, you should set it to ALT + MWHEELDOWN instead (or - key)
    there is no problem if you use both the keys and the wheel (for convenience)
    B. set GUI Option Hold Select Hero to Follow to ON (can also be set in autoexec.cfg, too)
    C. adjust your autoexec.cfg with:
    Code:
    bind CAPSLOCK "dota_camera_center"; // enter follow mode for the current selected unit (won't change selection to hero, so just use SPACE before it)
    bind SPACE "+dota_camera_follow"; // exit follow mode and selects hero (changes selection)
    bind MWHEELUP "dota_camera_center"; // enter follow mode for the current selected unit (won't change selection to hero, so just use MWHEELDOWN before it)
    bind MWHEELDOWN "+dota_camera_follow"; // exit follow mode and selects hero (changes selection)
    
    dota_camera_hold_select_to_follow 1; // using camera grip (mouse3) will not exit follow mode, only edge pan will
    Then as a bonus, with the help of camera grip you can easily toggle between two views:

    MWHEELUP:


    MWHEELDOWN:

  5. #5
    @2slow4flo Thanks for your reply. Possibly I misunderstood what you meant but it seems like you just repeated my point that holding down the select hero button gives the best way of controlling the view, but I didn't see anything that explains how I can create a binding that achieves the same effect with a simple keypress instead of having to hold the key down the whole time. I didn't get the point about control groups either I'm afraid. I know how to create and use control groups but I don't see how that helps in this case.

    @aveyo Thanks for your very detailed reply. The approach you outline is very clever given the limitations imposed by the Dota client but falls down for me in several areas.

    1. The default camera grip controls are backwards, i.e you hold camera grip and move the mouse left and the camera moves right. There is a setting "Reverse Camera Grip" that fixes this, but for some reason when you have "Hold select to follow" enabled, the "Reverse Camera Grip" setting stops working. It's astonishing I know, despite how much money Valve makes from Dota the quality of some of the UI code is shocking. I use a PC at work all day which makes it very difficult to get used to the controls being backwards when using just one application, so this bug alone makes this approach unusable for me.

    2. Even when the camera grip button is held down, if the mouse touches the edge of the screen the tracking still disengages. Ideally when the camera grip button is held the cursor should not affect anything on the screen at all, again this is really poor UI implementation.

    3. The third point isn't really a problem with your method, just that I've personally become so used to edge panning in that I think it's too late for me to switch to using camera grip. It just feels too awkward but thanks for very much for your well explained suggestion anyway.

    I'm currently testing a solution using AutoHotKey. After much trial and error this script seems to give me the behaviour I'm looking for.


    -- Dota.ahk

    #IfWinActive Dota 2
    $*Space::
    Send {SPACE up}
    Send {SPACE down}
    return
    #IfWinActive


    How it works:

    #IfWinActive causes the script to only have an effect in the Dota window.
    $ Stops a key remapping from recursing (re-invoking itself).
    * Causes the script to still trigger with any modifier keys pressed.
    The script then replaces the normal spacebar behaviour with a key up followed by a key down message (the reverse of the normal processing). The key down message makes Dota think you haven't released the spacebar (so a single key press counts as holding it down), the preceding key up message causes repeated key presses to create a cycle so each time you press the spacebar it resets the camera back to your hero.
    return ends the script.

    In Dota configure "Select Hero" to spacebar, and "Hold select hero to follow".

    It seems to be working nicely so far. The only issue I've found is that typing a space in chat causes the tracking to disengage and I can happily live with that.


    https://autohotkey.com/

  6. #6
    I should add I use the script above with the following config in autoexec.cfg

    dota_camera_smart_follow_offset_time 9999
    dota_camera_smart_follow_edge_distance 6000
    dota_camera_smart_follow_drag_distance 6000
    dota_camera_hold_select_to_follow 1


    This does several things.

    1. It increases the distance you are able to offset the view away from your hero with view tracking active.
    2. It increases the time the view can remain offset. The default behaviour is for the view to reset back to your hero after a few seconds.

  7. #7
    Basic Member aveyo's Avatar
    Join Date
    Aug 2012
    Location
    EU West
    Posts
    2,307

    Arrow Proposed solution #2 for any selected unit perspective, not just main hero

    I am aware that my proposition does not address point no.4 (oops, that's like.. the key point), but it's been almost a year since the lame change to "one command per bind", and it does not look to be coming back.
    Btw, your script needed 3x +dota_camera_follow to also re-center while already following, just thought of mentioning it even if it's RIP.
    It was suggested multiple times after the killing of autoexec.cfg as a hotkeys settings toggle option, together with camera lock.

    I did not find a way in-game to obtain map-wide camera follow with edge-pan without the use of camera grip (there are some things to do differently with the help of dota_camera_lock, but it's not good enough).
    Well-intended client-side mods can achieve it easily, but are too volatile in nature since DOTA code changes frequently (my arcana hotkeys mod still not updated, but it did feature it in an older version..)
    And the autohotkey or other external macro suffer from their own quirks, and are not a solution within the scope of this forum.

    The Camera Grip: It's never too late to adapt! One thing that helps, is to change default MOUSE3 bind, to a side button such as MOUSE4 (or simply assign MOUSE4 additionally - by cfg).
    9 out of 10 mice I've laid my hands on, had an atrocious mouse wheel button, that took at least 4x the strain to press and hold compared to a side button.
    Now that's something that would make a lot of people hate it, along with the constant movement of the index finger from over the left button.
    I very much value ergonomics over everything when it comes to playing games such as DOTA (one more game.. just one more.. two more).

    The Reverse Camera Grip: I was afraid you are more of a Pudge than a Clockwerk guy.
    Guess how I've persuaded some of my friends to adapt: making them play Clockwerk and get Ags - it grows on you!
    It is however an issue that affects both methods as you can't have free follow without hold select to follow option.
    I believe these two options never worked together, and looking at how the camera snaps in different directions I think there is a conflict in the underlying code.

    The Camera Grip over Edge Pan: Yes it will stop following, in the same way as the default double-clicking portrait works - it is meant for small distance, and the stop on edge is helping not to get locked in follow mode.
    It's just a mouse wheel spin away to get back to tracking in no time after accidentally camera griping over the edge.

    One thing that bothers me is that you talk about it as if you use follow at all times - that would explain why camera grip would be needed more often - but still, Edge Panning can be used perfectly fine.
    In any case, it would make a strange and arguably sub-par way to play DOTA. I mostly use it during down-time walking across the map, inspecting different units in my control, saving the courier or sometimes strategically in laning phase as pictured in the previous post - using both follow and grip: not so much.

    Now let me tell you the one reason why adapting to this method (#2) is worth it: following any selected unit, not just the main hero! That's huge to micro multiple units heroes such as meepo, arc warden, lone druid, any illusion-spamming heroes such as naga, terrorblade, shadow demon (and any hero can become one with Manta Style), any dominating heroes such as chen and enchantress (and any hero can become one with Helm of the Dominator).
    It's not only functional, it's even fun!

    Personally I use a client-side mod with several alternatives based on underlying commands, going around the cfg bind interface limitations.
    I tried to emulate one of them in a way that it will resemble what you are used to in a hero-only perspective of follow / re-center / stop.
    However, for any selected unit the mwheeldown part (+dota_camera_follow) needs to be changed to either +cameragrip (to remain in follow mode), or into +dota_control_group 45 (to exit follow mode).
    Both alternatives need be assigned to mouse wheel up or down, to take advantage of the fact that these are not real buttons, there is no on-release event, so it won't actually trigger grip mode / easier to activate twice.
    The 45 number is chosen as a non-existent control group, and I don't know if you are aware of, but such (malformed) command can also be used to follow the current selected unit.

    I guess nothing stops you for using both methods - the unfortunate autohotkey external program for the better, but hero-only +camera_follow SPACE bind, and my mwheelup / mwheeldown binds for the any selected unit.
    Anyway, both methods are unintended behavior just as a sticky key would be, and likely a source of annoyance if it sticks or inadvertently affects camera grip or other actions (Valve coding rule: change a thing, break 9k more).
    I only ask you to give it one more try, while playing with multiple selections of heroes / illusions / units / couriers.



    To summarize #2 (any selected unit perspective) for people stumbling into this thread:

    A. reassign / clear any keys that are already used in the GUI Hotkeys setup, so that the binds done in autoexec.cfg work properly in-game:
    - SPACE is usually assigned to Recent Event, or as the Select Hero key in OP method, needs to be cleared if chosen as the re-center / exit follow mode
    - CAPSLOCK is usually clear - it's a good fit to activate follow mode after TAB-ing trough units
    - MWHEELUP is usually assigned to Camera Zoom In, you should set it to ALT + MWHEELUP instead (or + key)
    - MWHEELDOWN is usually assigned to Camera Zoom Out, you should set it to ALT + MWHEELDOWN instead (or - key)
    - MOUSE4 usually assigned to Voice chat, optionally used as Camera Grip in cfg (can keep both MOUSE3 and MOUSE4 until getting used to)

    B. set GUI Option Hold Select Hero to Follow to ON (can also be set in autoexec.cfg)

    C. adjust your autoexec.cfg with:

    Code:
    dota_camera_hold_select_to_follow 1;      // camera grip will not exit follow mode, only edge pan will
    //dota_camera_hold_select_to_follow 0;    // camera grip will exit follow mode instantly
    
    bind MOUSE4 "+cameragrip";                // optional Camera Grip on side mouse button - a far more ergonomic choice
    
    bind SPACE "+dota_control_group 45";      // double-tap to follow while pressed / re-center / exit follow mode on release (needs to be a key)
    
    bind CAPSLOCK "dota_camera_center";       // follow mode on any selected unit, not just main hero (same as double-click portrait)
    bind MWHEELUP "dota_camera_center";       // enter follow mode, can use camera grip to offset camera (same as double-click portrait)
    
    //// variant 1: temporary offset follow   // to stop following, simply edge pan, click portrait once, or double-tap SPACE 
    bind MWHEELDOWN "+cameragrip";            // re-center camera and resets the offset (needs to be a mwheel)
    
    //// variant 2: global offset follow      // to re-center camera, must manually use camera grip in follow mode - double-tapping hero/courier/groups keys won't reset the offset!
    //bind MWHEELDOWN "+dota_control_group 45"; // just stops follow mode, without re-center, and without resetting camera grip offset (needs to be a mwheel)

  8. #8
    Basic Member aveyo's Avatar
    Join Date
    Aug 2012
    Location
    EU West
    Posts
    2,307

    Arrow Proposed solution #3 - the semi-locked camera thingy

    Since I've mentioned the usage of camera lock, I'm going to share that method, too (just a partial implementation that can work in autoexec.cfg)
    Unlike the previous methods being offset cameras with more or less free follow, this one is a semi-locked camera.
    The main annoyance is that the following direction is reversed, but it does eventually centers on the unit, unlike previous offset methods (OP method, too) - so in this regard, it's "proper".
    It also does not require Hold Select Hero to Follow (so it can work fine with Reverse Camera Grip if needed).

    Code:
    bind MOUSE4 "+cameragrip";                     // optional Camera Grip on side mouse button - a far more ergonomic choice
    
    bind SPACE "+dota_control_group 45";           // double-tap to follow while pressed / re-center / exit follow mode on release / does not unlock camera (needs to be a key)
    
    bind CAPSLOCK "incrementvar dota_camera_lock 0 1 1 | grep %"; // toggle camera lock on or off / re-center if short-lock is active
    
    //// variant 1: pure camera lock long / short
    bind MWHEELUP "dota_camera_lock_lerp 0.999";   // activate long-lock mode / camera snaps back on center very slow / this is supposed to be the equivalent of free follow with edge pan
    bind MWHEELDOWN "dota_camera_lock_lerp 0.949"; // activate short-lock mode / camera snaps back on center relatively fast / only partial edge pan, but can camera grip to pause or go further 
    
    //// variant 2: hybrid lock-offset - [not implemented]
    
    //// init cvars
    dota_camera_smooth_enable 0; // optional
    dota_camera_lock_lerp 0.999; // start in long-lock mode
    //dota_camera_lock_view_helper 0; // unnecessary, breaks OP method

  9. #9
    Having follow on the whole time isn't a problem at all as long as the edge panning still works normally, it's not like having the camera locked on your hero at the center of the screen.

    Being able to track other selected units would be useful but in honesty I don't think I have the mechanical skill to micro multiple units anyway, when I get an illusion rune I either just send them off scouting somewhere with an attack move command or we move and fight as one If I reach the point where I need better unit control I suspect AutoHotKey can still be the basis for a solution, it's extremely powerful in what you can do. My workaround for this issue is trivial but it has full script/function/variable/flow of control support.

    I actually think using an external program probably has its benefits. It seems like the Dota code is way more volatile and subject to arbitrary/unintended changes than something like AutoHotKey. I suspect using AHK may make my control setup more rather than less robust in the face of change.

    I've tested my fix for this in a few games now and its working beautifully so far, but thanks all the same for your advice and suggestions aveyo.

  10. #10
    Basic Member aveyo's Avatar
    Join Date
    Aug 2012
    Location
    EU West
    Posts
    2,307

    Arrow Proposed solution #4 - the hybrid lock-offset camera for main hero perspective

    Like I've said, external macros have their benefits (I've done some crazy stuff myself with the most powerful version _H) but also have their quirks, and eventually will get too annoying.
    And there's the issue of VAC hammer always over your head. Anyway, it's beyond the scope of this forum.

    You've said in OP that there is no way to create key binding to track hero - I've shown you several.
    Did you even bother to test these various methods?

    Anyway, even if you are no longer interested, other people might be, so here's #4: semi-locked camera method (#3) coupled with offset-follow (#1) for hero-only (noob!) perspective:
    Code:
    bind MOUSE4 "+cameragrip";                   // optional Camera Grip on side mouse button - a far more ergonomic choice
    
    bind SPACE "+dota_camera_follow";           // exit follow mode and selects hero (changes selection) / does not unlock camera
    
    bind CAPSLOCK "incrementvar dota_camera_lock 0 1 1 | grep %"; // toggle camera lock on or off
    
    //// variant 2: hybrid lock-offset
    bind MWHEELUP "dota_camera_center";          // re-center camera and activates offset follow / does not stop lock-follow 
    bind MWHEELDOWN "+dota_camera_follow";       // re-center camera / does not stop lock-follow / can camera grip to pause or go further
    
    //// init cvars
    dota_camera_smooth_enable 0;                 // optional
    dota_camera_lock_lerp 0.9979;                // set lock-follow speed (just change in 0.00x increments: 0.9969 is faster, 0.9989 is slower, 0.9999 is very slow (max) 
    //dota_camera_lock_view_helper 0;            // unnecessary, breaks OP method
    
    dota_camera_smart_follow_offset_time 9999;   // OP follow cvars
    dota_camera_smart_follow_edge_distance 6000; // OP follow cvars
    dota_camera_smart_follow_drag_distance 6000; // OP follow cvars
    
    dota_camera_hold_select_to_follow 1;      // camera grip will not exit follow mode, only edge pan will / breaks reverse camera grip / not needed for lock-follow
    //dota_camera_hold_select_to_follow 0;    // camera grip will exit follow mode instantly
    Same as #3, this addresses your point no.4 i.e. it follows your hero but allows edge panning without exiting follow mode.
    You basically activate slower lock mode tracking with CAPSLOCK at the start of the game (if having follow always-on is your thing).
    Then can use MWHEELUP to activate faster offset mode tracking in addition (and re-center camera).
    If you edge pan, offset mode will disable itself, but lock mode will still track your hero. Clever, not?
    And if the slower lock mode tracking gets in your way while edge paning, you can press your camera grip button to stop view for moving or to grip further away.
    MWHEELDOWN will disable offset mode tracking just like in #1, and to disable lock mode tracking too, just press CAPSLOCK key again.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •