HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Jass Editor 1.0 - Syntax Highlighting and more

09-15-2003, 05:54 PM#1
KaTTaNa
Some time ago I put the task of creating the best Jass Editing Environment possible onto myself.
I will soon release Jass Editor 1.0
But first I'd like to ask: Is there already an application names Jass Editor? If so I will have to make up a new name, and that is not going to be KaTTaNa's Jass Editor because I don't like those kind of names.

Well, back to the editor.
Currently it has the following features implemented:
- Syntax Highlighting
- Functions and Constants Explorer (see screenshot)
- Declaration preview (see screenshot)
- Auto-Indent (keeps the indent when you start a new line)
- Load text from currently open Trigger in the Trigger Editor

Things needing to be implemented:
- Save text to currently open Trigger in the Trigger Editor

Performance:
- Takes 375 milliseconds to load and syntax highlight 79 lines of code .
- Takes about 2200 milliseconds to load and syntax highlight 655 lines of code (nobody should write triggers that long anyway).

Note: These times were observed on a 2.2GHz machine running Windows XP.
Of course, files with very long lines takes longer time to load. The files I used above were 2.78KB and 31.7KB respectively.

*In case you forgot what a millisecond is, 1000 milliseconds equals 1 second

On the screenshot, the bar to the right is the Function/Constant Explorer. The box in the bottom is the declaration preview, where you can see which parameters the functions take and what they return. For constants, it displays their type and value.

I will upload this soon, only needs a new final touches and it's done. In the next version, I might implement Syntax Checking too.
09-15-2003, 07:28 PM#2
Starcraftfreak
Have you programmed that in Delphi? If yes, can you give me the source? Don't fear that I steal your program. I just want to learn some things about syntax highlighting, etc. and I'm also a Delphi programmer.
Hell, as a programmer, I know what it means to steal the code and I won't publish modified versions anywhere without your permission.
09-15-2003, 11:47 PM#3
AIAndy
That looks quite nice. Especially the function explorer. Are the functions and natives from both common.j and Blizzard.j in there? If a function name from there is written in the text, will the function be automatically looked up in there?

Quote:
Originally posted by KaTTaNa

- Takes about 2200 milliseconds to load and syntax highlight 655 lines of code (nobody should write triggers that long anyway).
The current AMAI common.ai has 8588 lines of code, so yes, when writing AI scripts or working with Blizzard.j, things can be very long and 20 seconds for loading it would be a bit long delay.
09-16-2003, 12:39 AM#4
Earth Fury
im lookign forword to seeign this tool. will be grat for us noobs.
09-16-2003, 01:15 AM#5
Zycat
w00t nice work, I might use it instead of the plain ol' notepad

Quote:
Originally posted by AIAndy
The current AMAI common.ai has 8588 lines of code, so yes, when writing AI scripts or working with Blizzard.j, things can be very long and 20 seconds for loading it would be a bit long delay.

My common A.I has 4961 lines of code and 190KB large in size. Individual race files are about 70-75 KB in size.
09-16-2003, 04:54 AM#6
Nozdormu
I eagerly await.
09-16-2003, 02:18 PM#7
KaTTaNa
Hmm... I never make AI myself, are there any special commands or something I should include which aren't in Jass?
The functions in the Functions tab are both from common.j and Blizzard.j
Those from common.j are both native and constant native.
The constants are only real constants (eg. no global variables).

I will try and optimize the loading speed event further, but dang it's pretty hard, it used to be 5 minutes about loading the 655 lines before I started optimizing :bgrun:

Starcraftfreak: It is written in Delphi 7 Enterprise so there is a chance that you won't even be able to load it up. You can see the source code when it's done, but don't expect to learn anything useful, my code is very ugly and uncommented.

To everyone: Feel free to add features to the wishlist.
09-16-2003, 02:35 PM#8
KaTTaNa
Whooops! I forgot to say what the small box just abve the Function explorer is for. It kind of a search box. Whenever you alter its contents, the Function/Constant explorer sorts out all the functions/constants not starting with the given text.
For example, if you type "GetSumm" in the box, the explorer will only show you "GetSummonedUnit" and "GetSummoningUnit" (assuming that you are under the Functions tab).
You can also type "event" and go under constants to see the different types of events.
09-16-2003, 03:36 PM#9
PitzerMike
My whishlist:

-> You should be able to edit Blizzard.j and AI-Files
-> For AI-files the native functions from common.ai would be used
-> It should read in functions dynamically. So if I place my edited Blizzard.j or Common.ai file in the scripts folder of your editor it should also read in the custom functions and globals I added.
-> Make sure that this add-code to currently open trigger feature will also work for the map script head (if you select the map name in the trigger editor, where you can add your custom functions to the head of the map script)

I'm really looking forward to that editor. Seems to be the tool I've always been waiting for.

One question: Does the editor also check the syntax of my code? I guess that's not possible as the editor doesn't know which globals I have in my map.
09-16-2003, 04:47 PM#10
KaTTaNa
Syntax Checking is not included, might be in a later version. If I do add it I will make it treat words starting with udg_ as declared variables of any type.

You can open the file of your choice, so if I can optimize it so it loads faster it will be able to edit *.j files without problems.

All the functions from common.j are already included. Both native and constant native.

It loads the functions from a file called Func.txt which contains all the declarations of the functions. You will have to place your own functions in that file. The constants are declared in Const.txt.
You can, in fact, also change the keywords and their syntax by changing the file Syn.txt.
I consider making a new tab called Custom, which loads from Custom.txt to make it easier to find your own functions.

The editor does not load global variables, only constants and functions (including natives).

The editor will load the text from the script head, if it is selected in the Trigger Editor.

EDIT - Fixed a lot of typos and meaning less text
09-16-2003, 06:53 PM#11
KaTTaNa
To keep you updated it can now save the text to the Trigger Editor like I said it would.
09-17-2003, 07:55 AM#12
PitzerMike
Quote:
Originally posted by KaTTaNa
All the functions from common.j are already included. Both native and constant native.


I meant common.ai. Because AI files take their natives from common.ai but also most of the funcs in common.j do work in ai scripts (but not functions from blizzard.j). So if you reallly want to enable editing ai scripts you'll have to consider that.

Other than that it sounds really cool
09-17-2003, 08:06 AM#13
Starcraftfreak
Why not just add something to load the functions from defined libraries. Add some settings dialog, where you can add libraries.
09-17-2003, 02:26 PM#14
KaTTaNa
Okay, I will probably add another tab called AI then.
About loading up your own libraries, this option will definately be implemented.
Regarding performance, the major source of the long loading time appears to be in the function which finds the syntax of a word. I am currently implementing binary lookup instead of lineary (which should reduce loading time greatly).

Note that the release date will be pushed a bit ahead because of the extra work. 8))
09-17-2003, 07:57 PM#15
Starcraftfreak
While you mention the topic libraries I got another suggestion:
You may know, that the only customizeable libraries are blizzard.j and common.ai (you can't just write your own library). So a nice feature would be to merge custom libraries into a blizzard.j.