Sublime snippets for ToME / TE4

All development conversation and discussion takes place here

Moderator: Moderator

Post Reply
Message
Author
Nagyhal
Wyrmic
Posts: 282
Joined: Tue Feb 15, 2011 12:01 am

Sublime snippets for ToME / TE4

#1 Post by Nagyhal »

I've created a repository of snippets to speed development of ToME/TE4 when working with Sublime Text :mrgreen:

I understand that Sublime Text is popular with ToME developers - not least of which is DarkGod himself! In my opinion, it's a beautiful text editor and everyone should use it. But we haven't even begun to take advantage of its great customization abilities by creating ToME-specific tools. Let's make it the best editor ever for creating ToME content!

This is only a small initial release, to gather ideas and inspiration. We'll call it an alpha! I'm going to add more to this library as I go along coding normally, as it's quick for me to do so - and now I feel I know all about regexes (after a night of furious doc-reading and bugfixing) I'm ready to apply them to a great many situations!

https://github.com/Nagyhal/ToME-snippets

Here's an example of what you can do:

getTalentRange
input: range <- press tab here
output: self:getTalentRange(t)

input: target <- with text selected, open the "getTalentRange" snippet using the Command Palette.
output: target:getTalentRange(t)

getTalentValue
input: tget <- press tab here
output: local value = t.getValue(self, t) <-enter parameter name in camel case (e.g "Dam", "Dur") and it will be converted into a local variable name in lowercase and underscores.

input: getInitialDam <- with text selected, open the "getTalentRange" snippet using the Command Palette.
output: local initial_dam = t.getInitialDam(self, t)

Anybody is free to create snippets! You can either paste them here for me to upload or upload them to the repository yourself.

I'd also like to know what suggestions people have as to new snippets, and how they think the ones currently uploaded could be improved.

Other snippets I'll complete shortly will include:
  • Talent templates, for various types of talent
  • Effect templates
  • NPC templates
  • Damage type templates
  • etc.
  • Grid-finding routines
  • Basic attack / damage routines
  • Generating as well as referencing talent values

Nagyhal
Wyrmic
Posts: 282
Joined: Tue Feb 15, 2011 12:01 am

Re: Sublime snippets for ToME / TE4

#2 Post by Nagyhal »

Well, I've just discovered atom.io, an editor which is apparently gaining traction over Sublime due to Sublime's poor developer support.

I still want to make Sublime awesome for ToME, though. Adding new snippets every day! And eventually, we can try and get an autocomplete working...

darkgod
Master of Eyal
Posts: 10750
Joined: Wed Jul 24, 2002 9:26 pm
Location: Angolwen
Contact:

Re: Sublime snippets for ToME / TE4

#3 Post by darkgod »

One could also say atom is doomed because it's sluggish :)
[tome] joylove: You can't just release an expansion like one would release a Kraken XD
--
[tome] phantomfrettchen: your ability not to tease anyone is simply stunning ;)

Nagyhal
Wyrmic
Posts: 282
Joined: Tue Feb 15, 2011 12:01 am

Re: Sublime snippets for ToME / TE4

#4 Post by Nagyhal »

Adding new snippets all the time!

haaaas... Has anybody actually used them?

I'm still looking at creating a dedicated "ToME Tools" package for Sublime Text. That would surely draw a few habitual users, as well as convert a few more people to Sublime Text, I should hope!

Plans:
  • Autocomplete for all engine / class functions
  • On-the-fly autocomplete for all talent / effect / damage type names
  • Extensive snippets to help you create content more quickly
  • Documentation for engine / class functions that appears in the tooltip as you type
  • Toggle for cheat mode on / off
  • Launch or relaunch ToME immediately from the editor
  • Automated testing to some very limited extent
Last edited by Nagyhal on Fri Aug 19, 2016 12:30 am, edited 1 time in total.

Micbran
Sher'Tul
Posts: 1154
Joined: Sun Jun 15, 2014 12:19 am
Location: Yeehaw, pardner

Re: Sublime snippets for ToME / TE4

#5 Post by Micbran »

I would use one for atom.io. :P
A little bit of a starters guide written by yours truly here.

Post Reply