Author Topic: [Scripting Tool] Touhou Danmakufu Packages for Sublime Text and Atom  (Read 21178 times)

Drake

  • *
This is a Sublime Text 2/3 package for the Touhou Danmakufu (東方弾幕風) scripting language. See below because I tell you to go download Sublime if you don't have it.
Designed for easy addition of support for arbitrary languages and enabling of further development because I felt like it.
(View repository on GitHub)

Features

    ●  Syntax highlighting for Danmakufu scripts (.dnh), aimed at ph3 syntax but works fine for 0.12m

    ●  Code completion for all ph3 engine library functions, with fuzzy matching and tabbable parameters

    ●  Function documentation, available in context menu and through ctrl+super+d by default

    ●  Sublime is probably better than the editor you're using now, considering you write Danmakufu scripts







Note: The function documentation for the Danmakufu ph3 library is not complete, and any help would be appreciated. The existing dictionary file (danmakufu-completions.sublime-settings) has everything prepped to add documentation, it just has to be put into a string format (i.e. escape newlines and tabs) and it should be really obvious what to do if you look at the file. Contribute by either uploading an updated file to this thread, or by directly sending a pull request on GitHub.

What is Sublime Text?

Sublime Text is a text editor with a plethora of great features out of the box, some of which are showcased on the main site. It has a Python plugin API that makes it fairly easy to add new features to the editor, and its package community is respectably large. On top of that, the Package Control utility makes it stupidly easy to get plugins instantly. I've used various editors and IDEs in the past for development, but Sublime quickly became my editor of choice, so I chose to develop a plugin to first and foremost make it nicer and easier to write DNH scripts, but also to give people more reason to use an editor like this.

For example, multiple selections are super useful. ST3 gives you the ability to jump to the declaration of a function, even if it's in some unopen file. You can show a list of all the functions declared in a file, search through them and jump to it. You can set bookmarks in your code and skip through them. It's just all around really good and feels seamless.

Now, I've been on RaNGE for a long time. The new scripters we get here generally aren't already well-versed in programming and often this is their first experience coding anything at all. Over the years, all we've done in terms of talking about text editors is suggesting that people pick up Notepad++, and from experience the vast majority of people either
a) use Notepad++ because we say so, or
b) haven't heard us recommend it so they still use their system's default text editor.
So, I'm giving people an incentive to switch to Sublime. If you guys like it, please advertise it as well.

Downloads are available from the above link. It works perfectly fine as-is, but Sublime Text is proprietary software and so you have to pay for a license or else it'll bug you every couple of saves. You have three options: deal with it like it's WinRAR, buy a license (lol), or use some sort of computer magic to get it to stop.

Installation

    ●  Install Package Control: https://sublime.wbond.net/installation and restart Sublime Text.

    ●  Preferences → Package Control → Install Package → Danmakufu, and restart again. Holy cow how easy can you get.




Language support for Atom



https://github.com/drakeirving/atom-language-danmakufu

For those who use Atom, I've also published an Atom package implementing Danmakufu language support.
However, this is all the package provides, so no code completion or function documentation as you would get from the Sublime package.

Additionally, I've added icon support for .dnh files to the file-icons Atom package, so if you are interested, check it out as well.
« Last Edit: May 21, 2016, 11:01:29 AM by Drake »

A Colorful Calculating Creative and Cuddly Crafty Callipygous Clever Commander
- original art by Aiけん | ウサホリ -

Helepolis

  • Charisma!
  • *
  • O-ojousama!?
Re: [Scripting Tool] Touhou Danmakufu Package for Sublime Text
« Reply #1 on: June 08, 2014, 12:54:09 PM »
Added to the information thread under tools and aiding programs.

Heh it is somewhat true regarding notepad++. Just because 'we say so' most people use it. Though I am sure every developer will eventually find his/her own tool to script in. Though I wouldn't blame the newbies starting in Notepad++, after all, what usually the mass uses, is often found 'easier'.

Thanks for the hard work.

Sparen

  • Danmakufu Artist
  • Git ready, git set, PUUSH!
    • AFCDTech
