Undertale

Undertale

Robin Sep 3, 2018 @ 5:00pm
How to use custom controls in UNDERTALE
So, I've got myself a working script that'll let me rebind undertales controls to anything I want, and I figured I would share.

First, you'll need to install AutoHotkey. A link is provided here: AutoHotkey download page. [autohotkey.com]

Next, right click on your desktop/in a folder and select New > AutoHotkey Script. Once it's there, right click the file and select Edit Script (Though I have Notepad++ installed and select to Edit weith Notepad++, so that works too). After that, paste this code into it:

#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases. ; #Warn ; Enable warnings to assist with detecting common errors. SendMode Input ; Recommended for new scripts due to its superior speed and reliability. SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory. #NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases. ; #Warn ; Enable warnings to assist with detecting common errors. SendMode Input ; Recommended for new scripts due to its superior speed and reliability. SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory. #HotkeyInterval 1000 ; Prevent Script from bugging out when you press the keys too quickly in succession. Esc::ExitApp ; Exit script with Escape key ^!s::Suspend ; Suspend script with Ctrl+Alt+S w::Up s::Down a::Left d::Right LButton::z RButton::x MButton::c

The default Undertale controls are Arrow Keys, Z, X, & C. This script rebinds that to WASD, Left Click, Right Click, and Middle Click. It also shuts down the script when the Escape key is pressed, and suspends it when you press Ctrl + Alt + S. This is important if you want to use the mouse, as rebinding Undertale's controls to mouse buttons will disable you from using the mouse buttons normally unless you use the shortcut to suspend the script or press Esc to shut the script down. So you can activate the script, suspend it with the shortcut, open Undertale, and then reenable the script by using the shortcut again. It's a bit complicated, but you should get used to it fairly quickly.

You can rebind the controls to anything you want now. A full list of keys for AutoHotkey is found here: List Of Keys [autohotkey.com]

Keep the keys on the right the same, those are Undertale's default controls. Change the ones on the left to rebind the control that key corresponds to. Same applies to the ExitApp and Suspend hotkeys.

Lastly, you can change this script so that it will only be active if you have Undertale as the active window. you can do this by putting:

#IfWinActive UNDERTALE

Above #HotkeyInterval 1000. This makes working with the script much easier, as you don't constantly have to suspend and unsuspend the script when switching between windows and such, HOWEVER, it will make it impossible for you to use the mouse to control the game. Trust me, I tried. Undertale doesn't look for or receive any input from the mouse, so if the script is taking its inputs from what the game gets, it will never get any mouse buttons being triggered. You have to have the script receiving input from the desktop, or PC itself, or whereever. I'm no master of this stuff, I just know that if you make the script only active when you are actually playing Undertale, you can't rebind controls to youer mouse, while if you leave it as is and have the script always active and just resort to suspending and unsuspending the script to switch between windows, you can rebind to mouse controls.

So yeah, it's kinda complicatd to setup and get used to, but once you do, it's really nice to have your preffered controls.
Last edited by Robin; Sep 3, 2018 @ 5:01pm
< >
Showing 1-15 of 34 comments
touchable Grass Aug 29, 2020 @ 11:46pm 
thx
JustPawel Aug 30, 2020 @ 1:57am 
thank you, very epic
also my left arrow key doesnt work
Last edited by JustPawel; Aug 30, 2020 @ 2:02am
muck Oct 20, 2020 @ 10:03pm 
it dint work
Twisted_Code Nov 20, 2020 @ 12:52pm 
nifty. I was going to try and write an AutoHotkey script like this, but since you've already done it, I think I'll just tweak yours to suit my needs. Thanks!

Fun fact, you can make hotkeys window-specific by using #If directives... highly recommended for hotkeys that you don't need to be system-wide.
The window name gets changed frequently during the Photoshop Flowey boss, though.
Twisted_Code Nov 20, 2020 @ 12:59pm 
Originally posted by Vex:
it dint work
The instructions look fine to me. Are you sure you did everything as described?
1. Install AutoHotkey
2. Create the script file and save the code to it
3. Double-click the script file
Should be that simple unless something went wrong...
Originally posted by (Edgy) Asriel Dreemurr:
The window name gets changed frequently during the Photoshop Flowey boss, though.
there's probably still a way you can catch it with one of the title modes, though I don't know for sure as I've never fought them (thanks for the spoiler tag by the way, though I already know a lot of the game spoilers thanks to the Internet... and in particular my own indulgent self-spoiling via the wiki)

