As many of you know it's almost impossible to play Ori with non-XBOX gamepad: all buttons are messed up and Unity's built-in remapper doesn't work properly (you can't rebind jump button). This tool is intended to fix it.
The included PowerShell script will replace a part of the Ori's code contained in the Assembly-CSharp.dll
file. This new code will query the Unity engine for the remapped buttons, instead of original ones, requested by game.
The modfied code is in the MoonInput.GetButton(string buttonName)
method in the Assembly-CSharp.dll
.
Original:
public static bool GetButton(string buttonName)
{
return Input.GetButton(buttonName);
}
Patched:
public static bool GetButton(string buttonName)
{
// array of the remapped button's numbers, generated by PS1 script from ini file
string[] strArray = new string[] { "1", "2", "0", "3", "4", "5", "8", "9", "10", "11", "6", "7" };
Match match = Regex.Match(buttonName, @"^(Joystick\dButton)([0-9]|1[0-1])$", RegexOptions.Singleline);
if (match.Success)
{
return Input.GetButton(match.Groups[1].Value + strArray[int.Parse(match.Groups[2].Value)]);
}
return Input.GetButton(buttonName);
}
- Download JoystickTest application
- Go to https://github.com/beatcracker/Ori-Controller-Remap
- In the bottom right corner click
Download ZIP
- Unblock ZIP file before unpacking
- Unpack downloaded ZIP file
- Go to the
Ori-Controller-Remap-master
folder - Open
Ori_Controller_Remap.ini
file in Notepad. This file contains controller button mappings for known controllers (Cyborg Rumble Pad
,Logitech Dual Action
, etc.) and one for you to edit (Your Controller Name
). - Run JoystickTest application
- Punch buttons on your controller, note their numbers in JoystickTest, edit ini file accordingly
- Replace
Your Controller Name
with any text you like (your controller name, your pet name, your maiden name - it's all up to you). - Save
Ori_Controller_Remap.ini
file - Double-click
Ori_Controller_Remap.cmd
file, it will launch PowerShell script - When asked, select configuration you've edited earlier in the ini file
- Press any key and wait for script to patch your Ori with new controller mapping
- Go to the Ori instalation directory
- Steam: right-click game in library → Properties → Local files → Browse local files
- Go to the
ori_Data\Managed
folder - Delete
Assembly-CSharp.dll
- Rename
Assembly-CSharp.dll.bak
toAssembly-CSharp.dll
— Or —
- Right-click game in library → Properties → Local files → Verify integrity of game cache
Q: I've got a red text message saying : Can't load Mono.Cecil.Reflexil.dll, press any key to exit...
A: Unblock ZIP file before unpacking
Q: I've got a red text message saying: Compiler executable file csc.exe cannot be found.
A: You have to install .Net Framework 3.5. For Windows 7 and higher you can do this via Windows GUI or command line:
- Run
cmd.exe
orPowerShell.exe
as Administrator - Copy/Paste text below and press
Enter
: DISM /Online /Enable-Feature /FeatureName:NetFx3 /All
- Press
Windows Logo
+R
keys on the keyboard. - Type
appwiz.cpl
in theRun
command box and pressENTER
. - In the
Programs and Features
window, click on the linkTurn Windows features on or off
. - Check if the
.NET Framework 3.5 (includes .NET 2.0 and 3.0)
option is available in it. - If yes, then enable it and then click on
OK
. - Follow the on-screen instructions to complete the installation and restart the computer, if prompted.
For Windows Vista and below you have to install it from Microsoft website: Microsoft .NET Framework 3.5 Service Pack 1
Q: Script worked for other buttons, but I stil can't use Triggers on my gamepad
A: I don't know why it happens, but some users reported that this could be fixed by using JoyToKey.
- Quote from Steam user Interceptor: Open
JoyToKey
program and hit theRTrigger
button on your controller, it will light up the corresponding line inJoy2Key
where you can click this specific button and assign it toShift
on your keyboard. So essentially when you're pressing that button on your controller you're holding the shift button on your keyboard (and thus allowing you to grab/slide)
Q: I've changed input settings in Unity's built-in remapper (held Shift
while starting Ori), but now I want to reset it to default. How can I do it? There's no option to reset.
A: Just delete all keys starting with __Input
in this registry key: HKEY_CURRENT_USER\Software\Microsoft Studios\Ori And The Blind Forest
.
Q: Script can't find my Ori installation (Assembly-CSharp.dll
file)
A: Are you running non-Steam version of Ori? Script uses registry keys created by Steam to locate Ori installation folder. If it can't find it, it looks for the required files in the script folder. So you have to copy those files in the script folder:
- Assembly-CSharp.dll
- mscorlib.dll
- System.dll
- UnityEngine.dll
Those files are located in the X:\Ori_Installation_Directory\ori_Data\Managed\
. After the patch, you have to copy and replace Assembly-CSharp.dll
file back to ther Ori installation folder. Three other files are required to build the patch code, but not modfied.
Q: Script doesn't work, produces red text and warnings not mentioned above, etc.
A: Run script, right-click window title, select Edit->Select All
, press Enter
. This will copy all text on screen. Then post it to the Steam Community or GitHub issues and I'll try to help you.
If the tool works for you, please, post your Ori_Controller_Remap.ini
file and controller name to the Steam Community or GitHub issues, so I can update my script with it.