Hello there. In WCIII time I wrote triggers via vJass and after on cJass. Now SCII time =) Dont like GUI... so how to start? What I must download.. etc?
Rollback Post to RevisionRollBack
OMG! New hero in 'Heroes of the Storm' is Dustin Browder. Watch here!
For SC2, there is no standard language extention yet, like vJass was for WC3. However, coding in plain Galaxy in the editor is a pain in the ass, just like back in WC3.
There are several language extensions in development; I have made good experiences with Galaxy++ so far. The language supports pointers, classes, namespaces and various other OOP-ish features, while the editor supports syntax-highlighting, autocompletion, parameter lists etc.
However, some of the other extentions do look promising as well.
If you don't want to settle for an extention yet, I recommend using Notepad++ with syntax highlighting and autocompletion options, which you can find here in the forums as well.
With a coding background and experience with C-syntax, you won't have any problems besides getting to know and memorizing function names, which should be easy with a good auto-completion.
All you really need to learn then is the syntax and the names of the functions.. You can learn that by staring at some code, if you know what it is doing.
One way of doing it is to write something in GUI, and then looking at the generated script (ctrl-F11 in the triggering editor), to figure out what GUI corresponds to what galaxy code.
Those videos obviously doesn't show you pure galaxy, but I would recommend g++ over pure galaxy, simply because it removes some annoyances, and makes things easier..
But then - I created it, so a recommendation from me is not saying much.
Start with learning how to get a function to print hello world. Thats the easiest
Another method is to build a simple trigger with GUI, then press Ctrl+F11 and study how the script works
Then try it yourself. Once you understand the structure of triggers and how they work it becomes pretty easy.
The parameters for this structure are used for checks whether or not to check the conditions or whether to run the actions. But I personally don't find myself using them much as I only run trigger threads when I need to, thus I forego the need for condition/action checking.
And require you to run TriggerCreate("MyFunction"); to create the trigger or action.
Once the trigger is created, you can start adding events to it, but of course, make sure you saved the Created trigger into a trigger type variable so you can call it back.
Another tip, In C, you will typically have an int main() function to initialize every other program thread that needs to run in your processor. In Galaxy this is replaced by void InitMap(){ } If i'm not mistaken, check Ctrl+11 to confirm. It should be right at the bottom.
Keep note that the sequence of functions you declare also matters. Any function call you make should be to a function that was already written somewhere higher up in your code sequence, or the compiler will spit out errors telling you it can't find the function.
Sorry if this is really concise or filled with jargand. Sorta typin in a blaze and too tired to think >_> if you need me to elaborate on anything just pop a note here, I'll check back.
wow wow guys.. I know about c, i know about jass. I dont know how to convert gui into script (like in wc3) and write on it) thx for answers.. will read)
Rollback Post to RevisionRollBack
OMG! New hero in 'Heroes of the Storm' is Dustin Browder. Watch here!
The last two answers were mainly aimed at me, as I kind of hijacked your thread.
Also, you cannot directly convert GUI into script, but you can make a trigger, and then insert a Custom Script in the actions.
You can convert it to script if you'd like. It's actually already converted for you. The triggers you make get converted into galaxy and saved into a galaxyscript file.
In order to directly edit the trigger by script, save your map as a component file. Then open the galaxyscript file with a text editor program. Save your changes and reopen the saved map. Viola, done.
Yes, or use CTRL + F11 in the trigger editor, like mentioned earlier. Unfortunately, both methods only show you the entire map script; there is no easy way to convert just a single trigger into custom script like back in WC3.
Nice :D Has Beier launched a stable release yet? I'll consider a move but as of now I'm somewhat of a purist >_<
I don't know, if he himself considers it stable yet, but I have used it from the start and hardly had any issues with it; and even when I had, I mentioned them to Beier and they were fixed within days.
Its your decision to make, but I honestly don't want to code without it anymore :)
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
Hello there. In WCIII time I wrote triggers via vJass and after on cJass. Now SCII time =) Dont like GUI... so how to start? What I must download.. etc?
OMG! New hero in 'Heroes of the Storm' is Dustin Browder. Watch here!
Hey.
For SC2, there is no standard language extention yet, like vJass was for WC3. However, coding in plain Galaxy in the editor is a pain in the ass, just like back in WC3.
There are several language extensions in development; I have made good experiences with Galaxy++ so far. The language supports pointers, classes, namespaces and various other OOP-ish features, while the editor supports syntax-highlighting, autocompletion, parameter lists etc.
However, some of the other extentions do look promising as well.
If you don't want to settle for an extention yet, I recommend using Notepad
++
with syntax highlighting and autocompletion options, which you can find here in the forums as well.With a coding background and experience with C-syntax, you won't have any problems besides getting to know and memorizing function names, which should be easy with a good auto-completion.
Sorry for hi-jacking the thread; I thought it would be better to post here, than creating a new one.
How to get started with galaxy scripting, with no experience in C?
All you really need to learn then is the syntax and the names of the functions.. You can learn that by staring at some code, if you know what it is doing.
One way of doing it is to write something in GUI, and then looking at the generated script (ctrl-F11 in the triggering editor), to figure out what GUI corresponds to what galaxy code.
Also, a while back, I made some videos about the features of galaxy
++
.. The language has changed a bit since then, but you should still be able to learn from them..http://www.sc2mapster.com/forums/development/galaxy-scripting-and-trigger-lib/23993-intro-videos-to-galaxy/
Do note the red text at the start of the thread ;)
Those videos obviously doesn't show you pure galaxy, but I would recommend g
++
over pure galaxy, simply because it removes some annoyances, and makes things easier..But then - I created it, so a recommendation from me is not saying much.
@ScorpSCII: Go
Read up on the basics of C, in particular the following topics:
Here's a good link I found the other day. Its about C+ +, but it teaches many of the basics of the language. http://www.cplusplus.com/doc/tutorial/
Start with learning how to get a function to print hello world. Thats the easiest
Another method is to build a simple trigger with GUI, then press Ctrl+F11 and study how the script works Then try it yourself. Once you understand the structure of triggers and how they work it becomes pretty easy.
They always take on the following structure:
The parameters for this structure are used for checks whether or not to check the conditions or whether to run the actions. But I personally don't find myself using them much as I only run trigger threads when I need to, thus I forego the need for condition/action checking.
And require you to run TriggerCreate("MyFunction"); to create the trigger or action. Once the trigger is created, you can start adding events to it, but of course, make sure you saved the Created trigger into a trigger type variable so you can call it back.
Another tip, In C, you will typically have an int main() function to initialize every other program thread that needs to run in your processor. In Galaxy this is replaced by void InitMap(){ } If i'm not mistaken, check Ctrl+11 to confirm. It should be right at the bottom.
Keep note that the sequence of functions you declare also matters. Any function call you make should be to a function that was already written somewhere higher up in your code sequence, or the compiler will spit out errors telling you it can't find the function.
Sorry if this is really concise or filled with jargand. Sorta typin in a blaze and too tired to think >_> if you need me to elaborate on anything just pop a note here, I'll check back.
wow wow guys.. I know about c, i know about jass. I dont know how to convert gui into script (like in wc3) and write on it) thx for answers.. will read)
OMG! New hero in 'Heroes of the Storm' is Dustin Browder. Watch here!
@xxxNEARBYxxx: Go
The last two answers were mainly aimed at me, as I kind of hijacked your thread. Also, you cannot directly convert GUI into script, but you can make a trigger, and then insert a Custom Script in the actions.
@FuzzYD: Go @SBeier: Go
Thank you so much for your answers, I'll see if I can learn some basic C.
@ScorpSCII: Go
You can convert it to script if you'd like. It's actually already converted for you. The triggers you make get converted into galaxy and saved into a galaxyscript file.
In order to directly edit the trigger by script, save your map as a component file. Then open the galaxyscript file with a text editor program. Save your changes and reopen the saved map. Viola, done.
@FuzzYD: Go
Pretty sure the order of functions don't matter since galaxy makes function prototypes for you.
Yes, or use CTRL + F11 in the trigger editor, like mentioned earlier. Unfortunately, both methods only show you the entire map script; there is no easy way to convert just a single trigger into custom script like back in WC3.
Only if you use GUI. If you code your functions entirely with custom script, there will be a need to manually declare prototypes.
@FuzzYD: Go
If you use Galaxy
++
, it is done automatically again ;)@Kueken531: Go
Nice :D Has Beier launched a stable release yet? I'll consider a move but as of now I'm somewhat of a purist >_<
I don't know, if he himself considers it stable yet, but I have used it from the start and hardly had any issues with it; and even when I had, I mentioned them to Beier and they were fixed within days.
Its your decision to make, but I honestly don't want to code without it anymore :)