How to work seamlessly in ChoiceScript between PC, Mac and iPad
This weekend, I gave myself what sounded like a simple project: to find a way to work on my ChoiceScript game on my iPad.
Easier said than done.
The problem is that I’m accustomed to the niceties of working on a desktop system. I use Notepad++ on my Windows PC so that I can use the custom ChoiceScript syntax highlighting module available here. I use TextWrangler on Mac so I can use another ChoiceScript syntax highlighting module. Both apps are free, by the way. And the community members who made the modules are awesome people.
I was also syncing my files through Dropbox to keep everything nice and up to date. All very nice, clean, and easy to work with.
So iPad poses a problem, because custom syntax highlighting isn’t much of a thing in iOS apps. I found one that has it, though: Textastic. It’s 7.99 USD, available separately on iPhone and iPad. I’ve only tried this with the iPad version, but as far as I know it should work on iPhone as well.
Second problem: there isn’t a Textastic-compatible ChoiceScript module available. No one has made one. Someone has, however, made a Sublime 2 module, and it’s their hard work that made this possible. It was a lot more complicated than just plunking that module into Textastic, but I recruited my husband’s assistance with the trickier parts and now we have something that works. Without further ado, my tried-and-tested method, seen working beautifully right here:
Set Up ChoiceScript Syntax Definitions
1. Get Textastic. (7.99 USD on iPad)
2. Download the ChoiceScript TextMate Bundle I’ve put together from aetheria’s syntax definitions. Unzip it and save it somewhere you can connect to via either FTP, WebDav or your own Dropbox. (If things seem weird, it’s probably because both Windows and Dropbox think a .tmbundle is a folder and treat it as such. It’ll be fine on iPad, though.)
3. In Textastic, select Local Files.
4. Tap the + icon at the bottom of the screen.
5. Create a new folder, and name it #Textastic - no other name will work. You can confirm that it’s correct by looking at the folder’s icon - if it’s a gear, you’re good.
6. Tap the #Textastic folder.
7. Tap the globe icon at the bottom of the screen.
8. Tap the + in the upper right to add a connection. If you already have Dropbox set up on your iPad this is super easy, just follow the steps on screen. If you’re using FTP or WebDAV, hopefully you already know what you’re doing.
9. Navigate to wherever you saved the .tmbundle file in step 2.
10. Tap the file and then tap Download to move it into your #Textastic folder.
11. Close the app - double click your home button to bring up multitasking and swipe Textastic up to close it completely.
Set up Syncing
Textastic has support for a bunch of services, but I recommend iCloud for this purpose. You can set up iCloud Drive on Windows and Mac, so it’s fully cross-platform, but more importantly, it’s the service Textastic syncs with most easily. It’s very much fire-and-forget.
Note that if you test your game *online* using Dropbox’s public links, you probably can’t do so with iCloud. You can use Dropbox with Textastic, it just takes a little more effort because you have to download and upload the files. Alternately, you can use iCloud to work on your files, and copy them to Dropbox when you’re ready to test them more publicly. You can preview your game in Textastic, (or in Firefox on desktop as usual) so you don’t need Dropbox for local testing.
For this, we’re using iCloud. If you don’t have it, install iCloud Drive on your main system to get started, then follow these instructions in Textastic on your iPad:
1. Tap iCloud.
2. Tap the plus icon at the bottom of the screen to create a new file. It doesn’t matter what you make - we’re just getting iCloud to create a Textastic folder.
3. Go to your computer. Copy your game’s files into the Textastic folder in iCloud Drive.
4. Back on your iPad, tap iCloud to browse your files. Look, there’s your game! Any changes you make here will be reflected on your other systems almost instantly (try not to have the files open on multiple systems at once to avoid overwriting your changes).
Once you’ve done this, you’ll also need to edit the files from iCloud drive on your other systems - but like Dropbox, it behaves like a normal part of the file system, so this shouldn’t be a big change.
Enable Syntax Highlighting
1. Open any of your scene .txt files in Textastic.
2. Tap the page icon in the upper right to bring up File Properties.
3. Tap Syntax Definition
4. Click ChoiceScript - once you’ve set it in one file, all your scenes should have proper highlighting. Yay!
Bonus: Change Editor Themes
The default Textastic theme isn’t great for ChoiceScript, in my opinion - it’s all a little dark. You can change it to one of the other built in themes by going back into the app’s settings (gear icon) and tapping Editor Theme. You can see how each of them changes the look of your script.
I liked IDLE, myself, but I wanted something a little closer to what I use in Notepad++. It’s not possible to make it identical, as far as I can tell - the themes don’t seem to support coloring normal brackets, and *label is the same color as other functions. Anyhow, I created a slight alteration of IDLE called IDLE-Choices that you can download here. It’s the one in use in all the screenshots. To install it in Textastic, follow the same steps you took to install the syntax definitions (dump it in dropbox, pull it into the #Textastic folder, kill and re-open the app).