Page 1 of 1

Sublime snippets for ToME / TE4

Posted: Mon Jul 25, 2016 5:03 pm
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

Re: Sublime snippets for ToME / TE4

Posted: Thu Jul 28, 2016 10:19 am
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...

Re: Sublime snippets for ToME / TE4

Posted: Fri Jul 29, 2016 1:29 pm
by darkgod
One could also say atom is doomed because it's sluggish :)

Re: Sublime snippets for ToME / TE4

Posted: Thu Aug 18, 2016 11:44 pm
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

Re: Sublime snippets for ToME / TE4

Posted: Fri Aug 19, 2016 12:29 am
by Micbran
I would use one for atom.io. :P