I want to write galaxy scripts directly into the maps when using editor.I found it is very tricky to use galaxy editor to add a new event,action and so on.
Many maps have lots of scripts within. How they made it out?
General - Custom Script lets you write custom script code (in the editor).
You can hit ctrl+F11 to view the compiled script (so you can see how your non-custom triggers are getting compiled).
There's probably a way to write custom script outside the editor and import it via the Trigger Editor, but I haven't messed with that yet.
The editor, by default, doesn't support you writing your own code - it only allows you to write stuff inside a GUI function, but there's a work-a-round.
You create a new trigger and add "General - Custom Script" as the only action. In there you write:
This tricks the editor by closing the actualy GUI function, then letting you insert ANY scripts you want to, then opening a new dummy function that closes off with the end of the GUI function.
Just remember that, if you want to use this trick multiple times, you have to change the "dummyfunc" to something randomly different everytime.
It's honestly pretty annoying to deal with script inside the editor due to the need to wrap them in custom script actions. You might want to consider saving your map as a "SC2Components" based map (e.g., everything is extracted into a folder for you to freely edit), and then include your scripts via a custom script tag using the method s3rius mentions.
I had whipped up a quick example map showing this a bit back, take a look and see if that works for you:
I want to write galaxy scripts directly into the maps when using editor.I found it is very tricky to use galaxy editor to add a new event,action and so on. Many maps have lots of scripts within. How they made it out?
I'm a freshman, please help me.
Thanks!
Hi, I guess what you are looking for is the triggers editor (press F6 in the main Editor).
If it's not what you want, there are a bunch of tutorials as well!
@victor2100: Go
What I know:
General - Custom Script lets you write custom script code (in the editor). You can hit ctrl+F11 to view the compiled script (so you can see how your non-custom triggers are getting compiled).
There's probably a way to write custom script outside the editor and import it via the Trigger Editor, but I haven't messed with that yet.
The editor, by default, doesn't support you writing your own code - it only allows you to write stuff inside a GUI function, but there's a work-a-round.
You create a new trigger and add "General - Custom Script" as the only action. In there you write:
This tricks the editor by closing the actualy GUI function, then letting you insert ANY scripts you want to, then opening a new dummy function that closes off with the end of the GUI function.
Just remember that, if you want to use this trick multiple times, you have to change the "dummyfunc" to something randomly different everytime.
@victor2100: Go
It's honestly pretty annoying to deal with script inside the editor due to the need to wrap them in custom script actions. You might want to consider saving your map as a "SC2Components" based map (e.g., everything is extracted into a folder for you to freely edit), and then include your scripts via a custom script tag using the method s3rius mentions.
I had whipped up a quick example map showing this a bit back, take a look and see if that works for you:
http://nevir.net/sc2/Scripted_Map_Template.zip
Alternatively, take a look at MotiveMe's method for doing this via the import manager:
http://forums.sc2mapster.com/development/tutorials/888-trigger-writing-code-in-pure-galaxy/
Thanks for all of you! I think I can do it better now.