Setting up Roblox Development with Rojo, Git, Sublime Text 3, and Luacheck from scratch
Hi. This is going through the process of setting up Rojo with Git and what I had to install. This is for advance Roblox development that enables the use of Git. This tutorial assumes you have familiarity with:
- Git
- Lua
- Roblox Studio and Plugins
- PowerShell and command lines
- Sublime Text 3
- Windows 10
This tutorial is intended for advance Roblox developers. It’s provided as a tutorial, and not as an argument for why you should do this. In fact, this tutorial might sell you on not setting up this.
Hopefully this guide will help you on setting up this process.
Installing Git for Windows
First of all, you’re going to want to install Git for Windows. You can find this on Git for Window’s website. I recommend downloading the 64 bit version. I kept all of the settings the same.
You can skip this if you want to use Rojo without Git. For example, Rojo will work with Dropbox. It’s simply a file syncer. I highly recommend using Rojo with Git though.
After you’ve installed git, you might want to configure the author and email. I also generated an SSH key, and added it to Github so I could download my repositories since I have 2-FA enabled. Additionally I added a GPG key and then added it to Github for signing commits. You have to also tell Git about this key. If you do this you should enable signing by default. This isn’t necessary, but I figure someone might find it interesting.
Installing Rojo
Installing Rojo requires either downloading the rojo.exe and adding it to your path, or installing and compiling the code yourself. You can find instructions for both of these on the Rojo repository releases tab. I’m installing the Alpha version, which will be the 1.0 release when Rojo is finalized for two-way syncing.
Installing rojo command line by downloading the exe from GitHub
Downloading the exe is the easiest way to install Rojo. You can find the .exe in the releases page. We want to download this.
Chrome thinks that Rojo is dangerious because it hasn’t seen it. You can compile the source code yourself using Rust if you don’t have permission to download this for some reason. This is out of the scope of this tutorial at this time. Check out the releases page for details on this.
Next, you’ll need to edit your PATH variable in Windows 10 to be able to execute Rojo from the command line. This will require administrative permissions. If you don’t have these, you can put the rojo.exe.
Installing rojo.exe
So I can use Rojo in multiple projects, I’m installing Rojo. I’m going to install rojo.exe in a folder named “bin”. You can put the executable any where. This required more permissions. This isn’t strictly necessary. It just feels a bit cleaner.
No matter where you put it, you need to add Rojo’s folder to the path. If you aren’t familiar with this, adding Rojo’s folder to the path
Right click on “This PC” and then click on “Properties” in the context menu.
In the system menu, you need to click on “Advanced system settings”
Next, you need to click on environment variables.
Then you click on path, and then edit.
I’m adding mine to the system variables, but you can also add it to the user variables. I added mine at the bottom of the list. Windows searches this list to find executables to run from the command line. I don’t want Rojo to conflict with another one.
Click on “New” and then after that put a link to the directory that rojo is in. Note it’s not the path to the .exe, but rather the directory it is in.
Exit all three windows by pressing “Ok” instead of “Cancel”.
You can validate whether or not this worked by opening up PowerShell and testing the rojo command. Just type “PowerShell” into Window’s search bar and you should be able to pull it up. Launching PowerShell is something you should get used to for using Rojo.
In PowerShell you can type the command rojo. If you installed rojo properly you should see a message below.
If you didn’t install it properly you might see this:
If this is the case, make sure the path you added is actually the folder that Rojo is in.
Alternatives to installing Rojo.exe and adding to path
If you don’t want to install Rojo.exe in the path, you can just put the rojo.exe in the project file and check it into Git. However, this is relatively messy, and I wouldn’t recommend it. In this case, you can run ./rojo.exe and you should be able to use rojo.
Installing Rojo plugin
You will also want to install the Rojo plugin in Roblox Studio. For this you need to launch Roblox Studio and install the plugin. Check the releases page for the current plugin. I’m installing the Rojo 0.5.0-alpha.12 version, but this is probably out of date by the time you’re reading this.
You will know Rojo is installed properly in Roblox studio by opening up a new place. You should see Rojo installed in the plugins tab. Pop open the Roblox Studio plugins tab and verify that Rojo’s logo is there.
Note: The logo might look different in the future as there are plans to update it.
Verifying Rojo works and setting up a new project
Next you want to verify you’ve setup Rojo properly. I did this by downloading WFYB’s sourcecode from Git and syncing it using Rojo. You can also do this by setting up a new Rojo project, which is shown below. Additionally, you can download my drone simulation project.
Downloading a drone project to verify Rojo
You can clone the project by cloning the project from GitHub.
At this point, I’ll assume you know git.
Setting up a new Rojo project and running Rojo
Make a new folder for your games files. Your first step is to open up a new PowerShell console.
Once this is open you’re going to init git and rojo. Run the following commands
git init
And then:
rojo init
To see what a sample project looks like you can see this file from my drone project.
For now, you need a src folder. Make a new folder and then in that, put a file there you want to sync.
Next you want to run Rojo. Run
rojo serve
In the PowerShell:
If everything works out, it should say “Rojo serve listening on port 34872.” Now we need to go into Studio and enable the Rojo plugin:
Enabling the Rojo Plugin
Note in order to sync you need to enable Http in your place. You can do this by clicking on the game settings button.
Navigate to the options pane and then turn on allow HTTP Requests. Click on “Save” after you’ve selected “Allow HTTP Requests.” This is also the HttpService.HttpEnabled property, which you can access through the command bar.
To sync click on the “Connect” button after opening the Plugin.
If it syncs correctly you’ll see this screen:
When there is no server running Rojo will fail silently unless you have output open. You might see messages like:
Make sure the Rojo server is running.
When Rojo fails, it also just shows the connect screen again. So if you get that behavior that’s what is happening.
Verify that file syncing is occurring by looking in ReplicatedStorage.
Anything you put into src will be replicated to replicated storage. You can configure this by editing the default.project.json so you can map parts of the Roblox tree to your file system.
This lets you check things into git. You can then sync your files with GitHub. Note a current limitation is merging binary files that are .rbxl files.
Sublime Text 3 setup
Now that Rojo is installed we need some way to edit our files.
Personally I use Sublime Text 3 for editing Lua scripts. Sublime Text 3 is a light weight text editor. Another popular choice is VSCode. This tutorial will look at setting up Sublime Text 3 with linting for Roblox luachecking.
Setting up linting
While not necessary, linting will check for syntax issues. This includes two parts. The first is configuring your IDE to recognize the linting system, and the second is to actually install Luacheck. This can get messy.
You want to start by installing Package Control if you haven’t already. Press the chord “Ctrl + Shift + P” and type “Install Package Control” and press enter. You should be able to install package control from Sublime Text 3.
Once you’ve installed Package Control you want to install a few packages. These packages are the “SublimeLinter” package and then the Lua specific linter which is “SublimeLinter-luacheck”. You can do this by pressing “Ctrl + Shift + P” and typing “Install package” and then pressing enter.
Once you’ve opened up this pane, you need to search for the packages.
Make sure you install the following.
- SublimeLinter
- SublimeLinter-Luacheck
Note there’s also a Lua version, but this is different than the Luacheck one. I’ve been using the luacheck one, which provides more control. Using the Lua version will check for compilation issues with Luac.
Installing Luacheck
I installed Luacheck by downloading the 64-bit binary distribution and putting it in my Rojo folder. Note the link above is to the 0.23 version. Check the repository for the latest download version
You can verify it’s installed like Rojo, by trying to execute it in Powershell.
Installing Luacheck config for Roblox
I maintain my own Luacheck config for Roblox. You can find it here:
You can install this by copying the roblox-standard.lua into a .luacheckrc file in the project base. You can see this below.
Verify that luacheck works by closing and then reopening Sublime Text, and then reopening it. Try typing something invalid in Sublime Text:
Note I also prefer a slightly different highlighting setting. You can access these here:
You can find my version of settings here. Note that this also includes settings to lint JSON.
Which makes my settings look like this:
Other extensions for SublimeText
I also installed the following extensions in Sublime Text 3:
- TrailingSpaces
- Terminal
- All Autocomplete
- Pretty JSON
- SideBarEnhancments
- SublimeLinter-JSON
Summary
Overall, setting up a development environment is currently hard. However, the benefits of using Git, and having Sublime Text as an editor can’t be understated.
Hopefully this tutorial can help guide you in setting up your own project with Git and Rojo.