I will try it, as soon as I get home, since I am not satisfied with notepad+\+'s limited amount of keywords ;)
€ grr, stupid wikicreole
€ tried this one a bit, the syntax check seems nice; but the autocompletion really should include functions and parameters. For the basic types, noone really needs autocompletion.
What do you mean the autocompletion should include functions and parameters? It does include custom functions/locals/globals/structs. It will need to parse the imput before it can show the custom functions though. If you loaded the default skeleton, the program will parse everything, to collect all defined methods, structs, fields and locals. Everything includes whatever you included, such as NativeLib.galaxy, aswell as everything included in that file and so on. Parsing all that does take some time. After includes have been parsed, they get cached though, so next time you change your code, it wont parse includes again.
In the version im working on now I added a status bar to tell you how far it has come parsing the code - hope that helps once I release it.
Also, I might put parsed versions of the default libraries on the disc, so they wont need to be parsed at all.
Ah, okay. i was not aware you have to include, just tried it for a small portion of custom script, not for the whole map script.
Autocomplete is kinda laggy atm. When I press the button, I get like a .5 sec freeze before it shows the functions.
Also I would prefer a Notepad+ + like autocompletion, where you do not need to press a button, but it shows the options right away (and shows the parameters as you enter them). If easily possible, I would suggest changing that.
€ It seems like I am only bitching about the program xD. Take it as a try for constructive criticism; other than the things I mentioned, it seems to work just nice ;)
I'll try looking at improving the autocomplete.. Should be pretty simple if I write my own instead of using the one from the text box library.. So far I have been focusing on catching the rest of the errors, but I think I got that done, so I'll start looking at a new autocomplete system.. tomorrow :)
Allright, I added a new update - think I got all the bugs fixed.
Except, when you say "Some constants are not included", could you be more specific?
There is a bug that I am aware of though. The first time you type a character, control is passed to the autocomplete list. I can't seem to make it stop doing that, but it only happens first time, so you should be able to just click back into the text editor.
c_unitInventoryChangeLoses does not match any previously defined fields or locals
c_unitInventoryChangeUses does not match any previously defined fields or locals
c_unitInventoryChangeGains does not match any previously defined fields or locals
c_syncFrameTypeAchievementMenuButton does not match any previously defined fields or locals
c_syncFrameTypeTeamResourceButton does not match any previously defined fields or locals
All of them are valid constants.
€ trying to parse my map script with the new version causes the editor to crash (the old version only showed the mentioned errors)
I wanted to attach the error message and the map script, but did not find a hide / spoiler option and don't want to pollute the post ;) I will send you per PM, if you ask for it and have a need for it or edit them in as soon as I found hide or something ^^
€ could have just attached them... well, now I sent them per PM ;)
Seems that the reason for the missing constants might very well be that I only included the core trigger libs.. not the extra stuff from liberty.. There are some new stuff in there that I need to add to my editor, such as writing integers as 0x002 and static methods (if someone knows just what makes a static method special in galaxy, I would like to know). Also, how does the operator ! make sense for a point/order? (as in if(!myPoint) ...)
Anyway - if you dont mind sending me your script so I can trace the error, that would be awsame.
Seems that the reason for the missing constants might very well be that I only included the core trigger libs.. not the extra stuff from liberty.
There are some new stuff in there that I need to add to my editor, such as writing integers as 0x002 and static methods (if someone knows just what makes a static method special in galaxy, I would like to know). Also, how does the operator ! make sense for a point/order? (as in if(!myPoint) ...)
Dunno about the point thing, static functions cannot be called from another object (if you have a static function in a custom script object, you cannot use that function in another custom script object). Still needs to use an unique name, though -.- (did anyone find an alternative to prefixing yet? really sucks.)
Hmm. I am a bit lost - I took all the galaxy files from Starcraft II/Mods/Core.SC2Mod/Base.SC2Data / TriggerLibs, and then I overwrote what I could with files from Starcraft II/Mods/Liberty.SC2Mod/Base.SC2Data / TriggerLibs. I assume that is essientially what the editor is doing, but there are errors in the final script..
For example, the method AIDefaultGetObjectType is defined in AI.galaxy in line 467, and used in RequirementsAI.galaxy, which is included from AI.galaxy in line 4. That means that the method should not be visible when parsing RequirementsAI.galaxy :S
Also, AISetNukeGhost is called from TacticalAI line 340, but I haven't found a declaration anywhere.
There are other errors, so I'm guessing that I'm using the wrong library files, or missing some files.. anyone know where I should be looking?
Well, the campaign files are not loaded unless you add the campaigns as depencies, so it should work without them. Even so, the 2 files from campaign don't contain a definition of AISetNukeGhost, so I guess it wouldn't help much.. I could make my own little library file which patches all the errors, but meh.. feels crap, and it would have to be updated as people complain about missing methods/fields.. I would rather have the right library files to begin with.
Allright, I added a new update. which implements the crappy solution :)
Look in TriggerLibs/Patches.galaxy to add missing stuff. Also, please poke me if you find something missing, so I can update it for a future version.
Sorry for the long wait - I haven't had that much time the last couple of days, and there was an annoying bug that needed sorting.
So basically, this is a syntax error with the double ; but its valid galaxy code for the galaxy editor as well as your editor. Your editor just throws a warning, because the ; is after the return, thus unreachable.
The autocompletion for functions works nicely, however, I would like to see parameters as I type them.
Also I am not sure about the showed functions for autocompletion. Notepad+ shows only functions, which begin with the characters you entered, yours shows any function containing this set of characters. I think for the autocompletion, the notepad+ variant is more intuitive, you could implement your variant in an extra option, a native list or function search or something, which you can activate separately.
Syntax Highlightning for functions would be nice, as well.
Yeah, I display unreachable code as a warning, since it will compile and run but it isn't very nice to carry a bunch of unnecessary junk.
As for the auto completion.. It's possible that one only remember a part of the function name, and not the beginning. That's why I did it that way. It still sorts the list so if there are something that matches what you wrote from the beginning, that will be on top, so I don't think I'll change that.
For example, if you have something called aFoo, bFoo, fooA and fooB, and you type foo they will be listed as
fooA
fooB
aFoo
bFoo
About the display of parameters as you type them, yeah.. I have it on my to do list, so I'll get it done at some point.. Right now I'm experimenting with making it possible to run and debug the code.
Yeah, I display unreachable code as a warning, since it will compile and run but it isn't very nice to carry a bunch of unnecessary junk.
Well, still the question if a double semicolon should be unreachable code or a syntax error ;)
Quote:
As for the auto completion.. It's possible that one only remember a part of the function name, and not the beginning. That's why I did it that way. It still sorts the list so if there are something that matches what you wrote from the beginning, that will be on top, so I don't think I'll change that.
For example, if you have something called aFoo, bFoo, fooA and fooB, and you type foo they will be listed as
fooA
fooB
aFoo
bFoo
Does not work that way for me, the list is always alphabetically sorted, regardless of which part of the functions I entered (if I enter "Unit" for example, the first function shown is AIAbilityGroup, because its parameters contain the word unit)
But when this works like you intend, I agree, this would be the best solution, since you would not need an additional list, get the intuitive way and still have access to all related functions.
Quote:
What do you mean syntax highlight for functions?
When you entered a valid function name, it has the standard color of text. Just make it another color or bold similar to the keywords.
I noticed some more problems with the autocompletion: Sometimes the list will be shown in the background only (so you have to actually tab out of the script editor to see it). If this happens, you cannot select an item from the list, more specific it has no effect on the text editor if you do so, the selected function will not replace your last written word like it should.
I am not sure, when this happens, but if it happens once, it will not stop behaving that way until I restart the editor.
€ selecting an item from the list with the mouse does not seem to work in general. Selecting with arrow keys + enter works fine, but a mouse click does nothing and even mouseclick + enter has no effect.
€ and another crash when trying to create a new void function named "bla", it crashed, when I wanted to enter the "a". I was not able to reproduce this one.
Crash message (translated): Index out of bounds. Index must not be negative or smaller than the list. Parameter name: index.
Every time I start making a map, I get too fustrated with the custom script editor, so I decided to make my own.
It has features like syntax highlighting, autocompletion of keywords aswell as stuff defined by the user, and it reports errors
Hope someone other than me can find it usefull.
http://www.sc2mapster.com/assets/beiers-galaxy-script-editor/
If you find any bugs, or have a suggestion for extra features, please post about them ;)
Hey, this looks pretty good. Nice work.
\*must...try...out*
I will try it, as soon as I get home, since I am not satisfied with notepad+\+'s limited amount of keywords ;)
€ grr, stupid wikicreole
€ tried this one a bit, the syntax check seems nice; but the autocompletion really should include functions and parameters. For the basic types, noone really needs autocompletion.
What do you mean the autocompletion should include functions and parameters? It does include custom functions/locals/globals/structs. It will need to parse the imput before it can show the custom functions though. If you loaded the default skeleton, the program will parse everything, to collect all defined methods, structs, fields and locals. Everything includes whatever you included, such as NativeLib.galaxy, aswell as everything included in that file and so on. Parsing all that does take some time. After includes have been parsed, they get cached though, so next time you change your code, it wont parse includes again.
In the version im working on now I added a status bar to tell you how far it has come parsing the code - hope that helps once I release it. Also, I might put parsed versions of the default libraries on the disc, so they wont need to be parsed at all.
Ah, okay. i was not aware you have to include, just tried it for a small portion of custom script, not for the whole map script.
Autocomplete is kinda laggy atm. When I press the button, I get like a .5 sec freeze before it shows the functions.
Also I would prefer a Notepad+ + like autocompletion, where you do not need to press a button, but it shows the options right away (and shows the parameters as you enter them). If easily possible, I would suggest changing that.
€ It seems like I am only bitching about the program xD. Take it as a try for constructive criticism; other than the things I mentioned, it seems to work just nice ;)
By all means, keep bitching :)
I'll try looking at improving the autocomplete.. Should be pretty simple if I write my own instead of using the one from the text box library.. So far I have been focusing on catching the rest of the errors, but I think I got that done, so I'll start looking at a new autocomplete system.. tomorrow :)
No error when using FixedToString with only 1 parameter
Yeah - I havent released it yet - v1.1 doesn't catch everything
+=, -= etc is catched as syntax error (i+=1; -> syntax error, expecting "=")
Usage of array records, too (MyRecord[i].myMember=5; -> syntax error, expecting ";")
Some constants are not included
Just in case you are not aware ;)
Allright, I added a new update - think I got all the bugs fixed.
Except, when you say "Some constants are not included", could you be more specific?
There is a bug that I am aware of though. The first time you type a character, control is passed to the autocomplete list. I can't seem to make it stop doing that, but it only happens first time, so you should be able to just click back into the text editor.
The ones I noticed:
c_unitInventoryChangeLoses does not match any previously defined fields or locals
c_unitInventoryChangeUses does not match any previously defined fields or locals
c_unitInventoryChangeGains does not match any previously defined fields or locals
c_syncFrameTypeAchievementMenuButton does not match any previously defined fields or locals
c_syncFrameTypeTeamResourceButton does not match any previously defined fields or locals
All of them are valid constants.
€ trying to parse my map script with the new version causes the editor to crash (the old version only showed the mentioned errors)
I wanted to attach the error message and the map script, but did not find a hide / spoiler option and don't want to pollute the post ;) I will send you per PM, if you ask for it and have a need for it or edit them in as soon as I found hide or something ^^
€ could have just attached them... well, now I sent them per PM ;)
Seems that the reason for the missing constants might very well be that I only included the core trigger libs.. not the extra stuff from liberty.. There are some new stuff in there that I need to add to my editor, such as writing integers as 0x002 and static methods (if someone knows just what makes a static method special in galaxy, I would like to know). Also, how does the operator ! make sense for a point/order? (as in if(!myPoint) ...)
Anyway - if you dont mind sending me your script so I can trace the error, that would be awsame.
Dunno about the point thing, static functions cannot be called from another object (if you have a static function in a custom script object, you cannot use that function in another custom script object). Still needs to use an unique name, though -.- (did anyone find an alternative to prefixing yet? really sucks.)
done.
Hmm. I am a bit lost - I took all the galaxy files from Starcraft II/Mods/Core.SC2Mod/Base.SC2Data / TriggerLibs, and then I overwrote what I could with files from Starcraft II/Mods/Liberty.SC2Mod/Base.SC2Data / TriggerLibs. I assume that is essientially what the editor is doing, but there are errors in the final script..
For example, the method AIDefaultGetObjectType is defined in AI.galaxy in line 467, and used in RequirementsAI.galaxy, which is included from AI.galaxy in line 4. That means that the method should not be visible when parsing RequirementsAI.galaxy :S
Also, AISetNukeGhost is called from TacticalAI line 340, but I haven't found a declaration anywhere.
There are other errors, so I'm guessing that I'm using the wrong library files, or missing some files.. anyone know where I should be looking?
There are Triggerlibs in following paths:
mods/core.sc2mod/base.sc2data
mods/liberty.sc2mod/base.sc2data
campaigns/liberty.sc2campaign/base.sc2data
campaigns/libertystory.sc2campaign/base.sc2data
You got them all?
Well, the campaign files are not loaded unless you add the campaigns as depencies, so it should work without them. Even so, the 2 files from campaign don't contain a definition of AISetNukeGhost, so I guess it wouldn't help much.. I could make my own little library file which patches all the errors, but meh.. feels crap, and it would have to be updated as people complain about missing methods/fields.. I would rather have the right library files to begin with.
Allright, I added a new update. which implements the crappy solution :) Look in TriggerLibs/Patches.galaxy to add missing stuff. Also, please poke me if you find something missing, so I can update it for a future version.
Sorry for the long wait - I haven't had that much time the last couple of days, and there was an annoying bug that needed sorting.
Interesting. My map script still throws errors:
Seems to be an issue in the native lib? dunno
My line 1186:
So basically, this is a syntax error with the double ; but its valid galaxy code for the galaxy editor as well as your editor. Your editor just throws a warning, because the ; is after the return, thus unreachable.
The autocompletion for functions works nicely, however, I would like to see parameters as I type them.
Also I am not sure about the showed functions for autocompletion. Notepad+ shows only functions, which begin with the characters you entered, yours shows any function containing this set of characters. I think for the autocompletion, the notepad+ variant is more intuitive, you could implement your variant in an extra option, a native list or function search or something, which you can activate separately.
Syntax Highlightning for functions would be nice, as well.
Yeah, I display unreachable code as a warning, since it will compile and run but it isn't very nice to carry a bunch of unnecessary junk.
As for the auto completion.. It's possible that one only remember a part of the function name, and not the beginning. That's why I did it that way. It still sorts the list so if there are something that matches what you wrote from the beginning, that will be on top, so I don't think I'll change that.
For example, if you have something called aFoo, bFoo, fooA and fooB, and you type foo they will be listed as
fooA
fooB
aFoo
bFoo
About the display of parameters as you type them, yeah.. I have it on my to do list, so I'll get it done at some point.. Right now I'm experimenting with making it possible to run and debug the code.
What do you mean syntax highlight for functions?
Well, still the question if a double semicolon should be unreachable code or a syntax error ;)
Does not work that way for me, the list is always alphabetically sorted, regardless of which part of the functions I entered (if I enter "Unit" for example, the first function shown is AIAbilityGroup, because its parameters contain the word unit)
But when this works like you intend, I agree, this would be the best solution, since you would not need an additional list, get the intuitive way and still have access to all related functions.
When you entered a valid function name, it has the standard color of text. Just make it another color or bold similar to the keywords.
I noticed some more problems with the autocompletion: Sometimes the list will be shown in the background only (so you have to actually tab out of the script editor to see it). If this happens, you cannot select an item from the list, more specific it has no effect on the text editor if you do so, the selected function will not replace your last written word like it should.
I am not sure, when this happens, but if it happens once, it will not stop behaving that way until I restart the editor.
€ selecting an item from the list with the mouse does not seem to work in general. Selecting with arrow keys + enter works fine, but a mouse click does nothing and even mouseclick + enter has no effect.
€ and another crash when trying to create a new void function named "bla", it crashed, when I wanted to enter the "a". I was not able to reproduce this one.
Crash message (translated): Index out of bounds. Index must not be negative or smaller than the list. Parameter name: index.
Crash Log attached (its german, though)