I'm just kidding, the title is a joke. I'm a programmer and am (now) familiar with galaxy script. I just have one question about how the script ultimately links into my map. I use Starcraft 2's map editor to write/compile the script and all I'm given is the option to Export it. I want to script my map 100% and skip the trigger editor interface entirely. How do I make my map use my custom script?
I'm not really experienced in galaxy scripting, but I believe you just need to save your galaxy script file (somebody feel free to correct me if I'm wrong).
Save your map as a sc2components file
Open the folder that was created wherever you saved that
Find your "MapScript.galaxy" file, open it, and insert the code you've written
Open the sc2components file in the editor, and save the map as a regular map file again (not sc2components)
Rollback Post to RevisionRollBack
Feel free to Send me a PM if you have any questions/concerns!
Well I got this working! The key was making a "New Custom Script" object in the trigger editor. From there, I could click on the little 0101 green icon and start coding my script and it will be in my map.
It is possible to override the MapScript.galaxy file, but opening the trigger editor and saving your map would probably recompile it back to it's blank state. And it is definitely possible to script entirely in galaxy.
I believe the function called upon map initialization is InitMap, which initializes all libraries, triggers, events and custom scripts. Can't help you confirm it now as I don't have access to my editor, but pressing Ctrl+F11 on a new map should make it clear where the starting point is since you're familiar with script.
Thus, to script in pure galaxy, on Notepad+ + or what not, you'd just have to use InitMap as your starting function and work from there.
Edit: Welcome to the scripting club :) We're a rare breed over here.
Yeah, you should never open the trigger editor, as that tends to reset MapScript.galaxy I just use the following MapScript.galaxy file:
[code]<br>
include "TriggerLibs/NativeLib"<br>
include "Script"<br>
void InitMap () {<br>
libNtve_InitLib();<br>
initScript();<br>
}<br>[/code]
which calls initScript() from my own script file. That means I only need to import Script.galaxy after I'm done coding (in Notepad++), and everything will work. This is better than just importing a file called MapScript.galaxy since the only way to do that is rename it to something else before importing and then renaming it back once it is imported, which is tedious. All of this is done in the Import Module. See [[http://www.sc2mapster.com/forums/resources/tutorials/888-trigger-writing-code-in-pure-galaxy/#posts|here]] for MotiveMe's original tutorial on how to do this.
I would also recommend using a language extension, as galaxy is pretty lacking. I still use Andromeda, but Galaxy++ is probably the way to go these days. You can find out more about Andromeda at sc2mod.com, and Galaxy++ has a page somewhere here on SC2Mapster.
There are several ways to include your script in your map. Probably the easiest way is using a new Custom Script object, as you described. Other methods include the already mentioned importing of a new MapScript.galaxy file or importing other script files and including them for libraries. This can be done in the data editor -> Gameplay Data tab -> Default SC2 Gameplay Settings -> UI: Trigger Libraries field, or the way XPilot described in his post.
Yeah, you should never open the trigger editor, as that tends to reset MapScript.galaxy I just use the following MapScript.galaxy file:
Opening the trigger is fine, changing anything and then saving the map causes the map to override the imported script.
Quote:
I would also recommend using a language extension, as galaxy is pretty lacking. I still use Andromeda, but Galaxy++ is probably the way to go these days.
Beier stopped his support for Galaxy++, the newest version by him does not support the new natives introduced in 1.5. Slarti released an updated version supporting these, but it is pretty buggy at the moment.
I'm just kidding, the title is a joke. I'm a programmer and am (now) familiar with galaxy script. I just have one question about how the script ultimately links into my map. I use Starcraft 2's map editor to write/compile the script and all I'm given is the option to Export it. I want to script my map 100% and skip the trigger editor interface entirely. How do I make my map use my custom script?
I'm not really experienced in galaxy scripting, but I believe you just need to save your galaxy script file (somebody feel free to correct me if I'm wrong).
@soulzek: Go
Well I got this working! The key was making a "New Custom Script" object in the trigger editor. From there, I could click on the little 0101 green icon and start coding my script and it will be in my map.
It is possible to override the MapScript.galaxy file, but opening the trigger editor and saving your map would probably recompile it back to it's blank state. And it is definitely possible to script entirely in galaxy.
I believe the function called upon map initialization is InitMap, which initializes all libraries, triggers, events and custom scripts. Can't help you confirm it now as I don't have access to my editor, but pressing Ctrl+F11 on a new map should make it clear where the starting point is since you're familiar with script.
Thus, to script in pure galaxy, on Notepad+ + or what not, you'd just have to use InitMap as your starting function and work from there.
Edit: Welcome to the scripting club :) We're a rare breed over here.
Yeah, you should never open the trigger editor, as that tends to reset MapScript.galaxy I just use the following MapScript.galaxy file:
[code]<br> include "TriggerLibs/NativeLib"<br> include "Script"<br> void InitMap () {<br> libNtve_InitLib();<br> initScript();<br> }<br>[/code]
which calls initScript() from my own script file. That means I only need to import Script.galaxy after I'm done coding (in Notepad++), and everything will work. This is better than just importing a file called MapScript.galaxy since the only way to do that is rename it to something else before importing and then renaming it back once it is imported, which is tedious. All of this is done in the Import Module. See [[http://www.sc2mapster.com/forums/resources/tutorials/888-trigger-writing-code-in-pure-galaxy/#posts|here]] for MotiveMe's original tutorial on how to do this.
I would also recommend using a language extension, as galaxy is pretty lacking. I still use Andromeda, but Galaxy++ is probably the way to go these days. You can find out more about Andromeda at sc2mod.com, and Galaxy++ has a page somewhere here on SC2Mapster.
There are several ways to include your script in your map. Probably the easiest way is using a new Custom Script object, as you described. Other methods include the already mentioned importing of a new MapScript.galaxy file or importing other script files and including them for libraries. This can be done in the data editor -> Gameplay Data tab -> Default SC2 Gameplay Settings -> UI: Trigger Libraries field, or the way XPilot described in his post.
Opening the trigger is fine, changing anything and then saving the map causes the map to override the imported script.
Beier stopped his support for Galaxy
++
, the newest version by him does not support the new natives introduced in 1.5. Slarti released an updated version supporting these, but it is pretty buggy at the moment.