After spending some time in the editor I feel ready for a new challange; to learn .galaxy.
I don't have much experience of coding but I know some basics; like basic structures of code and so on. But else than that - not very much.
So my question to you is, what is the best way to start out? Do you guys have any reference material of learning .galaxy? (I've browsed the API Docs but I didn't find beginner stuff)
And furthermore; do you think I should learn another language before .galaxy?
Well the Galaxy language was based off of the C language, so if you know C (or anything similar, C#, C++, Java, etc) then you'll be able to pick up Galaxy rather quickly. Maybe i'll write a Galaxy Hello World Tutorial.
As of right now, I believe our API Docs are the only docs of Galaxy on the web. Is there something specific you want to do, or are you just looking to learn?
I learned Jass2 (the predecessor of Galaxy) by just writing a few triggers in GUI and then looking at their custom script. If you know the basic idea of simple programming languages you won't have much trouble, I think. At least I didn't and it was my first scripting language, too.
I also don't think you should learn a different language before. As sixen said Galaxy is derived from C, but there is no reason to first learn C and then switch to Galaxy when you can just learn Galaxy from the beginning on.
Basically, everytime you don't know how to go on, simply make a GUI trigger with what you want, then look at it and try to grasp whats being done there.
Some things just cannot be learned easily, for example what parameters a function takes. In GUI you have nice guidelines and presets, in Galaxy you'll have to enter everything manually or look up how GUI does it.
Basically, everytime you don't know how to go on, simply make a GUI trigger with what you want, then look at it and try to grasp whats being done there.
Some things just cannot be learned easily, for example what parameters a function takes. In GUI you have nice guidelines and presets, in Galaxy you'll have to enter everything manually or look up how GUI does it.
That's actually what I ended up doing for some things, surprisingly the GUI calls some Natives by code instead of the name..
I have absolutely no idea how to script Galaxy, or C or anything at all. Can someone point me to a complete newb tutorial, on how to learn C? I would really love to learn how to do this, thanks!
Or a C/C+ + tutorial. The problem with that is, however, that these languages are not as integrated as JASS2 or Galaxy. Tutorials will also go over packages, i/o streams, compilers and so on. Partially these languages are very different to Galaxy if you don't know much about general programming. ( http://www.cplusplus.com/doc/tutorial/ this is a C+ + tutorial that's very extensive, but might be hard to grasp for a newbie.)
I suggest trying to learn a little bit of JASS2 to get the basics of the language (use of variables, parameters, function calls, types, different kinds of loops, construction of events/conditions/actions, return values, some basic concepts of programming math. I think these are all important.).
Then you better wait for a nice Galaxy tutorial for getting the differences of Galaxy/JASS2 (which are mostly syntax).
If you think of yourself as a swift learner then you might also heed my advices in my first post and try to learn-by-doing.
Offhand, does anyone know of any maps in particular that currently use a lot of Galaxy or are even entirely driven by it? I find the quickest way to learn is see what others have done and expand on that until you can create on your own.
If you want to see any part of the code you could just go to the trigger editor for the map, click on data along the top and click view script then ctrl-f and type in he trigger name your looking for, it'll display it in code although some of it may be very redundant.(i think loops(while) have a if/else with both of them doing the same thing)
Then i usually start up notepad++ and type away with whatever i need after grabbing the function call and dump what I've done in a custom script.
Since you can't notice it by just playing the map and since I haven't looked into any custom maps atm I don't really know.
But my Resident Overmind ( http://www.sc2mapster.com/maps/resident-overmind ) has all important systems in Galaxy (and is not locked). Only a couple of the easy and repetitive things are in GUI. There's an item system, dialog system, movement system and projectile system (somewhat).
Right now I think there are very few people programming in Galaxy, but it's so much more convenient, so much easier and so much faster if you know how to use it :D
Well, the most important thing to me is the much higher writing speed.
Even if I know exactly where everything is in the GUI, I'll still need relatively long to select everything, to load all this lists with variables and functions and so on.
When I can just write everything down without having it to seach somewhere it's much easier and so much faster - given the fact that I know what I have to write :P
Let's take some math as an example. I want to add some numbers and variables. In GUI I'd have to select each value and add them via the arithmic function.
In Galaxy I just write
i=a+b+c+d;
It might only save me a second or so, but given the fact how much we have to work with triggers that amounts to minutes and hours.
Also, I am used to programming languages like C+ + or Java, so I'm very familiar with the look and way of working of Galaxy right off the bat.
Next is the better overview. Actions in GUI sometimes are so horribly long that you have to scroll back and forth, left and right to see the entire function.
The same function. But so much shorter. Of course the parameters look more cryptic in Galaxy, but you get used to it.
Especially long and complex triggers become easier to read. You can also format your text just like you want to, which is impossible in GUI.
In general you have more control over your triggers. Even though GUI can do most of what pure Galaxy can, there's still quite a couple of things that are easily done in Galaxy, but more or less impossible in GUI.
And you can code more efficiently in Galaxy. Not by a huge margin (since GUI does a good job there), but still more efficiently (performance-wise).
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
Hello guys!
After spending some time in the editor I feel ready for a new challange; to learn .galaxy.
I don't have much experience of coding but I know some basics; like basic structures of code and so on. But else than that - not very much.
So my question to you is, what is the best way to start out? Do you guys have any reference material of learning .galaxy? (I've browsed the API Docs but I didn't find beginner stuff)
And furthermore; do you think I should learn another language before .galaxy?
Thanks in advance, Ice_bane @ EU
Well the Galaxy language was based off of the C language, so if you know C (or anything similar, C#, C++, Java, etc) then you'll be able to pick up Galaxy rather quickly. Maybe i'll write a Galaxy Hello World Tutorial.
As of right now, I believe our API Docs are the only docs of Galaxy on the web. Is there something specific you want to do, or are you just looking to learn?
I learned Jass2 (the predecessor of Galaxy) by just writing a few triggers in GUI and then looking at their custom script. If you know the basic idea of simple programming languages you won't have much trouble, I think. At least I didn't and it was my first scripting language, too.
I also don't think you should learn a different language before. As sixen said Galaxy is derived from C, but there is no reason to first learn C and then switch to Galaxy when you can just learn Galaxy from the beginning on.
Basically, everytime you don't know how to go on, simply make a GUI trigger with what you want, then look at it and try to grasp whats being done there.
Some things just cannot be learned easily, for example what parameters a function takes. In GUI you have nice guidelines and presets, in Galaxy you'll have to enter everything manually or look up how GUI does it.
That's actually what I ended up doing for some things, surprisingly the GUI calls some Natives by code instead of the name..
I have absolutely no idea how to script Galaxy, or C or anything at all. Can someone point me to a complete newb tutorial, on how to learn C? I would really love to learn how to do this, thanks!
You can either use a JASS2 tutorial (Galaxy's precedessor): http://www.wc3c.net/tutorials.php?f=650
Or a C/C+ + tutorial. The problem with that is, however, that these languages are not as integrated as JASS2 or Galaxy. Tutorials will also go over packages, i/o streams, compilers and so on. Partially these languages are very different to Galaxy if you don't know much about general programming. ( http://www.cplusplus.com/doc/tutorial/ this is a C+ + tutorial that's very extensive, but might be hard to grasp for a newbie.)
I suggest trying to learn a little bit of JASS2 to get the basics of the language (use of variables, parameters, function calls, types, different kinds of loops, construction of events/conditions/actions, return values, some basic concepts of programming math. I think these are all important.).
Then you better wait for a nice Galaxy tutorial for getting the differences of Galaxy/JASS2 (which are mostly syntax).
If you think of yourself as a swift learner then you might also heed my advices in my first post and try to learn-by-doing.
Offhand, does anyone know of any maps in particular that currently use a lot of Galaxy or are even entirely driven by it? I find the quickest way to learn is see what others have done and expand on that until you can create on your own.
If you want to see any part of the code you could just go to the trigger editor for the map, click on data along the top and click view script then ctrl-f and type in he trigger name your looking for, it'll display it in code although some of it may be very redundant.(i think loops(while) have a if/else with both of them doing the same thing)
Then i usually start up notepad++ and type away with whatever i need after grabbing the function call and dump what I've done in a custom script.
@Aenigma: Go
Since you can't notice it by just playing the map and since I haven't looked into any custom maps atm I don't really know.
But my Resident Overmind ( http://www.sc2mapster.com/maps/resident-overmind ) has all important systems in Galaxy (and is not locked). Only a couple of the easy and repetitive things are in GUI. There's an item system, dialog system, movement system and projectile system (somewhat).
Right now I think there are very few people programming in Galaxy, but it's so much more convenient, so much easier and so much faster if you know how to use it :D
@s3rius:
I also want to learn galaxy, and have a good knowledge of C, C++, etc...
But before I do, what can it do that the trigger editor can't?
I shall qoute myself from here: http://forums.sc2mapster.com/development/galaxy-scripting-and-trigger-lib/3129-whats-the-point/#p7
Well, the most important thing to me is the much higher writing speed.
Even if I know exactly where everything is in the GUI, I'll still need relatively long to select everything, to load all this lists with variables and functions and so on.
When I can just write everything down without having it to seach somewhere it's much easier and so much faster - given the fact that I know what I have to write :P
Let's take some math as an example. I want to add some numbers and variables. In GUI I'd have to select each value and add them via the arithmic function.
In Galaxy I just write
It might only save me a second or so, but given the fact how much we have to work with triggers that amounts to minutes and hours.
Also, I am used to programming languages like C+ + or Java, so I'm very familiar with the look and way of working of Galaxy right off the bat.
Next is the better overview. Actions in GUI sometimes are so horribly long that you have to scroll back and forth, left and right to see the entire function.
Another example. GUI
Galaxy
The same function. But so much shorter. Of course the parameters look more cryptic in Galaxy, but you get used to it.
Especially long and complex triggers become easier to read. You can also format your text just like you want to, which is impossible in GUI.
In general you have more control over your triggers. Even though GUI can do most of what pure Galaxy can, there's still quite a couple of things that are easily done in Galaxy, but more or less impossible in GUI.
And you can code more efficiently in Galaxy. Not by a huge margin (since GUI does a good job there), but still more efficiently (performance-wise).