How to you give the player the ability to reset the mapping to default in the opening standalone config settings?
I have 5 axis in my game (X Steering, Throttle, Brake, Clutch and handbrake) and if a player accidentally maps an axis to the wrong one they can not reset or cancel the mapping. The ONLY way to change it is to map it to another axis.
- Im not talking about in editor. (i know how to reset those)
- Im not talking about player prefs (i have a reset button for that in game already that doesnt affect the controller axis mapping at all)
- I have tried to tell people to unplug and plug back in (hoping the controller rename will unmap them… but nope)
Is the mapping info held in the Registry? does anybody have a script or macro that will reset these? I would like the player to be able to start from scratch and right now I cannot find out hoe to do this.
I cant find any docs and no one has seemed to ask this similar question.
Thanks for any help that you can offer.
Kevin
Well i did figure out that deleting the entire reg folder (the one that the game creates in the “game company folder”) does in fact reset the controller mapping to default. So, i got that going for me…(caddyshack)
So i guess I can revamp my question then. How do you make it easy for the player to delete the game reg file and start fresh? I have heard this can be a sketchy thing to work with for a non guru? Is that correct? Is it taboo to ask the player to do this? Is there an option i dont know about?
Does someone now how to bootstrap this? ie; make a small controller that will launch the GAME.exe and offer a couple options to the player before the game even starts. (like delete player prefs and controller mapping?)
Thanks… I am 8 days into my Kickstarter and Its knid of important that i figure this out…
Kevin
Well… I think i figured out a nice easy way for my customers to quickly and easily delete their settings and start from the default settings.
I have quickly researched making a simple “.reg” file with windows notepad. here is a nice link where i just learned this. .REG FILES INFO
Step 1) Open a new windows Notepad file and copy and paste the below code into it.
Step 2) Edit it with your Company\Product name from your player settings in the Unity editor (explained below)
Step 3) Saved it as a .reg file with a simple title like “ControllerReset.reg” (in notepad at the bottom… check the file type to “all file types” so you can save as a .reg file and not just a .txt file)
Step 4)Double click the new “ControllerReset.reg” file to test it out. it should prompt you that it is going to start WWW3 but you still must go on… it will delete the whole game prefs folder in your registry.
Step5) distribute in your main game folder for players to reset their game to new.
Windows Registry Editor Version 5.00
[-HKEY_CURRENT_USER\Software\CompanyName\ProductName]
"\CompanyName" is the Company name in the player settings ( I dont ever use spaces to make it easier.)
"\ProductName" is the Product name in player settings ( I dont ever use spaces to make it easier.)
Make sure you test it yourself on your own machine so you dont melt your customers computer to a pile of recycled plastic.
USE THIS AT YOUR OWN RISK! Editing the Registry can be a dangerous thing to do … so be careful and always make a back of the .reg files first if you need them.
This is different from .deletePlayerPrefs because it clears the resoultion settings and controller mapping as well.
Give it a try… it worked for me.
Kevin