Did you add a message to the report? If so, I would very much like to have the code.
I would never include the user's code in the error reports without asking him. All I get is the message you type, and the location in my code where the error occurred.
Edit:
Uploaded a new version. v2.3.5
It is now possible to initialize struct/class fields. This works for both dynamic and static types.
Struct variables can now be marked as const.
When possible, the compiler will now remove const variables and replace refferences to the variable with a copy of the initializer.
Speaking of update, it seems the editor crashes all the time once I've auto updated which makes me have to reinstall the editor. I'll send you a crash report on the next update
Okay. The update feature appears to be working at my end.
Could you try relaunching the editor when it crashes?
Also, does the Update folder exists? If so, are there any files in it? If the Updater.exe file is there, is it still running?
Could you try checking that at next update if it still crashes?
I'm gonna assume that all your source files are in folders. A fix for you until the next version should be to just create an empty script file outside of any folders.
Edit:
I uploaded a new version. v2.3.7
Struct/class fields can now be marked as static. There will only be one instance of static struct variables.
Fixed an issue where the compiler would sometimes crash when all source files is in folders.
Added enheritance. See documentation. (Note: no overriding, or casts)
Fixed an issue where initialized struct variables would overwrite any assignments done in the declaration of a local variable.
Fixed an issue where creating a new object with a constructor sometimes caused a crash.
Edit: would it be possible to make it possible to compile via a command line? That way it could work cross-platform aswell as making it possible to use any editor of choice. I would also probably contribute with a plugin for some other editor if this was implemented.
Soo, currently I am a little into galaxy scripting again, and I have some questions:
How to use structs? I tried to find it in your documentation, but I did not find, how to set up a constructor, how to create a struct instance and how to destroy one.
I am used to Jass/ZinC structs mainly, which would be used like this:
StructFoo(){intb;inta;intr;staticthistypecreate(){//thistype equals Foothistypethis=allocate();//allocates the new struct instancethis.b=5.a=3r=1//all 3 ways to set members are validreturnthis;//constructor needs to return the struct instance}}
How would this translate to G++?
If you use a struct containing only methods and static members, your output script will not create a struct at all, but declaring an instance of the struct is still valid syntax for your input file and will be transferred in the output file, which causes a syntax error, because the struct doesn't exist in the output file.
Are static methods possible? If I try it, I get an "expect constant or identifier" message.
//Not capital Struct, and no () in the struct declarationstructFoo{intb;inta;intr;//No static constructors - it wouldn't really make sense//Constructors are like methods, but have no return type, and the same name as the enclosing structFoo(){//thistype this=allocate(); //The struct will be allowcated when you call #new Foo(). Then the constructor will automatically be called#this->b=5;//#this - not this, and -> instead of . since #this is a pointer to the newly created object#this->a=3;//You were missing #this - really, .a is not valid#this->r=1;//Yeah, r=1 should probably be valid, but at the moment, it isn't//And you forgot a bunch of ; in those 3 lines.//return this;//Constructors don't return an instance - they are called after a new instance has been created by #new}}
Ah, the new and delete statements are explained in the pointers section. I tried to find them in the struct section.
A suggestion: Would it be possible to include the Galaxy++ code in the map? Maybe as custom script or comment files, in the same folder structure you used in the G++ editor? This way, you have all your script in the map, and maybe you could add functionality to extract this script from the map to your editor; this way the additional script files would become obsolete.
Its not desperately needed, though, but it might be very convenient. You could make this optional as well.
Quote from Kueken531:
Ah, the new and delete statements are explained in the pointers section. I tried to find them in the struct section.
A suggestion: Would it be possible to include the Galaxy++ code in the map? Maybe as custom script or comment files, in the same folder structure you used in the G++ editor? This way, you have all your script in the map, and maybe you could add functionality to extract this script from the map to your editor; this way the additional script files would become obsolete.
Its not desperately needed, though, but it might be very convenient. You could make this optional as well.
----
Like uncompiled? Because when you compile and run it should be compiled and in the output map?
I think he means uncompiled - to keep all the map data in one file. It would require some restructuring, but it's of course not impossible
Edit:
Although, my compiler will not be able to save if the map is open in the normal editor.
Edit2:
I uploaded version 2.4.5
Added an option to automatically inline small methods (less than 3 statements).
Added some optimizations to remove assignments to local variables that are only used once.
Added an option to save the galaxy++ files inside the map (look in project properties).
You can now refere to struct variables from inside constructors without prefixing with #this.
Fixed an issue where fields who's type is a struct with no non static variables, was not removed.
Fixed some bugs.
Edit3:
A word of advice, make backups if you want to use the script to map feature. Were it not for my automatic backups, I would have lost my map script, because I told the editor to extract the script from the wrong map.
Edit4:
Fixed some bugs. v 2.4.6
Fixed a crash caused by string obfuscation.
Fixed a potential infinite loop in the script optimizations.
Added an option to save the galaxy++ files inside the map (look in project properties).
And there I thought, this might be too complicated and probably nothing you would care about too much. Piece of cake, huh?
Gonna test this as soon as I get home.
€ how you write out your ++ without any visual indicator? I usually make one of the + bold ;) (or use plain text markup, but thats not what you did. Another markup?)
Edit:
I am a bit conflicted about the # in front of all the keywords, and would like to hear your opinions on them.. Should they stay or go?
I kindda think that the code would look nicer without them, but of course, removing them would mean that galaxy code using the keywords as names would be invalid.. What do you guys think?
Edit2:
I found an error in my previous implementation of a generic list. In case any of you are using the list, I uploaded a fixed version. http://www.sc2mapster.com/paste/3681/
Added a right click menu with cut/copy/paste buttons. Also with pretty pictures.
Added a Map Object Browser, to give an overview of the units/doodads/regions/points/cameras placed in the map. Double click an item to insert it into the script.
Did you add a message to the report? If so, I would very much like to have the code.
I would never include the user's code in the error reports without asking him. All I get is the message you type, and the location in my code where the error occurred.
Edit: Uploaded a new version. v2.3.5
Awesome, thanks for the quick update!
Speaking of update, it seems the editor crashes all the time once I've auto updated which makes me have to reinstall the editor. I'll send you a crash report on the next update
Okay. The update feature appears to be working at my end.
Could you try relaunching the editor when it crashes?
Also, does the Update folder exists? If so, are there any files in it? If the Updater.exe file is there, is it still running?
Could you try checking that at next update if it still crashes?
Trigger declarations are bugged in the new version. Sent an error report.
I'm gonna assume that all your source files are in folders. A fix for you until the next version should be to just create an empty script file outside of any folders.
Edit:
I uploaded a new version. v2.3.7
@SBeier: Go
Awesome, works like a charm now.
Edit: The inheritance thingy looks real nice. I will probably use that a lot.
I just uploaded another version. v2.4.0
I did it so that I could make a generic list. In case anyone else could use that,
http://www.sc2mapster.com/paste/3665/
Awesome! That'll come to use!
Edit: would it be possible to make it possible to compile via a command line? That way it could work cross-platform aswell as making it possible to use any editor of choice. I would also probably contribute with a plugin for some other editor if this was implemented.
Uploaded a new version. v 2.4.2
Soo, currently I am a little into galaxy scripting again, and I have some questions:
I am used to Jass/ZinC structs mainly, which would be used like this:
How would this translate to G++?
If you use a struct containing only methods and static members, your output script will not create a struct at all, but declaring an instance of the struct is still valid syntax for your input file and will be transferred in the output file, which causes a syntax error, because the struct doesn't exist in the output file.
Are static methods possible? If I try it, I get an "expect constant or identifier" message.
To make that struct valid galaxy++
At the moment you can't make static methods.
@SBeier: Go
My example was not meant to be "real" code, it was just an example, how the struct would roughly look in ZinC. Thanks for your help.
So, I would get a new instance by calling:
How would I destroy it?
You would call
#delete bar;
In case you didn't know, there is a full documentation here
http://www.sc2mapster.com/assets/galaxy-editor-beier/#w-pointers
Ah, the new and delete statements are explained in the pointers section. I tried to find them in the struct section.
A suggestion: Would it be possible to include the Galaxy++ code in the map? Maybe as custom script or comment files, in the same folder structure you used in the G++ editor? This way, you have all your script in the map, and maybe you could add functionality to extract this script from the map to your editor; this way the additional script files would become obsolete.
Its not desperately needed, though, but it might be very convenient. You could make this optional as well.
Quote from Kueken531:
Ah, the new and delete statements are explained in the pointers section. I tried to find them in the struct section.
A suggestion: Would it be possible to include the Galaxy++ code in the map? Maybe as custom script or comment files, in the same folder structure you used in the G++ editor? This way, you have all your script in the map, and maybe you could add functionality to extract this script from the map to your editor; this way the additional script files would become obsolete.
Its not desperately needed, though, but it might be very convenient. You could make this optional as well.
----
Like uncompiled? Because when you compile and run it should be compiled and in the output map?
I think he means uncompiled - to keep all the map data in one file. It would require some restructuring, but it's of course not impossible
Edit:
Although, my compiler will not be able to save if the map is open in the normal editor.
Edit2:
I uploaded version 2.4.5
++
files inside the map (look in project properties).Edit3:
A word of advice, make backups if you want to use the script to map feature. Were it not for my automatic backups, I would have lost my map script, because I told the editor to extract the script from the wrong map.
Edit4:
Fixed some bugs. v 2.4.6
And there I thought, this might be too complicated and probably nothing you would care about too much. Piece of cake, huh?
Gonna test this as soon as I get home.
€ how you write out your
++
without any visual indicator? I usually make one of the + bold ;) (or use plain text markup, but thats not what you did. Another markup?)€€ ah, me blind
Well, I kindda cheated a bit, but from your point of view, it works as it should.
I use the escape markup syntax..
{{{++}}}
http://www.sc2mapster.com/wiki/knowledge-base/markup-types/
Edit:
I am a bit conflicted about the # in front of all the keywords, and would like to hear your opinions on them.. Should they stay or go?
I kindda think that the code would look nicer without them, but of course, removing them would mean that galaxy code using the keywords as names would be invalid.. What do you guys think?
Edit2:
I found an error in my previous implementation of a generic list. In case any of you are using the list, I uploaded a fixed version.
http://www.sc2mapster.com/paste/3681/
I was wondering, do static properties and methods exist? They would be really handy to have at times.
Go play Antioch Chronicles Remastered!
Also, coming soon, Antioch Episode 3: Thoughts in Chaos!
Dont like mapster's ugly white? Try Mapster's Classic Skin!
I uploaded a new version. v2.5.0
@Alevice: Go
No, not at the moment
-------------------------------
No one really care whether or not the # are removed?