Developer Cheerio Posted October 11, 2013 Developer Share Posted October 11, 2013 Sublime is a really fast multi-platform free text editor with a ton of useful features. It's also the most popular editor used to write lua here at Klei. This guide will give you an introduction to what I think are some of it's most useful features. This is not an introduction to modding or scripting however I do hope that both beginning and expert modders might find this guide useful . Setup:1. Install Don't Starve for Windows, Mac or OSX.2. Install Sublime.3. Unzip dont_starve_sublime_project.zip to your 'dont_starve/mods' folder.4. Launch Sublime and click on 'project->open_project' and open the 'dont_starve.sublime-project' file. SidebarThe tree view on the left side is called the Sidebar. If you don't see it, you can turn it on in the 'view->sidebar' menu option. The sidebar lets you browse both the script files used in 'Don't Starve' as well as any script files from any mods you may have downloaded. What I really like about the sidebar is how it opens files just by clicking them. Goto Anything - Shortcut='CTRL+P'This dialog lets you search for files and preview their contents. Once you start getting used to the filenames in the project, it becomes much faster to open them through this window. Goto Line - Shortcut='CTRL+G'This dialog lets you jump to a line within a file. This is really useful when scripting because whenever you have a script error, 'Don't Starve' tells you the file and line number. Find - Shortcut='CTRL+F'This dialog lets you search the currently opened file for a given string and will outline anything that matches it. You can then press 'F3' to jump through each match. Find in Files - Shortcut='CTRL+SHIFT+F'This dialog is similar to the 'Find...' dialog except it searches through all files. Most development I do in 'Don't Starve' involves reusing and extending existing scripts, so this dialog becomes incredibly useful at finding what I'm looking for. And that's it! These are just a few of Sublime's features. It has many others and a huge plugin development community. If you do give it a try or if you have a different favorite ide, let me know. I'm always looking for ways to write code faster/smater/better . For more Sublime tutorials, check out Perfect Workflow in Sublime Text 2. Link to comment Share on other sites More sharing options...
Nycidian Posted October 11, 2013 Share Posted October 11, 2013 This is pretty cool unfortunately sublime does cost some money after a bit. I would suggest using notepad++ and windows grep as an alternative its not quite as easy but they work. Link to comment Share on other sites More sharing options...
Developer Cheerio Posted October 11, 2013 Author Developer Share Posted October 11, 2013 This is pretty cool unfortunately sublime does cost some money after a bit. I would suggest using notepad++ and windows grep as an alternative its not quite as easy but they work.I bought a copy for my own use but I thought the trial was infinite, it just started nagging you after a while. This is what it says on the website: "There is currently no enforced time limit for the evaluation." Link to comment Share on other sites More sharing options...
Nycidian Posted October 11, 2013 Share Posted October 11, 2013 I bought a copy for my own use but I thought the trial was infinite, it just started nagging you after a while. This is what it says on the website: "There is currently no enforced time limit for the evaluation." Interesting, I might try it I just don't want to get hooked on something I can't afford. Link to comment Share on other sites More sharing options...
Malacath Posted October 11, 2013 Share Posted October 11, 2013 Yep, trial doesn't end. And the occasional nagging is totally worth it for all the features you get.I especially like the design which is so much more comfortable than any other editor I ever used. And I also like using "Ctrl"+"LMB" to put a cursor multiple places in the code and type at each place at the same time.So I can absolutely approve Cheerios post, get this program... now! Link to comment Share on other sites More sharing options...
gamer.toukotsu Posted October 11, 2013 Share Posted October 11, 2013 This is a really good tutorial. Thanks for sharing @Cheerio. Also note, the project only works while the game is installed in the default directory. Link to comment Share on other sites More sharing options...
Developer Cheerio Posted October 11, 2013 Author Developer Share Posted October 11, 2013 This is a really good tutorial. Thanks for sharing @Cheerio. Also note, the project only works while the game is installed in the default directory.Really? I made all the paths relative but maybe I overwrote them. Let me take a look Link to comment Share on other sites More sharing options...
gamer.toukotsu Posted October 11, 2013 Share Posted October 11, 2013 @Cheerio: This is what it looks like after I installed sublime and used the project file within the zip file provided. I simply created a new project, just thought I would make that relevant in case other people ran into similar issues. Link to comment Share on other sites More sharing options...
Developer Cheerio Posted October 11, 2013 Author Developer Share Posted October 11, 2013 This is a really good tutorial. Thanks for sharing @Cheerio. Also note, the project only works while the game is installed in the default directory.I've re-uploaded a new project which uses relative paths. Thanks for catching this! Link to comment Share on other sites More sharing options...
gamer.toukotsu Posted October 11, 2013 Share Posted October 11, 2013 I've re-uploaded a new project which uses relative paths. Thanks for catching this! Sorry @Cheerio it still doesn't work. All it does is opens up like usual and then displays the relative paths, which leads to no where. I'm looking into it on my end to see if there is a fix for it. Link to comment Share on other sites More sharing options...
Developer Cheerio Posted October 11, 2013 Author Developer Share Posted October 11, 2013 Sorry @Cheerio it still doesn't work. All it does is opens up like usual and then displays the relative paths, which leads to no where. I'm looking into it on my end to see if there is a fix for it.Which os are you running? Link to comment Share on other sites More sharing options...
gamer.toukotsu Posted October 11, 2013 Share Posted October 11, 2013 Which os are you running? I'm running Windows 8, so the problem was on my side folder structure set up. I got it fixed by adding "follow_symlinks" : true, to the beginning of the mods folder. Link to comment Share on other sites More sharing options...
debugman18 Posted October 11, 2013 Share Posted October 11, 2013 I use Sublime on my Windows PC, but there is no Mac port yet. I'm currently using TextWrangler for Mac, is there an alternative more like Sublime? (I really, really like the ability to change the color scheme.) Link to comment Share on other sites More sharing options...
Developer Cheerio Posted October 11, 2013 Author Developer Share Posted October 11, 2013 I use Sublime on my Windows PC, but there is no Mac port yet. I'm currently using TextWrangler for Mac, is there an alternative more like Sublime? (I really, really like the ability to change the color scheme.)There's an osx version of Sublime available on their download page: http://www.sublimetext.com/2 Link to comment Share on other sites More sharing options...
debugman18 Posted October 11, 2013 Share Posted October 11, 2013 There's an osx version of Sublime available on their download page: http://www.sublimetext.com/2Oh, nice, I didn't see it. Don't know how I missed it. Link to comment Share on other sites More sharing options...
Developer Cheerio Posted October 15, 2013 Author Developer Share Posted October 15, 2013 Added a link to a great site with Sublime video tutorials. Link to comment Share on other sites More sharing options...
simplex Posted October 16, 2013 Share Posted October 16, 2013 What's wrong with Emacs/vim with find/grep (or derivative, bundled commands) and LuaInspect/MetaLua? Link to comment Share on other sites More sharing options...
Developer Cheerio Posted October 16, 2013 Author Developer Share Posted October 16, 2013 What's wrong with Emacs/vim with find/grep (or derivative, bundled commands) and LuaInspect/MetaLua? I'm a sucker for a pretty face . Link to comment Share on other sites More sharing options...
zeropoint101 Posted March 11, 2014 Share Posted March 11, 2014 Yea, I'm not understanding this. I've been trying to learn lua and it's confounding me. I thought this editor might help some by being able to see the sidebar and searching for things, etc. But I'm stuck just on the project file provided. I open it. It's just some paths, and I have nothing in my sidebar except that project file. What should I be doing to get everything to show up as shown in the tutorial? I'm on windows 7 x64 EDIT: Well I thought I figured out what I did wrong. I think I need to open this as a project and not a file. When I did, I had directories for mods and data/scripts in my sidebar, but they don't contain anything. Learning to code sure makes a semi-intelligent guy feel like a complete moron. What am I doing wrong? Link to comment Share on other sites More sharing options...
squeek Posted March 11, 2014 Share Posted March 11, 2014 Yea, I'm not understanding this. I've been trying to learn lua and it's confounding me. I thought this editor might help some by being able to see the sidebar and searching for things, etc. But I'm stuck just on the project file provided. I open it. It's just some paths, and I have nothing in my sidebar except that project file. What should I be doing to get everything to show up as shown in the tutorial? I'm on windows 7 x64 EDIT: Well I thought I figured out what I did wrong. I think I need to open this as a project and not a file. When I did, I had directories for mods and data/scripts in my sidebar, but they don't contain anything. Learning to code sure makes a semi-intelligent guy feel like a complete moron. What am I doing wrong?Where did you put the dont_starve.sublime-project file? It has to be inside dont_starve/mods, as the paths are relative. Link to comment Share on other sites More sharing options...
zeropoint101 Posted March 11, 2014 Share Posted March 11, 2014 Yep. It's in there. Here's a screenshot of my mods folder, and one of what I get when I open Sublime with the folders in side bar expanded. Link to comment Share on other sites More sharing options...
UnderwearApp Posted March 11, 2014 Share Posted March 11, 2014 I had the same problem (relative paths did not work). Easiest solution I've found is to remove the folders in there, then go to Project>AddFolder and select your mods, scripts, DLC folder. This will place them in the project with the files like the tutorial has, allowing you to search through files, etc Link to comment Share on other sites More sharing options...
squeek Posted March 11, 2014 Share Posted March 11, 2014 Yep. It's in there. Here's a screenshot of my mods folder, and one of what I get when I open Sublime with the folders in side bar expanded.The dont_starve.sublime-project file itself needs to be directly inside the mods folder. You have it as dont_stave/mods/dont_starve_sublime_project/dont_starve.sublime-project when it should be dont_stave/mods/dont_stave.sublime-project. But, as ProfFarnsworth said, it's really easy to recreate what the .sublime-project file does. I usually just drag & drop folders into the Sublime sidebar. Link to comment Share on other sites More sharing options...
zeropoint101 Posted March 11, 2014 Share Posted March 11, 2014 Aha, Ok then. The tutorial at the beginning says to unzip it to the mods folder. When I do that, it puts the folder in the wrong place.. or maybe I misunderstood. Working now though. Thanks! Link to comment Share on other sites More sharing options...
chasterfield Posted September 21, 2014 Share Posted September 21, 2014 for the OS X users open the dont_strave_sublime_project with a text editor , change the second path to "/Applications/Don't Starve/Don't Starve.app/Contents/Resources/Don't Starve.app/Contents/data/scripts" and just do the rest ... Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.
Please be aware that the content of this thread may be outdated and no longer applicable.