Blockly for JASS

Before starting this post, I want to talk a bit about the background.

Back in 2010, during the summer break before starting middle school,
I accidentally opened world editor.exe while exploring the installation directory of Warcraft III.

In the days that followed, the world editor (especially the trigger editor) became the software that introduced me to programming.
It gave me enough positive feedback through the game to learn about variable types, branches, counting loops, Boolean logic, and so on,
sparking my interest in computer programming.

What happened here is actually very similar to another post; in short, the World Editor influenced us.
After that, the wheels of fate began to turn—I went to college, graduated, started working, changed jobs, and many, many things happened.

Nowadays, on weekdays, I work as an IT support (not a developer),
and on weekends part-time I teach programming courses to K12 students (including Scratch, Python, and C++).

Kids today use Scratch to create mini-games and interactive stories to get positive feedback,
through which they learn programming control flow and simple algorithms.

Alright, now we’re finally very close to what this post is about. We really took a long detour.
The Scratch I mentioned earlier is actually based on Google’s Blockly project, and Blockly is exactly what I referred to in the title.
In short, Blockly allows you to write code by dragging and dropping blocks
As developers, we can read the documentation to create our own Blockly and support the languages we want; of course, here I mean JASS.
Basically, you just need to edit the files [src/index.js] [src/toolbox.js] [src/blocks/jass.js] [src/generators/jass.js]
and you can get a Blockly that can generate JASS code
1766565258503.png

You can see the blocks I dragged to the workspace on the right side of the picture, and the code generated in real-time on the left side.
This is just a demonstration picture; I haven’t actually implemented the subsequent classification and blocks.
1766566862364.png

Imagine if we actually created a full Blockly for JASS and we could use various fun block components to write JASS code.
We would have a development tool that relies more on the mouse than the keyboard.
it certainly wouldn't be a mainstream development tool, but it's appealing enough, isn't it?

I think this is an interesting and promising project, at the very least a good starting point.

If you read the development documentation, you will find that Blockly already supports generating Lua code.
I guess that with just some simple plugin development or similar work, it can serve Warcraft III map development,
even though the title of this post is 'Blockly for JASS'.
 
Last edited:
Back
Top