GlobalVariables:// create outside of trigger (no local variables)distance_X=0// integer variabledistance_Y=0// integer variableActions:General-Repeat(10)times// or use another loop actionUnit-CreateUnitofType(X)atpoint(A+distance_X,B+distance_Y)Variable-distance_X+4Variable-distance_Y+4
so if i start creating triggers, units, etc via script editor, do they show up in the gui?
Where do i define this? I can't really follow the logical flow by looking at the actual script editor. I would "expect" to see all variables defined, then functions, then other declarations, then the code body.
What you say makes easy sense, i just don't understand the "where" of defining this.
This will create units in range of X 100 and Y 100 offset by 4.
Those units won't show in Editor obviously as map script runs at runtime.
Create Unit = Spawn unit. You create new unit kinds in Data editor if that's what you mean
What's the difference between GUI script and galaxy script?
GUI , as name says (Graphic user interface), allows to "write" code via interface without really typing anything (more like clicking around). It's safer and more readable for beginners.
Galaxy script is code behind GUI. It can be viewed by clicking (in triggers editor) Data -> View script. You can also write code directly in Galaxy script in C-like syntax. For this refer to Galaxy tutorials
Generally GUI is refereed to as 'Triggers" and code as "Galaxy"
About the loops. Entire Galaxy as i mentioned is very C-like but with very limited functionality so loops are 'while'. There's no 'for' i believe. GUI says 'for' but in code behind it's actually while loop
point p = location of unit
real x = x of point p
real y = y of point p
real is GUI name for galaxy fixed
there's a lot of stuff like that. That's why you should use GUI - to learn API as it's quite user friendly. If you create for example variable of type <real> and try to assign something to it, in 'functions' section you have all functions with return type <real> categorized and mostly described