Should I learn Galaxy scripting to do the "real stuff"? Or the "fun stuff"?
Are there any things you can do with Galaxy scripting that you can't do in the trigger editor without custom script? In Wc3, there were some very essential things you could only do in JASS, like defining functions and local variables. But all that seems to be available for GUI users in Galaxy's trigger editor now... Is there anything I'm missing by not knowing the ins and outs of Galaxy scripting?
Maybe events? Because event definitions in the trigger editor do not seem to work, so maybe that's one thing?
I also have another question: I know that local variables start with lv_, and parameters with lp_, but what about globals, constants, and records?
Thanks.
globals start with gv_, records dunno exactly, just look it up in your map script (ctrl + F11 in trigger editor)
Galaxy has some advantages over Gui in SC2, but not that significant like in WC3. The biggest advantages are:
dynamic trigger creation: You cannot create a trigger on-the-fly in Gui, all triggers will be created at map initialization
use constant variables as array size
its script over selecting stuff from lists. This is the biggest point for me, but its purely preference. Some people prefer the "simplicity" of Gui, to pick everything from giant lists, some people like me prefer writing a script, especially for stuff like formulas/calculations. If you want to calculate something like 0.5*a*a+b+3 or whatever in Gui, you have to click through arithmetic functions several times; in Galaxy you just type out the formula, which is WAY faster.
The first 2 points are not THAT significant, they probably won't prevent you from creating any specific features in Gui. So its up to you: You don't need to learn Galaxy to make a good map. You can learn it, if you like working with it.
Records also start with gv_, and you don't really need to use arithmetic functions to do all your math, you can just use the Custom Script option and type it all out, which is in the same window where you would select a function (just click the custom script radio button).
Like he said though, its really just a preference.
@Kueken531
All good points. I can see how #1 and #2 could be useful. It's not a real hindrance to miss those options, but could be useful.
@LinkD
Yeah, I was about to say, any advanced formula I would do with custom script. However, because I didn't know to put gv_ in front, I was doing this WITHOUT custom script:
...Maximum((Abs(d-270)/360)*distMult,distMax)...
Which is a pain to edit wihtout having used custom script. The good thing is how GUI will correct itself when I rename any element. And how I can easily move things around.
Edit: so to use a record, I would write: "gv_myRecord.Member"?
I use GUI for small functions (10 lines or less), and script for the rest, and where it makes sense.
The reason I learned script was because of a trigger where I gave a unit given in the parameters, some values based on it's ID, and if it had an item equiped from a long "if then else" list.
Each item took from 3 to 10 lines, and I had about 20 items, now 30. Now 150lines of GUI code is a mess, everytime I clicked some line it took 10 seconds for the window to update, and if I copy-pasted something, it took 10seconds, plus an additional 5seconds per line pasted. With script, all this is reduced to 3-4 seconds, when I copy-paste an item, and half a second each time I change a value.
O.o WHHHHATTTT???? You can do that in Galaxy? I mean, I guess it makes sense that you can, but I just assumed that Blizzard put something in the compiler that would make it through an exception or something. Oh man, I NEED to learn that. That isn't sorta useful, its INCREDIBLY useful! I can't even think of all the times I have needed to set the size of an array with a variable, and just made it "1000" or something, just in case.
Oh well, I guess I overreacted. Still, I had no idea you could do that, that is awesome!
O.o WHHHHATTTT???? You can do that in Galaxy? I mean, I guess it makes sense that you can, but I just assumed that Blizzard put something in the compiler that would make it through an exception or something. Oh man, I NEED to learn that. That isn't sorta useful, its INCREDIBLY useful! I can't even think of all the times I have needed to set the size of an array with a variable, and just made it "1000" or something, just in case.
Oh well, I guess I overreacted. Still, I had no idea you could do that, that is awesome!
A constant variable - not a normal variable. Array sizes still can't be dynamic.
Making a good map is hard enough. My opinion is to stick with the GUI if learning the custom script is going to be any kind of roadblock for you. If you're actually interested in learning it, then go for it.
A lot of the mapster technophiles love scripting, but my map is extremely trigger heavy and I do a ton of really advanced stuff. It's all done using the GUI and I'm happy with it.
Are there any things you can do with Galaxy scripting that you can't do in the trigger editor without custom script?
Yes, if you go console-> type "browse", go -> view galaxy.natives you can learn that there are some functions which are not listed in GUI. Like for example somehow important (and "delicate in way it works") AddEventTrigger*, Also, in my opinion, it alot easier to edit any math stuff because you dont have to destroy whole formula if you want add something in front.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
Should I learn Galaxy scripting to do the "real stuff"? Or the "fun stuff"?
Are there any things you can do with Galaxy scripting that you can't do in the trigger editor without custom script? In Wc3, there were some very essential things you could only do in JASS, like defining functions and local variables. But all that seems to be available for GUI users in Galaxy's trigger editor now... Is there anything I'm missing by not knowing the ins and outs of Galaxy scripting?
Maybe events? Because event definitions in the trigger editor do not seem to work, so maybe that's one thing?
I also have another question: I know that local variables start with lv_, and parameters with lp_, but what about globals, constants, and records?
Thanks.
globals start with gv_, records dunno exactly, just look it up in your map script (ctrl + F11 in trigger editor)
Galaxy has some advantages over Gui in SC2, but not that significant like in WC3. The biggest advantages are:
The first 2 points are not THAT significant, they probably won't prevent you from creating any specific features in Gui. So its up to you: You don't need to learn Galaxy to make a good map. You can learn it, if you like working with it.
Also, read the FAQ for reference.
Records also start with gv_, and you don't really need to use arithmetic functions to do all your math, you can just use the Custom Script option and type it all out, which is in the same window where you would select a function (just click the custom script radio button).
Like he said though, its really just a preference.
@Kueken531
All good points. I can see how #1 and #2 could be useful. It's not a real hindrance to miss those options, but could be useful.
@LinkD
Yeah, I was about to say, any advanced formula I would do with custom script. However, because I didn't know to put gv_ in front, I was doing this WITHOUT custom script:
...Maximum((Abs(d-270)/360)*distMult,distMax)... Which is a pain to edit wihtout having used custom script. The good thing is how GUI will correct itself when I rename any element. And how I can easily move things around.
Edit: so to use a record, I would write: "gv_myRecord.Member"?
gv_myRecord.lv_member
Thats how you write it
Thanks.
actially it is record.member. If you code everything by hand, you dont even need the prefix if you don't like them.
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!
Try an external script editor, which does reduce this time to nothing at all.
O.o WHHHHATTTT???? You can do that in Galaxy? I mean, I guess it makes sense that you can, but I just assumed that Blizzard put something in the compiler that would make it through an exception or something. Oh man, I NEED to learn that. That isn't sorta useful, its INCREDIBLY useful! I can't even think of all the times I have needed to set the size of an array with a variable, and just made it "1000" or something, just in case.
Oh well, I guess I overreacted. Still, I had no idea you could do that, that is awesome!
Great to be back and part of the community again!
Some of the current preprocessors allow to make complex code more modularand well designed.
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!
A constant variable - not a normal variable. Array sizes still can't be dynamic.
Making a good map is hard enough. My opinion is to stick with the GUI if learning the custom script is going to be any kind of roadblock for you. If you're actually interested in learning it, then go for it.
A lot of the mapster technophiles love scripting, but my map is extremely trigger heavy and I do a ton of really advanced stuff. It's all done using the GUI and I'm happy with it.
Yes, if you go console-> type "browse", go -> view galaxy.natives you can learn that there are some functions which are not listed in GUI. Like for example somehow important (and "delicate in way it works") AddEventTrigger*,
Also, in my opinion, it alot easier to edit any math stuff because you dont have to destroy whole formula if you want add something in front.