Re: [Scripting Tool] Touhou Danmakufu Package for Sublime Text
« Reply #2 on: June 11, 2014, 06:19:09 PM »
Note: I have forked it on Github, although it would be much easier to just push to the primary repo. If you could add me as a collab (Sparen)< I can help out with documentation. Also, there's a pull request waiting for you, Drake.

Drake

  • *
Re: [Scripting Tool] Touhou Danmakufu Package for Sublime Text
« Reply #3 on: June 11, 2014, 09:02:53 PM »
Done, and thanks.

A Colorful Calculating Creative and Cuddly Crafty Callipygous Clever Commander
- original art by Aiけん | ウサホリ -

Sparen

  • Danmakufu Artist
  • Git ready, git set, PUUSH!
    • AFCDTech
Re: [Scripting Tool] Touhou Danmakufu Package for Sublime Text
« Reply #4 on: June 14, 2014, 10:12:06 PM »
DOCUMENTATION UPDATES - June 14, 2014

Math Functions completed and ready for testing
String Functions completed (with the exception of vtos)
Time Functions completed and ready for testing
Debug Functions completed and ready for testing
Audio Functions completed and ready for testing
System Functions completed and ready for testing
Player Functions completed and ready for testing

If there are problems with formatting (incorrect tabbing, lines too long, errors), please inform Drake or me or send a pull request with the fixed file.

If there is unclear and/or missing documentation for the above function categories, there are two scenarios:
-Unclear in the wiki - This needs to be fixed. Please go to the wiki and fix the documentation or ask someone familiar with the language to do it
-Unclear in the sublime file - This is probably my fault. Tell me and I'll try to clear it up.

Note that I have not actually tested any of this in sublime. All documentation is directly from the Wiki, but I have changed a few things.

--Sparen of Iria

Blargel

  • RAWR!
  • I'M AN ANGRY LOLI!
Re: [Scripting Tool] Touhou Danmakufu Package for Sublime Text
« Reply #5 on: June 17, 2014, 03:13:33 AM »
People actually use github in this forum now? I'm amazed.  :V
<WorkingKeine> when i get home i just go to the ps3 and beat people up in blazblue with a loli
<Azure> Keine: Danmakufu helper by day, violent loli by night.

Sparen

  • Danmakufu Artist
  • Git ready, git set, PUUSH!
    • AFCDTech
Re: [Scripting Tool] Touhou Danmakufu Package for Sublime Text
« Reply #6 on: June 18, 2014, 12:21:58 AM »
People actually use github in this forum now? I'm amazed.  :V

He had a repo and I learned basic Git in APCS, so why not? XD

Drake

  • *
Re: [Scripting Tool] Touhou Danmakufu Package for Sublime Text
« Reply #7 on: June 18, 2014, 08:45:32 AM »
People actually use github in this forum now? I'm amazed.  :V
Well being able to install through the Package Control channel requires I use a repo, and this sort of project naturally benefits from source management, collaboration, version control etc so yeah. Plus it's Python and JSON; it isn't like I'm uploading DNH scripts to Git.

He had a repo and I learned basic Git in APCS, so why not? XD
I have hope for the future if high school classes even mention Git



Anyways, added a bunch more documentation. This is getting done.

More people need to start using it though blarg
« Last Edit: June 18, 2014, 08:47:15 AM by Drake »

A Colorful Calculating Creative and Cuddly Crafty Callipygous Clever Commander
- original art by Aiけん | ウサホリ -

Sparen

  • Danmakufu Artist
  • Git ready, git set, PUUSH!
    • AFCDTech
Re: [Scripting Tool] Touhou Danmakufu Package for Sublime Text
« Reply #8 on: June 18, 2014, 02:28:16 PM »
Are there plans for implementation of the Private Script Functions and Player Script Functions?



DOCUMENTATION UPDATES - June 18, 2014

DRAKE:
Generic Object Functions
Render Object Functions
Primitive Object Functions

SPAREN:
Player Object Functions
Input Functions
Shot Functions (partial)
Sound Object Functions

If there are problems with formatting (incorrect tabbing, lines too long, errors), please inform Drake or me or send a pull request with the fixed file.

