galaxy-triggers-and-functions

Automates Galaxy trigger creation, event registration, and async execution for SC2 maps.

7|1|Updated Mar 24, 2026
One-click install
npx skills add https://github.com/KimPlaybit/Starcraft-2-Editor-Skills --skill galaxy-triggers-and-functions
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: galaxy-triggers-and-functions
Source: https://github.com/KimPlaybit/Starcraft-2-Editor-Skills/tree/main/.agents/skills/galaxy-triggers-and-functions
Command: npx skills add https://github.com/KimPlaybit/Starcraft-2-Editor-Skills --skill galaxy-triggers-and-functions

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Galaxy scripting for SC2 maps often suffers from verbose trigger declarations, scattered event registrations, and tangled async logic. This Skill consolidates best practices for declaring triggers, registering events, and executing asynchronous code through TriggerExecute, including the static parameter pattern for functions that use Wait, as well as cinematic sequencing and common event types.

Core Features & Use Cases

  • Trigger declaration & init patterns: standardize how triggers are created, named, and hooked to events.
  • Async execution & concurrency: guidance on Wait-based threads and safely passing parameters via the static-param pattern.
  • Cinematic sequencing & common events: templates for queues, time-based events, and UI/game events.

Quick Start

Create a simple trigger that prints a message when the map initializes using the standard TriggerCreate and TriggerAddEvent pattern.

Frequently Asked Questions about galaxy-triggers-and-functions

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I set up triggers and register events in SC2 Galaxy scripting?

To set up triggers in SC2 Galaxy scripting, use the standard TriggerCreate and TriggerAddEvent pattern to declare triggers, name them consistently, and hook them to specific map initialization or gameplay events for reliable event-driven behavior.

What is the static parameter pattern for async functions in Galaxy script?

The static parameter pattern in Galaxy script safely passes variables to asynchronous functions executing via TriggerExecute. It uses fixed global variables to pass data into Wait-based threads, preventing concurrency issues common in SC2 map scripting.

What's the best way to manage cinematic sequences and async workflows in SC2 maps?

The best way to manage cinematic sequences in SC2 maps is using a cinematic sequencer queue. This approach standardizes time-based events and asynchronous execution, ensuring clean initialization sequences and reliable event-driven cinematic behavior.

Can I use TriggerExecute for asynchronous code and Wait-based threads in Galaxy?

Yes, you can use TriggerExecute for asynchronous code in Galaxy scripting. It enables Wait-based thread execution and concurrency, allowing you to run asynchronous workflows while safely passing parameters through the static-parameter approach.

Why do my scattered event registrations cause issues during SC2 map initialization?

Scattered event registrations cause initialization issues because they create tangled async logic and unstandardized trigger declarations. Consolidating event registration into a clean map init sequence ensures reliable event-driven behavior and proper trigger setup.