Don't Starve

Don't Starve

Generic to Xbox360
55 Comments
ayylmao 22 Jan, 2020 @ 7:21am 
This solved my glitchy gamepad, thank you!
csmith501 13 Sep, 2019 @ 6:39pm 
@Bezethoth You have to play around with the modmain.lua file. Basically once you make the changes you need to turn off the mod and then activate it again.

["(Button 0)"] = "\127",--"Button X",
["(Button 1)"] = "\128",--"Button B",
["(Button 2)"] = "\129",--"Button A",
["(Button 3)"] = "\130",--"Button Y",

And for me the D pad wasn't showing properly either. I added this under Right Stick.

["(Button 11)"] = "\142",--"DPad Up",
["(Button 12)"] = "\139",--"DPad Down",
["(Button 13)"] = "\140",--"DPad Left",
["(Button 14)"] = "\141",--"DPad Right",

For Mac users you can find the file in Library > Application Support > Steam > steamapps > common > dont_starve > dontstarve_steam (right click Show Package Contents) Contents > mods >workshop-391918434 > modmain.lua (open in a text editor or notepad)
Bezethoth 24 Feb, 2019 @ 6:30pm 
I need to change the X to the A, but I'm not sure how to do it on the file mentioned.
OldAbbyRead 11 Nov, 2018 @ 12:35am 
THANK YOU! Thank you for making this. As a person who prefers using third-party controllers, I hated the UI just having ugly text junk when I plugged one in. This is much more appealing. Instant favorite mod. :steamhappy:
RoDoX 3 Nov, 2018 @ 8:50am 
Also, when navigating the game menu, it displays X to go back, but B does it instead.
@peter_a_klei, may we have an update for this mod? (Shipwrecked).
RoDoX 3 Nov, 2018 @ 8:14am 
May I suggest a fix?
Playing Shipwrecked with this mod enabled. So if I drop a coconut on the floor and equip a machete, the mod displays the button A with the description "HACK" next to it, but it should be B, which is the actual button that does it. Is there a way to fix it myself?
inessa.manuelyan 4 Jun, 2018 @ 3:54pm 
@Rastaman
Go to Library in Finder (Press down Option then click Go and you should see it)
2) Application Support
3) Steam
4) Steamapps
5) Common
6) Don't Starve
7) Mods
8) Workshop...some number I can't remember. you might have several here depending on your mods.
9) open modmain.lua using a text editor.

🅞🅣🅜🅞🅡🅞🅩🅞 14 Mar, 2018 @ 8:09am 
I don't know were modmain.lua is on mac, can any one help
applebaps 20 Jan, 2018 @ 8:58pm 
friggin awesome, thank you for doing the devs' jobs for them
Summad 22 Apr, 2017 @ 4:30am 
Works with Easy Ps3 Overlay for DS3 / DS4 if you happen not to use DS4Windows (big drop in performance on my netbook).
nescius 11 Jan, 2017 @ 12:03pm 
great workaround, thanks, i wish this was already part of the original game and that it would support Steam controller, now i feel a bit stupid for buying the game and the controller.
Dredonkey 23 Oct, 2016 @ 4:20pm 
and final piece --Now inject our remapping into GetLocalizedControl
local old_GetLocalizedControl = GLOBAL.Input.GetLocalizedControl
local function RemappedControl( self, deviceId, controlId, use_default_mapping, use_control_mapper )
local text = old_GetLocalizedControl( self, deviceId, controlId, use_default_mapping, use_control_mapper ) or ""
return remap_table[text] or text
end
GLOBAL.Input.GetLocalizedControl = RemappedControl
Dredonkey 23 Oct, 2016 @ 4:19pm 
["(-Y Axis)"] = "\143",--"Left Thumb Up",
["(+Y Axis)"] = "\144",--"Left Thumb Down",
["(-X Axis)"] = "\145",--"Left Thumb Left",
["(+X Axis)"] = "\146",--"Left Thumb Right",

["(-Z Axis)"] = nil,
["(+Z Axis)"] = "\135",--"Left Trigger",,
["(-Z Rotation)"] = nil,
["(+Z Rotation)"] = "\138",--"Right Trigger",

--unset generic inputs
["(-X Rotation)"] = "\149",--"Right Thumb Left",
["(+X Rotation)"] = "\150",--"Right Thumb Right",
["(-Y Rotation)"] = "\147",--"Right Thumb Up",
["(+Y Rotation)"] = "\148",--"Right Thumb Down",
["(Slider 0)"] = nil,
["(Slider 0)"] = nil,
["(Slider 1)"] = nil,
["(Slider 1)"] = nil,
}
--[[
--unused Xbox 360 button images
"\135",--"Left Trigger",
"\135",--"Left Trigger",
"\138",--"Right Trigger",
"\138",--"Right Trigger",
]]