even if you can't catch it by window title, try using the window handle or executable name
Last edited by Twisted_Code; Nov 20, 2020 @ 1:00pm
Originally posted by Twisted_Code:
Originally posted by Vex:
it dint work
The instructions look fine to me. Are you sure you did everything as described?
1. Install AutoHotkey
2. Create the script file and save the code to it
3. Double-click the script file
Should be that simple unless something went wrong...
Originally posted by (Edgy) Asriel Dreemurr:
The window name gets changed frequently during the Photoshop Flowey boss, though.
there's probably still a way you can catch it with one of the title modes, though I don't know for sure as I've never fought them (thanks for the spoiler tag by the way, though I already know a lot of the game spoilers thanks to the Internet... and in particular my own indulgent self-spoiling via the wiki)

even if you can't catch it by window title, try using the window handle or executable name
I have seen people have issues with AHK during that boss in particular so it might be something to look into.
Twisted_Code Nov 20, 2020 @ 1:05pm 
Originally posted by (Edgy) Asriel Dreemurr:
Originally posted by Twisted_Code:
there's probably still a way you can catch it with one of the title modes, though I don't know for sure as I've never fought them (thanks for the spoiler tag by the way, though I already know a lot of the game spoilers thanks to the Internet... and in particular my own indulgent self-spoiling via the wiki)

even if you can't catch it by window title, try using the window handle or executable name
I have seen people have issues with AHK during that boss in particular so it might be something to look into.
worst-case scenario, edit the script before the fight starts and reload, I guess? I still think
ahk_exe UNDERTALE.exe
should be able to grab the right window consistently, tho
Last edited by Twisted_Code; Nov 20, 2020 @ 1:05pm
TrippyWippy Dec 30, 2020 @ 5:20pm 
Yeah, How do I change the script so it works when the window name changes?
I can't beat the game anymore because THE STUPID WINDOW NAME KEEPS CHANGING AND I SUCK WITH ARROWS
Funny Oragn Cat Jan 16, 2021 @ 3:20pm 
How can I change the controls to my liking? I want to have I as up, J as left, K as down, and L as right, how can I do this?
just gonna use the ♥♥♥♥♥♥ arrows lmao
Stefexikon Jul 17, 2021 @ 2:19am 
Runs perfectly, thx so much, my heart is filled with determination <3
Just a tip for all the beginners, I was messing around for 5 mins because I had the problem that I could activate the script but was still caught in the windows folder and could not access the game.

Therefore, for beginners:
Run the script (double click)
Press Ctrl+Alt+S to suspend for one hot second (or three, your choice)
Click the Undertale window
Unsuspend the Hotkey (Reactivates it and you can play)
Criggle Jul 25, 2021 @ 7:39am 
Could somebody explain to me how I'm meant to create this file, I really don't get it Im on windows just in case it only works on a specific software
NexustheNinja19 Jul 26, 2021 @ 11:33pm 
Originally posted by (Edgy) Asriel Dreemurr:
Originally posted by Twisted_Code:
The instructions look fine to me. Are you sure you did everything as described?
1. Install AutoHotkey
2. Create the script file and save the code to it
3. Double-click the script file
Should be that simple unless something went wrong...

there's probably still a way you can catch it with one of the title modes, though I don't know for sure as I've never fought them (thanks for the spoiler tag by the way, though I already know a lot of the game spoilers thanks to the Internet... and in particular my own indulgent self-spoiling via the wiki)

even if you can't catch it by window title, try using the window handle or executable name
I have seen people have issues with AHK during that boss in particular so it might be something to look into.

Hey I used the Script And did the Instructions. It works yet I cannot click therefor I cannot Open The Undertale Window
Criggle Jul 27, 2021 @ 12:41pm 
Originally posted by YaBoiMarshYT:
Could somebody explain to me how I'm meant to create this file, I really don't get it Im on windows just in case it only works on a specific software
nvm
< >
Showing 1-15 of 34 comments
Per page: 1530 50