StarCraft® II

Running custom scripts

Posts: 546
So I've just delved into Starcraft 2's editor. I have a programming background and extensive experience with Starcraft 1's editor.

Anyway, I know how to write a custom script correctly 'n all that but I'm not sure how to run it. The main script that the trigger editor interacts with always clears itself. I want to avoid MPQ injection if possible. I want to link my map to my script and have it just work without having to save my script text file and inject it somewhere every time it changes.

I'm planning on scripting the entire trigger side of the map so I want everything in my custom script. I just want my map to use my .galaxy file right from the get-go. Any ideas?
Reply Quote
Posts: 130
Yeah. I wish I still had an old project where I included galaxy scripts, so I could double-check for any weird nuances, but I'm pretty sure it's as simple as this.
You can create a "custom script" object in the trigger editor that's just some galaxy code that goes right into the generated script. You could just use that, but if you're set on using an external text editor (I really wouldn't blame you) you can use a one-line custom script made here to include your imported .galaxy file. I pulled this line that you may have seen yourself in the generated galaxy script
include "TriggerLibs/natives"
which should be adequate to demonstrate the syntax of includes (I think I remember giving the full file name with extension for my script), or perhaps you have an adequate reference source for that information anyway. Sorry I don't remember more clearly. I only used this once and briefly. Roughly speaking it turned out not to be worth my time with the scale of my project to become fluent with galaxy.
Reply Quote
Posts: 546
Thanks! Yeah I just got it working right before I checked your reply. I just made a custom script object in the trigger editor and started coding away.
Reply Quote

Please report any Code of Conduct violations, including:

Threats of violence. We take these seriously and will alert the proper authorities.

Posts containing personal information about other players. This includes physical addresses, e-mail addresses, phone numbers, and inappropriate photos and/or videos.

Harassing or discriminatory language. This will not be tolerated.

Forums Code of Conduct

Report Post # written by

Reason
Explain (256 characters max)

Reported!

[Close]