Yeah, I can change the static behavior for my language atleast.. in the mean time, you can use namespaces "#namespace <name>" at the start of the file to declare a namespace for the file.. you can the use same dot notation as for structs to refference stuff in namespaces, or you can use "#using <name>" to be able to refference all stuff in the other namespace.
Ah, okay. Namespace would be exactly what I want. Can you exclude objects, so you can store them in the namespace, but declare them for public usage without the namespace "prefix"?
I'm not sure I follow.. you want an item declared within the namespace to not be in the namespace? If so, that seems like an odd feature..
If the problem is that you don't want to write the namespace prefix all the time, you could just use the using keyword.
Well, it would be like having a public and a private keyword (sort of). Everything in a namespace is "private" per default, you need the namespace's name to access it. But a "public" function can be accessed from anywhere without the need of the namespace's name. This was a common feature for Jass script extensions in Wc3, so I am used to it :D
Well, for example for vJass within a scope - which was basically a namespace - you could declare stuff as private (prefixed and not accessible outside of the scope), public (prefixed but accessible) or not at all (no prefix and accessible, just like a normal function outside of the scope)
I didn't make it all (yet), but I thought I would upload what I have done.
Fixed an error where using short names could rename stuff to an elligal name.
Added a way to call the gui function Preload Bank (use #PreloadBank(string bank, int player); - not inside functions, and only explicit literals as parameters)
Added line numbers to the editor.
Added an option to deactivate files. Deactivated files will not be compiled.
Changed the compile/run shortcuts to F9/ ctrl + F9.
When compiling, if no changes was done since last successful compilation, compilation will be skipped.
Removed some warnings about unused variables that are generated.
Hidden folders will now remain hidden during compilation, and when the program is restarted.
New folders and files will now be created in rename mode with a default name.
Files and folders can now be dragged around - not restricted to alphabetic sorting anymore.
Added an option to obfuscate strings.
The check for unused variables is now done before merging variables.
Fixed a bug that would give multidimentional arrays the wrong size.
Fixed a bug that created unnecessary bulkCopyVar variables.
Fixed a crash that occured when pressing ctrl-f with text marked.
Great :D. Now at least my specific map script morks. Lets hope, I implemented all the bugs which could be made in my script :D
€ I deleted all the stuff still marked as unused or never read, and apparently 8 variables shown as never read are used and needed, the parser somehow misses them.
Also I really missed an undo feature after this :D
When I try to delete variables that are not needed in the code you gave me, it only showed me variables that aren't needed. Some of them are being assigned to, yes, so that caused some errors, but if a variable is only ever assigned to, then it's not needed. Remember, the message only promises you that the variable is not being read - not that it is never used. But it is still safe to delete it.
Custom order does not seem to work for folders. Files can be ordered by dragging one file on the other, this will place the dragged file on top of or below the other one. For folders, this places the dragged folder within the other one, making it impossible to change the order for folders within the same folder, unless you use a dummy file.
Also, my debugger still shows 3 variables only. Everything works fine, though...
€ ah, okay, it only shows the variables declared in the MapScript.galaxy file, all other variables are not shown in the debugger.
Creating a new file or folder and not renaming it immediately causes an unhandled exception, so does trying to rename a file and then cancelling it.
Instead of the error message, that files must have the .galaxy+ + type, just add the type, if its missing.
If you do not finish one line of script and want to start another one, autocompletion won't show up (probably intended).
Also, how do you publish a map exactly? Testing works fine, but publishing it would use the original triggers again, wouldn't it? Do I need to manually import the script files?
€ I can publish the map now by taking the output file (Galaxy+ + Test Map), opening it in the editor, deleting all triggers and adding a new custom script containing all the required stuff from the MapScript.galaxy file (this one will be overwritten anyways). Is there already a better possibility and I just did not see it?
When you add the script files and the map script, you could remove the triggers. They are ignored anyway and just use up mapspace.
Maybe add native support for an initializer function (per file or per namespace?).
Renaming a file does not change its name in the editing window, if the file is already opened.
After closing a file, you cannot re-open it. Same thing happens sometimes, if you opened source files and try to open matching output files.
Is there a way to reference namespace functions in triggers? Using the string "<namespace name>.<function name>" does not work.
Your parser cannot handle hexadecimal and octagonal numbers.
inti=0xFF;intj=077
i should be 255, j should be 63, but both of them result in a syntax error.
If you just opened an already compiled object, it does not count as compiled, when you test it.
If you do not finish one line of script and want to start another one, autocompletion won't show up (probably intended).
Yes, this is intended.. all whitespace are ignored, so you can actually write a statement out on multiple lines, as long as you don't put whitespace inside identifiers. If you don't wanna finish the statement, then you should comment it.
Also, how do you publish a map exactly? Testing works fine, but publishing it would use the original triggers again, wouldn't it? Do I need to manually import the script files?
Hehe.. this is something that I didn't actually think about :) Ill create a compile and save button. In the meantime, you can run the map, and find the map that was run in "Starcraft II\\Maps\\Test\\Galaxy++TestMap.SC2Map". Open that in the Starcraft II Editor, and you should be able to publish it.
When you add the script files and the map script, you could remove the triggers. They are ignored anyway and just use up mapspace.
I'm not sure I follow. If I remove all the triggers, the map won't run.. At least not if you had planned to use any of the triggers. Could you clarify this?
Is there a way to reference namespace functions in triggers? Using the string "<namespace name>.<function name>" does not work.
Triggers are handled no different than other functions in regards to what they can see/reference. If you have parser errors in the script, the autocomplete list might not be updated (check by compiling). Also, if you are already in the namespace, it will not be suggested in the autocompletion list, since you don't need to use the dot to refference stuff in there (you can still use the dot if you wish though).
Hehe.. this is something that I didn't actually think about :) Ill create a compile and save button. In the meantime, you can run the map, and find the map that was run in
"Starcraft II Maps Test Galaxy+ +TestMap.SC2Map".
Open that in the Starcraft II Editor, and you should be able to publish it.
As soon as you open the map in the editor, the MapScrip.galaxy file is overwritten and reconstructed by the triggers in the map. afaik.
I'm not sure I follow. If I remove all the triggers, the map won't run.. At least not if you had planned to use any of the triggers. Could you clarify this?
I do not talk about the trigger objects in the script, I am talking about the triggers in the actual map.
Your editor is supposed to replace the default map script, which will not work together with usual triggers anyway. The triggers are also editor-only, just the map script is important to play the map.
Quote:
Triggers are handled no different than other functions in regards to what they can see/reference. If you have parser errors in the script, the autocomplete list might not be updated (check by compiling). Also, if you are already in the namespace, it will not be suggested in the autocompletion list, since you don't need to use the dot to refference stuff in there (you can still use the dot if you wish though).
I do not talk about the trigger objects in the script, I am talking about the triggers in the actual map.
Ah, right - Ill look around for the gui trigger data.
As for the last thing.. you can only use explicit references in TriggerCreate at the moment. By that I mean no dots - the target function must be visible without the dot notation. In your example above, it is visible though. You should write this
As far as I can see, it's overwritten if you make any changes in the gui triggers - its a simple test really.. Open and try to run.
I tested it. As soon as you open the trigger menu, the map script shown when pressing ctrl + F11 gets overwritten. So I assumed, it would replace the map script in the actual map archive as well.
But you are right, as long as you do not touch the triggers, the map will still use the injected map script.
Another thing I noticed: When testing with the galaxy editor, my hero pick mode (a game attribute chooseable in the lobby) is always pick heroes, but when starting with the galaxy+ + editor, it is always random heroes. Probably nothing to worry about, though.
The search hotkey (ctrl + f) creates an unhandled exception (OpenFileData cannot be converted to xxx.FileItem). Also, it places the "f"s in the script.
If you search for definitions, it would be nice, if there was an indication, where the definition is.
Maybe, if you mark a void function without parameters using #trigger, add the bool parameters and return values automatically? So you could use:
So basically, a simple method to start a function in it's own thread, like in Gui.
If I define 2 functions in different namespaces using the same name, they seem to get the namespace prefix and a "O2" suffix. In this case, using the name given to the function as a string for a trigger does not work.
When calling void functions from namespaces, the autocompletion works nicely and only shows members of the namespace after typing the name. When setting variables to namespace members, this does not work.
Maybe, if you mark a void function without parameters using #trigger, add the bool parameters and return values automatically?
Hmm.. I don't know about this.. I assume you want it so that you don't have to supply the two booleans when calling the function, but the same behavior can be achieved by calling an inline wrapper function..
When calling void functions from namespaces, the autocompletion works nicely and only shows members of the namespace after typing the name. When setting variables to namespace members, this does not work.
I'm not sure I understand what you mean. It appears to be working for me.. Could you give a short example?
Hmm.. I don't know about this.. I assume you want it so that you don't have to supply the two booleans when calling the function, but the same behavior can be achieved by calling an inline wrapper function..
Its just for convenience, so I do not have to write the 2 parameters and return a value, whenever I use a trigger.
Quote:
I'm not sure I understand what you mean. It appears to be working for me.. Could you give a short example?
I could not reproduce this, either. If it happens again, I will notify you.
When in the autocompletion, mouse wheel should scroll the function list, not your code.
Uploaded the next big update. The language is getting quite a lot of features - think it's about time to get started on a good documentation. I'll make it on the asset page.
This is what I changed for this release (1.7.0).
The compiler now removes dead code (code that can not be reached by any execution paths)
Added support for switches. (#switch (foo) {#case 1: ... #case bar(): ... #default: ... })
Added support for people to define a library, its supported versions and any decencies. The initializer of any decencies will be called before the current initializer. All "arguments" and the method body is optional.
Added support for initializers. (#Initializer{...})
If no main entry is defined, one will now be added
Added the #InvokeAsync keyword. Use this to run the target method in a new thread. It is not possible to get any return values from this. (#InvokeAsync<ns.method>(args..))
Added the #Invoke keyword. Use this to run a function in a new "trigger". Doing this will reset the ammount of operations you can do. (#Invoke<namespace.method>(args..))
Fixed a bug where multiple assignments in one statement caused a crash.
The editor now supports hexadecimal(0xaF) and octal(057) numbers.
GUI trigger data is now being removed from the map when compiling.
If you have a non-literal TriggerCreate, and two triggers of same name, the compiler now reports it as an error.
Fixed a bug where the compiler would not see renamed files as a reason to allow recompilation.
Fixed an error where the name of a renamed file would not change in the editing window.
When renaming files, if they don't end with ".galaxy++", the program will now just append it.
In the project view, dragging stuff on top of non empty folders no longer moves the item inside the target folder.
It's now possible to refference triggers from other namespaces (TriggerCreate("namespace1.foo")).
Fixed a bug that sometimes caused trigger refferences to refference the wrong trigger.
Fixed a bug where output files sometimes wouldn't open.
Fixed a crash that occured when pressing ctrl + f
Added an option for compile and save, for when you want to publish your map.
I find it very hard to get a feel for how many people actually use this tool. I don't see any way to see download count or anything - all I really have to go for is this thread.
The editor has come a long way since it was first released, and I will keep developing it as long as I get feedback, but I would be lying if I said I didn't care if anyone use it. After spending so much time on it, it would be nice to know how many people actually find it useful, and to how many it's just another tool floating about.
Yeah, I can change the static behavior for my language atleast.. in the mean time, you can use namespaces "#namespace <name>" at the start of the file to declare a namespace for the file.. you can the use same dot notation as for structs to refference stuff in namespaces, or you can use "#using <name>" to be able to refference all stuff in the other namespace.
Ah, okay. Namespace would be exactly what I want. Can you exclude objects, so you can store them in the namespace, but declare them for public usage without the namespace "prefix"?
I'm not sure I follow.. you want an item declared within the namespace to not be in the namespace? If so, that seems like an odd feature..
If the problem is that you don't want to write the namespace prefix all the time, you could just use the using keyword.
For instance
Well, it would be like having a public and a private keyword (sort of). Everything in a namespace is "private" per default, you need the namespace's name to access it. But a "public" function can be accessed from anywhere without the need of the namespace's name. This was a common feature for Jass script extensions in Wc3, so I am used to it :D
Well, for example for vJass within a scope - which was basically a namespace - you could declare stuff as private (prefixed and not accessible outside of the scope), public (prefixed but accessible) or not at all (no prefix and accessible, just like a normal function outside of the scope)
I didn't make it all (yet), but I thought I would upload what I have done.
Great :D. Now at least my specific map script morks. Lets hope, I implemented all the bugs which could be made in my script :D
€ I deleted all the stuff still marked as unused or never read, and apparently 8 variables shown as never read are used and needed, the parser somehow misses them.
Also I really missed an undo feature after this :D
@Kueken531: Go
When I try to delete variables that are not needed in the code you gave me, it only showed me variables that aren't needed. Some of them are being assigned to, yes, so that caused some errors, but if a variable is only ever assigned to, then it's not needed. Remember, the message only promises you that the variable is not being read - not that it is never used. But it is still safe to delete it.
€ ah, okay, it only shows the variables declared in the MapScript.galaxy file, all other variables are not shown in the debugger.
€ I can publish the map now by taking the output file (Galaxy+ + Test Map), opening it in the editor, deleting all triggers and adding a new custom script containing all the required stuff from the MapScript.galaxy file (this one will be overwritten anyways). Is there already a better possibility and I just did not see it?
i should be 255, j should be 63, but both of them result in a syntax error.
Yes, this is intended.. all whitespace are ignored, so you can actually write a statement out on multiple lines, as long as you don't put whitespace inside identifiers. If you don't wanna finish the statement, then you should comment it.
Hehe.. this is something that I didn't actually think about :) Ill create a compile and save button. In the meantime, you can run the map, and find the map that was run in
"Starcraft II\\Maps\\Test\\Galaxy++TestMap.SC2Map"
.Open that in the Starcraft II Editor, and you should be able to publish it.
I'm not sure I follow. If I remove all the triggers, the map won't run.. At least not if you had planned to use any of the triggers. Could you clarify this?
Triggers are handled no different than other functions in regards to what they can see/reference. If you have parser errors in the script, the autocomplete list might not be updated (check by compiling). Also, if you are already in the namespace, it will not be suggested in the autocompletion list, since you don't need to use the dot to refference stuff in there (you can still use the dot if you wish though).
This is actually intended, but I can add an option for it.
As for the rest, Ill have a look at it.
As soon as you open the map in the editor, the MapScrip.galaxy file is overwritten and reconstructed by the triggers in the map. afaik.
I do not talk about the trigger objects in the script, I am talking about the triggers in the actual map.
Your editor is supposed to replace the default map script, which will not work together with usual triggers anyway. The triggers are also editor-only, just the map script is important to play the map.
Not sure, if you got, what i mean.
I have no idea, how to reference the function for the trigger in this case.
As far as I can see, it's overwritten if you make any changes in the gui triggers - its a simple test really.. Open and try to run.
Ah, right - Ill look around for the gui trigger data.
As for the last thing.. you can only use explicit references in TriggerCreate at the moment. By that I mean no dots - the target function must be visible without the dot notation. In your example above, it is visible though. You should write this
I sort of want this:
So basically, I am screwed right now? ;)?
I tested it. As soon as you open the trigger menu, the map script shown when pressing ctrl + F11 gets overwritten. So I assumed, it would replace the map script in the actual map archive as well.
But you are right, as long as you do not touch the triggers, the map will still use the injected map script.
Another thing I noticed: When testing with the galaxy editor, my hero pick mode (a game attribute chooseable in the lobby) is always pick heroes, but when starting with the galaxy+ + editor, it is always random heroes. Probably nothing to worry about, though.
The search hotkey (ctrl + f) creates an unhandled exception (OpenFileData cannot be converted to xxx.FileItem). Also, it places the "f"s in the script.
If you search for definitions, it would be nice, if there was an indication, where the definition is.
Maybe, if you mark a void function without parameters using #trigger, add the bool parameters and return values automatically? So you could use:
Maybe you could even add an alternative to function calling, like vJass' .execute:
which would translate to
So basically, a simple method to start a function in it's own thread, like in Gui.
If I define 2 functions in different namespaces using the same name, they seem to get the namespace prefix and a "O2" suffix. In this case, using the name given to the function as a string for a trigger does not work.
When calling void functions from namespaces, the autocompletion works nicely and only shows members of the namespace after typing the name. When setting variables to namespace members, this does not work.
http://screenshot.su/show.php?img=80f9e6ed122239151c942e82ada4ae6d.jpg
it took only 1 minute lol.
so... can you add the switch construction?
like this: http://screenshot.su/show.php?img=d79d58ff21fbdc8e7b03b09dbd7d9827.jpg
Hmm.. I don't know about this.. I assume you want it so that you don't have to supply the two booleans when calling the function, but the same behavior can be achieved by calling an inline wrapper function..
I'm not sure I understand what you mean. It appears to be working for me.. Could you give a short example?
Keep testing it, need those nasty bugs exterminated :)
Sure, I can do switches - I'll put it on my list.
Its just for convenience, so I do not have to write the 2 parameters and return a value, whenever I use a trigger.
I could not reproduce this, either. If it happens again, I will notify you.
When in the autocompletion, mouse wheel should scroll the function list, not your code.
Uploaded the next big update. The language is getting quite a lot of features - think it's about time to get started on a good documentation. I'll make it on the asset page.
This is what I changed for this release (1.7.0).
++
", the program will now just append it.Great, I have waited for this.
*tries to download...*
Damn, not uploaded yet :D
It is uploaded.. but a moderator must approve the files first - I might be trying to infect you with a virus or something ;)
Edit: Added a documentation on the asset page:
http://www.sc2mapster.com/assets/galaxy-editor-beier/
I find it very hard to get a feel for how many people actually use this tool. I don't see any way to see download count or anything - all I really have to go for is this thread.
The editor has come a long way since it was first released, and I will keep developing it as long as I get feedback, but I would be lying if I said I didn't care if anyone use it. After spending so much time on it, it would be nice to know how many people actually find it useful, and to how many it's just another tool floating about.