If there is unclear and/or missing documentation for the above function categories, there are two scenarios:
-Unclear in the wiki - This needs to be fixed. Please go to the wiki and fix the documentation or ask someone familiar with the language to do it
-Unclear in the sublime file - Notify us so that it can be rectified.

Also: People! Please test this! If you test it and discover bugs and other issues, they can actually be fixed! Otherwise they'll just remain there.

--Sparen of Iria
« Last Edit: June 18, 2014, 02:59:04 PM by Sparen »

Sparen

  • Danmakufu Artist
  • Git ready, git set, PUUSH!
    • AFCDTech
Re: [Scripting Tool] Touhou Danmakufu Package for Sublime Text
« Reply #9 on: July 22, 2014, 07:32:01 PM »
DOCUMENTATION UPDATES - July 22, 2014

DRAKE:
Move Object Functions
Text Object Functions
Enemy Functions
Boss Scene Object Functions
Shot Object Functions

SPAREN:
3D Camera Functions

If there are problems with formatting (incorrect tabbing, lines too long, errors), please inform Drake or me or send a pull request with the fixed file.

If there is unclear and/or missing documentation for the above function categories, there are two scenarios:
-Unclear in the wiki - This needs to be fixed. Please go to the wiki and fix the documentation or ask someone familiar with the language to do it
-Unclear in the sublime file - Notify us so that it can be rectified.

Also: People! Please test this! If you test it and discover bugs and other issues, they can actually be fixed! Otherwise they'll just remain there.

--Sparen of Iria
« Last Edit: July 22, 2014, 07:40:41 PM by Sparen »

Drake

  • *
Re: [Scripting Tool] Touhou Danmakufu Package for Sublime Text
« Reply #10 on: July 27, 2014, 07:51:21 AM »
DOCUMENTATION UPDATES - July 27, 2014

DRAKE:
Item Object Functions
Player Object Functions
Collision Object Functions

A Colorful Calculating Creative and Cuddly Crafty Callipygous Clever Commander
- original art by Aiけん | ウサホリ -

Drake

  • *
Re: [Scripting Tool] Touhou Danmakufu Package for Sublime Text
« Reply #11 on: August 30, 2014, 09:06:24 AM »
I added a custom sidebar icon for .dnh files, just because. ST3 only since the icon functionality isn't in ST2.

A Colorful Calculating Creative and Cuddly Crafty Callipygous Clever Commander
- original art by Aiけん | ウサホリ -

Sparen

  • Danmakufu Artist
  • Git ready, git set, PUUSH!
    • AFCDTech
Re: [Scripting Tool] Touhou Danmakufu Package for Sublime Text
« Reply #12 on: August 30, 2014, 01:23:09 PM »
DOCUMENTATION UPDATES - Aug 30, 2014

DRAKE:
Path Functions
Common Data Functions
Script Functions

SPAREN:
2D Camera Functions

If there are problems with formatting (incorrect tabbing, lines too long, errors), please inform Drake or me or send a pull request with the fixed file.

If there is unclear and/or missing documentation for the above function categories, there are two scenarios:
-Unclear in the wiki - This needs to be fixed. Please go to the wiki and fix the documentation or ask someone familiar with the language to do it
-Unclear in the sublime file - Notify us so that it can be rectified.

Also: People! Please test this! If you test it and discover bugs and other issues, they can actually be fixed! Otherwise they'll just remain there.

--Sparen of Iria
« Last Edit: August 30, 2014, 01:30:17 PM by Sparen »

Sparen

  • Danmakufu Artist
  • Git ready, git set, PUUSH!
    • AFCDTech
Re: [Scripting Tool] Touhou Danmakufu Package for Sublime Text
« Reply #13 on: November 29, 2014, 04:40:29 PM »
DOCUMENTATION UPDATES - Nov 29, 2014

*And yes, this hasn't seen any progress for awhile, but if it's being used (I assume it is), then might as well keep on adding information

SPAREN:
Enemy Functions

If there are problems with formatting (incorrect tabbing, lines too long, errors), please inform Drake or me or send a pull request with the fixed file.

If there is unclear and/or missing documentation for the above function categories, there are two scenarios:
-Unclear in the wiki - This needs to be fixed. Please go to the wiki and fix the documentation or ask someone familiar with the language to do it
-Unclear in the sublime file - Notify us so that it can be rectified.

