Skip to content

selfAndrewKB/battlefield2-holdaim

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

"Hold to aim down sights" controls in Battlefield 2

Author: SelfAndrewKB

Battlefield 2 only has toggle-to-aim controls, which many people find clumsy. This Autohotkey script adds industry-standard hold-to-aim controls to the game hopefully without interrupting the other functions that the Aim button also performs in the game.

The script does this by differentiating between taps and holds, so you can still tap the Right Mouse to perform the game's original actions, and then hold to aim whenever you like. This also means that you have a choice between toggle-to-aim and hold-to-aim. Choosing between them is entirely contextual based on how long you hold the button down (adjustable), it feels very natural.

This particular script is the result of crawling through AutoHotkey's documentation, gradually learning whatever needed over the course of a day, to repurpose a script originally made for another game. Might not be the most refined, but it works well enough to often forget the fact that this mechanic isn't in the game natively.

Usage

Download the newest release from the Releases section. You can put the files anywhere you like.

Run BF2_Hold-to-Aim.exe (either before or after running Battlefield 2 seems to be fine) and you should find its icon in your system tray. The script works with the default binding of Right Mouse to Aim/Alt Fire.

Fair warning: Scanning the executable with VirusTotal raises warnings in 4 out of 66 anti-virus engines. These are, IMO, false positives caused by the file being new.

If you prefer to run an uncompiled script (and even alter it yourself in case your keybinds are different), then you can install Autohotkey and run BF2_Hold-to-Aim.ahk.

Note about potential issues

While I've managed to fine-tune and get this script working pretty smoothly for the most part, it is still ultimately simulating true hold-to-ads functionality via clever use of inhumanly fast virtual mouse clicks. Therefore, it is prone to occasionally becoming "confused" about whether you want to raise your sights or lower them. Two predictable scenarios are:

  1. Panicked, rapid mashing of both mouse buttons.
  2. Holding down the right mouse button while reloading.

In the 2nd scenario, BF2 ignores input from the Aim key during a weapon reload. So if you are holding the Aim key upon finishing the reload animation, the script will trigger ADS once you release the key (instead of lowering your sights which is what you'd normally want).

In either case, and other similar situations, a quick tap of the mouse key should quickly get everything back on track.

When it comes to vehicles, one discovered quirk is losing the fully automatic fire of a tank's turret. Two options are to rebind the function to a new key in the game's options menu, or to suspend the script by pressing the "0" key (assigned key can be easily changed in the 'BF2_Hold-to-Aim.ahk' file and recompiled back into an .exe file). Jets and Helicopters seems to be fine.

Acknowledgements

About

Adds hold-to-aim controls to Battlefield 2

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages

  • AutoHotkey 100.0%