Dredonkey 23 Oct, 2016 @ 4:19pm 
heres the code
local remap_table = {
["(DPad 0 Up)"] = "\142",--"DPad Up"
["(DPad 0 Down)"] = "\139",--"DPad Down"
["(DPad 0 Left)"] = "\140",--"DPad Left",
["(DPad 0 Right)"] = "\141",--"DPad Right"
--derived from "(DPad %d [direction])",

["(Button 0)"] = "\127",--"Button A",
["(Button 1)"] = "\128",--"Button B",
["(Button 2)"] = "\129",--"Button X",
["(Button 3)"] = "\130",--"Button Y",
["(Button 4)"] = "\134",--"Left Bumper",
["(Button 5)"] = "\137",--"Right Bumper",
["(Button 6)"] = nil,
["(Button 7)"] = nil,
["(Button 8)"] = "\131",--"Start",
["(Button 9)"] = "\132",--"Back",
--derived from "(Button %d)"

Dredonkey 23 Oct, 2016 @ 4:18pm 
ok i got it to work! figured it out. also please make config and you can chose "Alternate controller bind incase of mod screw up" and one of the options and the one many have is this plz includ sholdent be hard,i havent gotten to the coding level of mods but i will credit you if i end up making a mod for this mod as i say i would thanks! ps i probably wont make my own mod. !ALSO ALL YOU PPL HAVING THE PROBLEM COPY THIS AND SELECT ALL IN THE BUTTON CONFIG AND PASTE THIS YOUR WLECOME
Dredonkey 23 Oct, 2016 @ 3:13pm 
i tried changing the buttons and it dosent work now
Dredonkey 17 Oct, 2016 @ 6:25pm 
im confused.
segmentation fault 20 May, 2016 @ 5:01pm 
I found it. For ubuntu the modmain.lua file is located in: "~/.steam/steam/SteamApps/common/dont_starve/mods/workshop-391918434/"
segmentation fault 20 May, 2016 @ 4:20pm 
what directory is the modmain.lua file in? (OS:ubuntu)
apfoss 25 Apr, 2016 @ 5:57pm 
Hi Peter, I thought I would comment because I just got this to work. Since my keyboard is a little messed up on my macbook, your mod was a great help. Those big "generic buttons" were kind of in the way and I didn't know which one to press. I did have a little trouble though, and that was because I have just bought the game, and didn't know that the mod needed to be enabled in the first place! I spent forever looking for that modmain.lua. I think a better solution would be to just implement button options and remapping for those buttons into the game, so regardless of controller, xbox/ps/etc users could just pick their own buttons from inside the game. In the meantime though it would be nice if you could update the description of the mod and that way it would be more clear.

Thanks again!

Jonah
wintercooled 18 Apr, 2016 @ 12:10pm 
Billiant! Thanks very much for this Mod - much appreciated, just what I was after.

Thanks to Elkeid also for the mappings which correctly map the 360 controller's buttons.

PS - if you are stuck trying to find the modmain files you have to right click on the dontstarve_steam app and 'show package contents'. Might be obvious to some people but wasn't to me!
桃花清澈眼眸 4 Apr, 2016 @ 5:55am 
用 手柄玩
Stephen Stark 4 Apr, 2016 @ 5:05am 
吊大的翻译下
peter_a_klei  [author] 29 Feb, 2016 @ 6:09pm 
Yup Eagle, I'll get around to that asap.
EagleDelta 27 Feb, 2016 @ 5:40am 
Are there plans to update this mod for Shipwrecked? It lists as incompatible
草人强 26 Feb, 2016 @ 5:47am 
nice
cc 18 Feb, 2016 @ 5:13am 
So where can I get those values for my specific gamepad to configure modmain.lua?
KseaviTy 5 Feb, 2016 @ 6:50am 
marco_benoit90, I HAVE THIS PROBLEM 2!
marco_benoit90 4 Feb, 2016 @ 2:53pm 
I also use a 360 controller and i have the same issue... mapping is wrong :( (i am on linux)
peter_a_klei  [author] 3 Feb, 2016 @ 11:34am 
Then you shouldn't need to use this mod. Your 360 controller should be detected correctly and use the correct icons already.
KseaviTy 3 Feb, 2016 @ 11:29am 
Im use controller of Xbox360
peter_a_klei  [author] 3 Feb, 2016 @ 11:14am 
Hello KSEAV!T, what type of controller are you using? Every generic controller is going to have a different mapping and will need to be modified for your individual controller.
KseaviTy 3 Feb, 2016 @ 10:58am 
Hello, i find a errors in this mod, you confused buttons (Actions
With Chester): Attack- it's "X" not ''B'', Open it's "A" not "X". And it's all errors what im found. Please Fix. ^^
Eskol Valentine 24 Dec, 2015 @ 10:00pm 
very useful <3 i just combined this mod with the mod "Easy Ps3 Overlay" and now I have the play station buttons ^^
Master of Pain 13 Nov, 2015 @ 1:51pm 
@peter_a_klei, thanks I'll do it soon
peter_a_klei  [author] 13 Nov, 2015 @ 10:51am 
@Gojira_86, the controller mapping is going to be different on each machine, to customize it to your specific setup, go into modmain.lua in the mod's directory (workshop-391918434), and then change the values in remap_table. Don't worry about messing something up, you can always delete the mod directory and re-download it.
Master of Pain 12 Nov, 2015 @ 8:40pm 
mod works in Linux/SteamOS :D

...but A and X are switched :( can you fix it please?

A must have mod for Don't Starve linux owners!
LittleRyan 27 Aug, 2015 @ 12:56am 
ood!
Arislan 15 Jun, 2015 @ 7:24pm 
good!
LucasCranach 17 May, 2015 @ 7:38am 
anyone have this working in Linux/SteamOS? i get problems with d-pad display/functions.
DoctorWillCU 12 May, 2015 @ 3:41pm 
Xbox360WirelssController on Mac

http://pastebin.com/mhLdCQJs
Elkeid 26 Apr, 2015 @ 11:04am 
local remap_table = {
["(Button 9)"] = "\132",--"Back",
["(Button 6)"] = "\133",--"Left Stick",
["(Button 7)"] = "\136",--"Right Stick",
["(Button 8)"] = "\131",--"Start",
["(Button 11)"] = "\142",--"DPad Up"
["(Button 14)"] = "\141",--"DPad Right"
["(Button 12)"] = "\139",--"DPad Down"
["(Button 13)"] = "\140",--"DPad Left",
["(+Z Axis)"] = "\135",--"Left Trigger",
["(+Z Rotation)"] = "\138",--"Right Trigger"
["(Button 3)"] = "\130",--"Button Y",
["(Button 1)"] = "\128",--"Button B",
["(Button 0)"] = "\127",--"Button A",
["(Button 2)"] = "\129",--"Button X",
}

--Now inject our remapping into GetLocalizedControl
local old_GetLocalizedControl = GLOBAL.Input.GetLocalizedControl
local function RemappedControl( self, deviceId, controlId, use_default_mapping, use_control_mapper )
local text = old_GetLocalizedControl( self, deviceId, controlId, use_default_mapping, use_control_mapper ) or ""
return remap_table[text] or text
end
GLOBAL.Input.GetLocalizedControl = RemappedControl
peter_a_klei  [author] 18 Mar, 2015 @ 12:01pm 
Thank you TuTu.
TuTu 18 Mar, 2015 @ 10:04am 
To those who use a PS3 controller on a Mac like me, here is my working modmain.lua: http://pastebin.com/nmVHXCqd
Red Mamba 20 Feb, 2015 @ 11:27am 
Sorry it doesn't work... :(
BarbeRousse 19 Feb, 2015 @ 2:29pm 
@peter : sorry I found it and deleted my post while you was answering.
So I tried to edit modmain.lua with @Paradox config and it doesn't work.
I still have "button XX" in game instead of Xbox360 button
I use a 360 gamepad on a macbook
peter_a_klei  [author] 19 Feb, 2015 @ 2:17pm 
You should be able to find it in /users/<youruser>/Library/Application Support/Steam/Steam Apps/common/Don't Starve Together Beta/dontstarve_steam.app, right click on that and then show contents, and then in the content folder you should see the mods folder and you'll want to open up "workshop-391918800".
Phpminor 17 Feb, 2015 @ 10:33am 
Ds
Can't you just use the ps3 buttons and push the equivalent button on the controller? they are on the same places
peter_a_klei  [author] 17 Feb, 2015 @ 10:31am 
Unfortunately no PS4 version yet dsdom2.
domicron_ 17 Feb, 2015 @ 8:43am 
can you make one with the ps4 controls i cant play without it!!!