--Sparen of Iria

Uruwi

  • Nightmare of Torrential Precipitation
  • 478 million goober
Re: [Scripting Tool] Touhou Danmakufu Package for Sublime Text
« Reply #14 on: December 01, 2014, 12:03:14 AM »
Nice work, but I still prefer to use an alternative editor since Sublime technically isn't free and I probably can't convince my folks for a license.
foo = foldl $ flip ($)
Highest difficulty 1CCed for each game, by shot type in the original order. (-: never 1CCed on any difficulty, or never used; E: easy, N: normal, H: hard, L / U: lunatic / unreal.)
EoSD [NNNE] PCB [EE--N-] IN [NEEE + Ex Border] PoFV [Mystia N, Mystia E no charge] MoF [EN--H- + Ex Marisa B] SA [N-----] UFO [----EN] TD [NENE] DDC [EE-EHE + Ex Marisa B & Sakuya A] LoLK [PD --N- Legacy ---N] EE [N- + Ex Yabusame] EMS [N-- + Ex Yabusame] RMI [NHN + Ex YaoSuku]
Avelantis (demo) Easy YuukiB 426,077,200

Drake

  • *
Re: [Scripting Tool] Touhou Danmakufu Package for Sublime Text
« Reply #15 on: December 01, 2014, 12:20:39 AM »
I was thinking about the possibility of an atom.io extension since it's intentionally similar to Sublime (and is comparable in most aspects, I do recommend taking a look at it), but it would require me to recode the thing in javascript/coffeescript, for one. Atom uses Textmate language grammars just as this package does, so the stuff like syntax highlighting probably isn't too hard to get working.

Just to make clear that I don't want to exclude people for not wanting a particular editor. We'll see how things go maybe over winter break, because I've been just hella busy since the fall.
« Last Edit: December 01, 2014, 12:22:40 AM by Drake »

A Colorful Calculating Creative and Cuddly Crafty Callipygous Clever Commander
- original art by Aiけん | ウサホリ -

Sparen

  • Danmakufu Artist
  • Git ready, git set, PUUSH!
    • AFCDTech
Re: [Scripting Tool] Touhou Danmakufu Package for Sublime Text
« Reply #16 on: December 01, 2014, 03:39:13 AM »
Nice work, but I still prefer to use an alternative editor since Sublime technically isn't free and I probably can't convince my folks for a license.

The free trial never ends though... :)

Failure McFailFace

  • I'm h...a...p...p...y...
  • Impor
Re: [Scripting Tool] Touhou Danmakufu Package for Sublime Text
« Reply #17 on: December 01, 2014, 12:31:41 PM »
The free trial never ends though... :)

Same with WinRar, who buys the licenses when you could use it forever?
1cc Easy: DDC (all) | 1cc Normal: UFO (SanA autobomb),  DDC (ReiA, SakA) , LoLK (Sanae PD)| EX clears: DDC (MarB Ultra) | Puzzle Games: StB: 10-X, DS: Hatate unlock, ISC: All clear

Sparen

  • Danmakufu Artist
  • Git ready, git set, PUUSH!
    • AFCDTech
Re: [Scripting Tool] Touhou Danmakufu Package for Sublime Text
« Reply #18 on: January 28, 2015, 06:30:14 PM »
DOCUMENTATION UPDATES - Jan 28, 2015

SPAREN:
Item Functions
Other Functions

**I am currently adding in all functions that are not in the English Documentation (just the functions, not what they do) to both the Wiki and the Sublime file. I will try to get everything, but there is no guarantee I will manage to reach everything. After I have done this, I will try to add function skeletons to the Wiki and will then try to fill in as much of the sublime documentation as I can.

If there are problems with formatting (incorrect tabbing, lines too long, errors), please inform Drake or me or send a pull request with the fixed file.

If there is unclear and/or missing documentation for the above function categories, there are two scenarios:
-Unclear in the wiki - This needs to be fixed. Please go to the wiki and fix the documentation or ask someone familiar with the language to do it
-Unclear in the sublime file - Notify us so that it can be rectified.

