🤦
🤦
phalanxdarken Posts: 14 Joined: 02 Jan 2022 @ 06 Aug 2025, 05:12 Hi everyone, this time I need a slightly simple script for Age of Empires 2 RTS. This game already features a native click - hold and drag method for camera movement that works a bit weird because it is not inverted so instead of dragging, the camera just moves to the direction you move the pointer, also it only works with RButton and cannot be changed - rebinded in game settings which is a bad decision from developers as the player mostly uses that click button for orders of units and almost every second of gameplay.In order to solve this, the ahk v2 script should do 2 or 3 things: First - Bind MButton to work as RButton / Second {most important} - When and while MButton is held, the pointer movement needs to be inverted so the dragging works properly as It should have been like many other rts games. Third: set something like sleep command or similar which makes only possible to click once the RButton and disables the ability to HOLD it, this way the MButton, which is acting like Right click, will be the only button that could be held for dragging and the original Rbutton would just be used to do single clicks and no accidental draggings.
The aim is to emulate again a hold and drag method of course with the inverted pointer to drag camera so we make use of the native drag of this game. If you need a video please let me know and I guess I can record a short clip to show this but I think this is a little self explanatory post. So much thank you for reading, ill be waiting for help! :thumbup:
Noitalommi_2 Posts: 638 Joined: 16 Aug 2023 @ 07 Aug 2025, 13:20 Hi. @phalanxdarken I don't have the game, so I couldn't test the following script with it. However, I did try it with C&C Remastered, as it uses a similar scrolling method, and it works there, the axes are inverted, so scrolling becomes dragging. Please test the script in Age of Empires 2.
(yas-minor-mode 'toggle)
(sgml-delete-tag 1)
(yas-new-snippet nil)
(mc/mark-more-like-this-extended)
(sgml-delete-tag 1)
(sgml-delete-tag 1)
(sgml-delete-tag 1)
(sgml-delete-tag 1)
(sgml-electric-tag-pair-mode 'toggle)
(sgml-delete-tag 1)
(sgml-delete-tag 1)
(sgml-delete-tag 1)
(xah-select-text-in-quote)
(mc/mark-more-like-this-extended)
(sgml-skip-tag-backward 1)
(write-file "~/.emacs.d/snippets/mhtml-mode/base" t)
(message "Repeating command 7 transpose-lines")
(find-file "~soul/Uploads/codings/ahk/highlighter.css" t) (find-file "~soul/Uploads/codings/ahk/light.css" t) (mc/mark-all-in-region (region-beginning) (region-end)) (mc/mark-all-in-region (region-beginning) (region-end)) (-remove-tags-any- "span") (-remove-tags-any- "span ") (strip-html) (-remove-tags-any- "span") (-remove-tags-any- "span") (load-file "~/.emacs.d/lisp/-remove-tags-any-.el") (load-file "~/.emacs.d/lisp/strip-html.el") (mc/mark-all-in-region (region-beginning) (region-end)) (mc/unmark-previous-like-this) (mc/unmark-previous-like-this) (mc/unmark-next-like-this) (load-file "~/.emacs.d/lisp/strip-script-tags-html.el")
(insert-char 129318 1 t) (insert-char 129318 1 t) (sgml-electric-tag-pair-mode 'toggle) (sgml-electric-tag-pair-mode 'toggle) (mmm-ify-by-class 'html-css) (modus-themes-toggle) (modus-themes-toggle) (modus-themes-toggle) (insert-char 129318 1 t) ↣ "FACE PALM" (insert-char 129318 1 t) (sgml-electric-tag-pair-mode 'toggle) (sgml-electric-tag-pair-mode 'toggle) (mmm-ify-by-class 'html-css) (modus-themes-toggle) (modus-themes-toggle) (modus-themes-rotate '(modus-operandi modus-operandi-tinted modus-operandi-deuteranopia modus-operandi-tritanopia modus-vivendi modus-vivendi-tinted modus-vivendi-deuteranopia modus-vivendi-tritanopia)) (set-mark-command) (mmm-ify-region 'sgml-mode (region-beginning) (region-end)) (mmm-mode) (load-file "~/.emacs.d/lisp/sort-lines-by-length.el") (mc/mark-all-like-this) (read-only-mode 'toggle)