There are multiple ways to implement a galaxy script in a map. FuzzYD chose the probably easiest way, by creating a new custom script object. However, he also included a library of his own, providing some additional functions, which is a little more advanced. Helpful, but essentially unnecessary.
Look at the very bottom of the window, when you have the custom script selected; there is a field called Initialization Function (optional). This field lets you specify the name of a function you want the game to run at map start. The function is required to not use any parameters, and to return nothing.
Read his comments, he described, what he did in great detail, and he also mentioned the initialization function field.
Yeah, I noticed thos right after posting XD So I now have working triggers !!!!!! :D Thanks a nbunch, guys ;) Now I'll just have to befriend myself with the Data Editor so I can make some cool stuff :P
EDIT: Btw, is there a function or something for getting the "exact" value of PI ? (As in 3.14.........)
Like in WC3, they had a constant called bj_PI which gave you like 3 decimals of Pi (or maybe like 5, I dunno :P)
You can try look at the internal scripts. Alt+`, type browse, then search for ".galaxy" and look for a file called natives.galaxy. Those are all the functions and possibly constants too for Galaxy. If you can't find it there, you can try TriggerLibs/NativeLib, or some of the many other internal scripts, but I prefer to do it just by defining a constant, saves me the hassle at the cost of just a byte or two of memory.
I think there are however functions that allow you to work in radians instead of degree's granted that you are working in angles. It seems to me most angle work I've done so far is handled in degrees though.
Afaik there is no native constant or function returning pi. However, you can easily specify your own constant:
constfixedPI=3.141592654;
Also, don't bother with too much accuracy; SC2 uses a fixed variable type with a precision of 1/4096 (iirc) anyway.
Even this 10 digits version of pi will get rounded to 3.1416015625, or 12868/4096 internally.
There are multiple ways to implement a galaxy script in a map. FuzzYD chose the probably easiest way, by creating a new custom script object. However, he also included a library of his own, providing some additional functions, which is a little more advanced. Helpful, but essentially unnecessary.
Look at the very bottom of the window, when you have the custom script selected; there is a field called Initialization Function (optional). This field lets you specify the name of a function you want the game to run at map start. The function is required to not use any parameters, and to return nothing.
Read his comments, he described, what he did in great detail, and he also mentioned the initialization function field.
Yeah, I noticed thos right after posting XD So I now have working triggers !!!!!! :D Thanks a nbunch, guys ;) Now I'll just have to befriend myself with the Data Editor so I can make some cool stuff :P
EDIT: Btw, is there a function or something for getting the "exact" value of PI ? (As in 3.14.........)
Like in WC3, they had a constant called bj_PI which gave you like 3 decimals of Pi (or maybe like 5, I dunno :P)
@Komaqtion: Go
You can try look at the internal scripts. Alt+`, type browse, then search for ".galaxy" and look for a file called natives.galaxy. Those are all the functions and possibly constants too for Galaxy. If you can't find it there, you can try TriggerLibs/NativeLib, or some of the many other internal scripts, but I prefer to do it just by defining a constant, saves me the hassle at the cost of just a byte or two of memory.
I think there are however functions that allow you to work in radians instead of degree's granted that you are working in angles. It seems to me most angle work I've done so far is handled in degrees though.
Out of curiosity, what do you need PI for?
Afaik there is no native constant or function returning pi. However, you can easily specify your own constant:
Also, don't bother with too much accuracy; SC2 uses a fixed variable type with a precision of 1/4096 (iirc) anyway.
Even this 10 digits version of pi will get rounded to 3.1416015625, or 12868/4096 internally.
I'm using PI to make a kind of Shadow Step ability, where you appear behind your target and strike them ;)