--Sparen of Iria
« Last Edit: January 28, 2015, 08:37:30 PM by Sparen »

Uruwi

  • Nightmare of Torrential Precipitation
  • 478 million goober
Re: [Scripting Tool] Touhou Danmakufu Package for Sublime Text
« Reply #19 on: August 30, 2015, 03:59:22 PM »
I hope you don't mind if I integrate this into Linguist.
foo = foldl $ flip ($)
Highest difficulty 1CCed for each game, by shot type in the original order. (-: never 1CCed on any difficulty, or never used; E: easy, N: normal, H: hard, L / U: lunatic / unreal.)
EoSD [NNNE] PCB [EE--N-] IN [NEEE + Ex Border] PoFV [Mystia N, Mystia E no charge] MoF [EN--H- + Ex Marisa B] SA [N-----] UFO [----EN] TD [NENE] DDC [EE-EHE + Ex Marisa B & Sakuya A] LoLK [PD --N- Legacy ---N] EE [N- + Ex Yabusame] EMS [N-- + Ex Yabusame] RMI [NHN + Ex YaoSuku]
Avelantis (demo) Easy YuukiB 426,077,200

Sparen

  • Danmakufu Artist
  • Git ready, git set, PUUSH!
    • AFCDTech
Re: [Scripting Tool] Touhou Danmakufu Package for Sublime Text
« Reply #20 on: August 30, 2015, 04:03:24 PM »
I hope you don't mind if I integrate this into Linguist.

I had been planning to add it to Linguist for the past five months but I never actually asked Drake if he was OK with it.

If you *do* plan to add it to Linguist, please use the .dnh extension as the official Danmakufu extension, and make sure to upload a variety of different scripting styles for the code examples, not just your own. (ex: GTbot's cut in library, player scripts)

Additionally, message me on Skype to remind me to fill in the rest of the existing documentation sometime, so that I actually do it.

ExPorygon

  • Veteran Danmakufu Scripter
  • Currently working on a full Touhou fangame!
    • Ephemeral Entertainment
Re: [Scripting Tool] Touhou Danmakufu Package for Sublime Text
« Reply #21 on: April 25, 2016, 05:18:10 AM »
Sorry for the bump, but I was trying out your language while trying out Sublime and I can't seem to use the shortcut for commenting out lines. The shortcut is "ctrl - /" but it won't do anything when using your Danmakufu language. If I switch to another one like C then it will work as expected. I thought you should know about this, if you didn't already.

Drake

  • *
Re: [Scripting Tool] Touhou Danmakufu Package for Sublime Text
« Reply #22 on: April 25, 2016, 06:57:33 AM »
Really? Strange. Can you comment out lines with the menu (Edit -> Comment)? That should isolate whether it's a problem with the shortcut or the commenting itself. The tmPreferences file in the package is what determines how commenting is handled, so if you can't get it to comment at all you should check that file.

A Colorful Calculating Creative and Cuddly Crafty Callipygous Clever Commander
- original art by Aiけん | ウサホリ -

Failure McFailFace

  • I'm h...a...p...p...y...
  • Impor
Re: [Scripting Tool] Touhou Danmakufu Package for Sublime Text
« Reply #23 on: April 25, 2016, 11:41:31 AM »
Do you think you could make a package for Atom? I've been using it a lot for modding recently, and it would be nice to have .dnh syntax highlighting.
1cc Easy: DDC (all) | 1cc Normal: UFO (SanA autobomb),  DDC (ReiA, SakA) , LoLK (Sanae PD)| EX clears: DDC (MarB Ultra) | Puzzle Games: StB: 10-X, DS: Hatate unlock, ISC: All clear

Sparen

  • Danmakufu Artist
  • Git ready, git set, PUUSH!
    • AFCDTech
Re: [Scripting Tool] Touhou Danmakufu Package for Sublime Text
« Reply #24 on: April 25, 2016, 02:09:27 PM »
...All of this sudden activity reminds me to finish adding in the remaining documentation that's missing from the package.

ExPorygon

  • Veteran Danmakufu Scripter
  • Currently working on a full Touhou fangame!
    • Ephemeral Entertainment
Re: [Scripting Tool] Touhou Danmakufu Package for Sublime Text
« Reply #25 on: April 25, 2016, 06:19:32 PM »
Ah, I think I discovered the problem. I was under the false assumption that there was only one file needed and did not notice at first that there was an entire package of files. When I get home from work, I'll install it properly and report whether that fixed it.

EDIT: After installing properly, I'm happy to say that it seems to work 100%. Sorry for the misunderstanding and the unncecessary bump!
« Last Edit: April 26, 2016, 01:06:05 AM by ExPorygon »

Drake

  • *
Re: [Scripting Tool] Touhou Danmakufu Package for Sublime Text
« Reply #26 on: May 21, 2016, 10:58:19 AM »
New: Language support for Atom



https://github.com/drakeirving/atom-language-danmakufu

I've now published an Atom package implementing Danmakufu language support, for those who use Atom.
However, this is all the package provides, so no code completion or function documentation as you would get from the Sublime package.

Additionally, I've added icon support for .dnh files to the file-icons Atom package, so if you are interested, check it out.
(Note: as of this post it isn't in a released version, but it is merged in, so you can clone the repository manually for early access until then)

A Colorful Calculating Creative and Cuddly Crafty Callipygous Clever Commander
- original art by Aiけん | ウサホリ -

ExPorygon

  • Veteran Danmakufu Scripter
  • Currently working on a full Touhou fangame!
    • Ephemeral Entertainment
Re: [Scripting Tool] Touhou Danmakufu Packages for Sublime Text and Atom
« Reply #27 on: May 21, 2016, 04:21:52 PM »
I'm still trying to find an editor that I'm fully satisfied with. There are a lot of things I like about Sublime like having the file system open on the left pane and the simple find and replace system. However, I don't like how I get asked to buy it every 15 minutes and it seems to lack a hotkey for Save All, which I used a lot in Notepad++ when I was making a lot of small changes accross numerous files. What advantages and disadvantages would you say that Atom has over Sublime and Notepad++?

Failure McFailFace

  • I'm h...a...p...p...y...
  • Impor
Re: [Scripting Tool] Touhou Danmakufu Packages for Sublime Text and Atom
« Reply #28 on: May 21, 2016, 09:07:05 PM »
I'm still trying to find an editor that I'm fully satisfied with. There are a lot of things I like about Sublime like having the file system open on the left pane and the simple find and replace system. However, I don't like how I get asked to buy it every 15 minutes and it seems to lack a hotkey for Save All, which I used a lot in Notepad++ when I was making a lot of small changes accross numerous files. What advantages and disadvantages would you say that Atom has over Sublime and Notepad++?
Pros:
* Holy hell the number of user-made packages is insane. I think I have like a dozen user-made ones installed alone, and that's not counting the official packages.
* Very flexible. You can make your own snippets (shortcuts when typing) if you like really easily.
* SO MANY THEMES. Seriously, if it exists, the community probably made it.
* Very customizable with the whole slew of user-made stuff. And the main settings are also really flexible.
* Rather easy to use. Easier to use compared to Sublime, in my opinion.
* Free. It's made by the guys at GitHub, after all.

Cons:
* People have said it can be slow, but I haven't had that kind of problem with it.
* Some languages (like Lua) don't have syntax highlighting natively.

That's all I have.
1cc Easy: DDC (all) | 1cc Normal: UFO (SanA autobomb),  DDC (ReiA, SakA) , LoLK (Sanae PD)| EX clears: DDC (MarB Ultra) | Puzzle Games: StB: 10-X, DS: Hatate unlock, ISC: All clear

Sparen

  • Danmakufu Artist
  • Git ready, git set, PUUSH!
    • AFCDTech
Re: [Scripting Tool] Touhou Danmakufu Packages for Sublime Text and Atom
« Reply #29 on: May 21, 2016, 10:37:47 PM »
* People have said it can be slow, but I haven't had that kind of problem with it.

The first time I tried it, it was significantly slower than Sublime or the default text editor on Mac - TextEdit. The only code writing things I had that were slower were the Aquamacs GUI (takes forever to load) and Xcode (which is not functional for anything).