SC2Mapster Wiki
Explore
Main Page
All Pages
Interactive Maps
navigation
Main page
Community portal
Recent changes
Random page
Help
SC2MAPSTER
News
Maps
Assets
Teams
Authors
Forums
Paste
Gamepedia
Gamepedia support
Report a bad ad
Help Wiki
Contact us
FANDOM
Fan Central
BETA
Games
Anime
Movies
TV
Video
Wikis
Explore Wikis
Community Central
Start a Wiki
Don't have an account?
Register
Sign In
Sign In
Register
SC2Mapster Wiki
1,003
pages
Explore
Main Page
All Pages
Interactive Maps
navigation
Main page
Community portal
Recent changes
Random page
Help
SC2MAPSTER
News
Maps
Assets
Teams
Authors
Forums
Paste
Gamepedia
Gamepedia support
Report a bad ad
Help Wiki
Contact us
Editing
Triggers
Back to page
Edit
VisualEditor
View history
Talk (0)
Edit Page
Triggers
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{Editor Elements}} {{Trigger Elements}} ==The Trigger Editor== *The trigger editor is a powerful and easy-to-use tool with a GUI that allows map makers to create scripts for maps without writing galaxy script or even needing to know C programming language. *Trigger files are automatically converted into galaxy script when the map is run *Changes in the trigger editor are not needed to build simple melee maps using standard SC2 rules, but pretty much anything else will require at least some trigger work. *Hybridization of triggers with [[Data Types|data]] can be used to create features that are not possible with triggers or data alone (eg. the Archangel boss fight in zlab02 - Back In The Saddle) ===GUI layout=== *Under the '''View''' menu make sure '''Show List Panel''', '''Show Libraries''' and '''Show Triggers''' are enabled so that all triggers applied to the map are visible. *'''Upper Left Window:''' Contains trigger libraries (unless the '''Library On Bottom''' option is enabled) originating from dependencies and mods added to the map or imported '''.SC2Lib''' files. Triggers in libraries run whenever the triggering event occurs and the conditions are met while [[Triggers/Definitions|Definitions]] in the library become available for use in triggers. **Note that triggers in other libraries cannot be disabled by right clicking and need to be disabled with a '''Turn Trigger On/Off''' action run by another trigger if they are undesirable *'''Lower Left Window:''' Contains the list of trigger elements in the opened map or mod (unless the '''Library On Bottom''' option is enabled). New elements can be added and labels/flags/properties modified by right clicking. Left clicking an element opens it in the window on the upper right of the screen while left click drag and drop allows the order of elements to be moved around. *'''Upper Right Window:''' Shows details of the currently selected element (from the lower left window). New sub-elements can be added and labels/flags/properties modified by right clicking. Left clicking a sub-element opens it in the lower right window while left click drag and drop allows the order and hierarchy of elements to be moved around. Double left clicking opens a window to change the sub-element for an alterative option of the same type. *'''Lower Right Window:''' Is split into three sections. **The upper window lists the '''Parameters''' used by the selected sub-element with parameters introduced by [[Triggers/Functions|Functions]] used to define other parameters being nested to the right of the defined parameter. **In the middle is the selected sub-element in string form with as yet undefined parameters in '''Red''' and defined parameters in '''Blue'''. Left clicking the coloured text opens a window to define the parameters. **The bottom window shows the '''Hint Text''' entry of the sub-element if it is a [[Triggers/Definitions|Definition]] ===Trigger Element Types=== *'''Comments:''' Text added that will not interfere with the code used for organisation and note taking. **Use as reminders for projects if development is resumed after a hiatus **Useful for learning purposes when other people look at the map *'''Custom Scripts:''' Boxes for inputting galaxy script directly. See [[Language Overview]] section to learn more *[[Triggers/Definitions|Definitions]]: Creates custom Events, Conditions, Actions or Functions able to be used in Triggers. Often used to simplify repetitive yet complex actions and functions eg. creating '''[[Triggers/Actions#Dialog|Dialog]]'''. *'''Folders:''' Used for organising groups of elements together (usually by function or development progress). Drag and drop elements to move them in/out of folders *[[Triggers/Presets|Presets]]: Single dimensional variables with predefined values linked to a text tag. Often used for variables with static values that are frequently used eg. map specific options/settings and '''Switch Case''' actions *[[Triggers/Variables And Records|Records]]: Stores an array of multiple '''Variables''' that can have different [[Types]]. Commonly used for convenience when loading and saving with [[Triggers/Actions#Banks|Banks]] or when the variable size index values represent the same object. **Require a variable using the '''-Record''' type to use variables stored on the record *'''Triggers:''' (For details see next section) *[[Triggers/Variables And Records|Variables (Global)]]: Variables that are able to be shared between triggers and threads. Use these for stuff used for multiple triggers or threads. ====Element Flags, Labels and Properties==== *'''Enabled:''' When disabled prevents the trigger from being executed even by other triggers. *'''Initially On:''' The trigger starts in the '''On''' state meaning any events the trigger has will run the trigger if the conditions are met. If disabled the '''Turn Trigger On/Off''' action from another trigger needs to turn the trigger on for the events to operate. Even in the off state triggers will still run if executed by the '''Run Trigger''' action of another trigger. *'''Template:''' Marks the element as part of a template for other modders to copy as a starting point for interacting with an existing map or mod. **An example of this is the co-op mission template, which can be found in the "Mission (COOP)" library under the "Templates" folder (requires the "Co-Op Mission" dependency). Once copied to a map, the co-op mission template can then be used to help a map maker start creating their own co-op mission. *'''Internal:''' Marks the element for internal use only, meaning other trigger libraries cannot access or modify it. This can help prevent unexpected changes caused by other maps or mods by limiting access to objects intended to be interacted with directly. *'''Deprecated:''' Marks the element as deprecated, meaning it is considered obsolete and thus should not be used. *'''Not Yet Implemented:''' Used to indicate if the element's code is not yet fully written yet and thus should not be used. *'''Label:''' Categories for the organisation of elements. Also changes the texture to the left of the element ==Triggers== ===The Basic Concept of a Trigger === Every trigger has spaces for several types of sub-element. The minimal requirements to make an independent functional trigger are an '''Event''' (what conditions makes the trigger run) and an '''Action''' (what it does). Triggers once executed will work through all sub-elements sequentially until completion. This means that loops will prevent the execution of action sub-elements further down the list until the loop finishes. ===Trigger Sub-Element Types=== [[File:TM-Basic1.png]] *[[Triggers/Events|Events]]: The event that will "run" the trigger (Unit dies, Unit enters region, Effect Used, etc.). Whenever this event happens, the trigger will start, create a new thread and check the conditions. Triggers lacking events can still be run by other triggers using Run Trigger actions specifying the trigger under the Parameters however this means that at least one trigger somewhere must have at least one event. *[[Triggers/Variables And Records|Variables (Local)]]: Variable used to store information for a single execution of a trigger. Local variables are deleted when the trigger thread finishes running and are created and linked in parallel for each thread created, meaning multiple copies of the same variable with different values can exist at a time. This has advantages if executing the same trigger multiple times on multiple targets transiently (eg. displaying damage taken on a cluster of units hit several times by a multicastable area of effect ability with damage over time). Having the correct [[Types|Type]] of local variable in the trigger is required for some '''Functions''' and '''Actions''' to appear as options. *[[Triggers/Conditions|Conditions]]: Conditions are restrictions before the actions are executed. They have all to be true in order for the trigger to continue (Unit has attribute "hero", Owner of unit is player 1, Race of player is Terran, etc.) *[[Triggers/Actions|Actions]]: What the trigger does in response to the event. This can range from the creation of units to modification of their stats to adding minerals or ending the game in victory/defeat, etc. *'''Comments:''' Text added that will not interfere with the code used for organisation and note taking. **Use as reminders for projects if development is resumed after a hiatus **Useful for learning purposes when other people look at the map ====Sub-Element Flags, Labels and Properties==== *'''Enabled:''' When disabled prevents the sub-element from being executed when the trigger runs. *'''Depreciated:''' Marks the element as deprecated, meaning it is considered obsolete and thus should not be used. *'''Not Yet Implemented:''' Used to indicate if the element's code is not yet fully written yet and thus should not be used. *'''Label:''' Categories for the organisation of sub elements. Also changes the texture to the left of the sub-element ===Index of Native Actions, Conditions, Events & Functions By Category=== ''If you want to create an action or function page, use this [[Triggers/Trigger Page Template|Template]].'' {| style="border-spacing: 10px;" |- |[[File:ui-editoricon-triggercategories_actor.png|link=Triggers/Category Actor]] [[Triggers/Category Actor|Actor]] |[[File:ui-editoricon-triggercategories_ai.png|link=Triggers/Category AI]] [[Triggers/Category AI|AI]] |[[File:ui-editoricon-triggercategories_aiadvanced.png|link=Triggers/Category AI Advanced]] [[Triggers/Category AI Advanced|Advanced AI]] |[[File:ui-editoricon-triggercategories_animation.png|link=Triggers/Category Animation]] [[Triggers/Category Animation|Animation]] |[[File:ui-editoricon-triggercategories_bank.png|link=Triggers/Category Bank]] [[Triggers/Category Bank|Bank]] |- |[[File:ui-editoricon-triggercategories_cameras.png|link=Triggers/Category Camera]] [[Triggers/Category Camera|Camera]] |[[File:ui-editoricon-triggercategoriescampaign.png|link=Triggers/Category Campaign]] [[Triggers/Category Campaign|Campaign]] |[[File:ui-editoricon-triggercategories_catalog.png|link=Triggers/Category Catalog]] [[Triggers/Category Catalog|Catalog]] |[[File:ui-editoricon-triggercategories_cinematics.png|link=Triggers/Category Cinematics]] [[Triggers/Category Cinematics|Cinematics]] |[[File:ui-editoricon-triggercategories_comment.png|link=Triggers/Category Comment]] [[Triggers/Category Comment|Comment]] |- |[[File:ui-editoricon-triggercategories_conversations.png|link=Triggers/Category Conversation]] [[Triggers/Category Conversation|Conversation]] |[[File:ui-editoricon-triggercategories_cinematics.png|link=Triggers/Category Cutscene]][[Triggers/Category Cutscene|Cutscene]] |[[File:ui-editoricon-triggercategories_conversion.png|link=Triggers/Category Conversion]] [[Triggers/Category Conversion|Conversion]] |[[File:ui-editoricon-triggercategories_datatable.png|link=Triggers/Category Data Table]] [[Triggers/Category Data Table|Data Table]] |[[File:ui-editoricon-triggercategories_debug.png|link=Triggers/Category Debug]] [[Triggers/Category Debug|Debug]] |- |[[File:ui-editoricon-triggercategories_dialog.png|link=Triggers/Category Dialog]] [[Triggers/Category Dialog|Dialog]] |[[File:Ui-editoricon-triggereditor newtrigger.png|17px|link=Triggers/Category Effect History]] [[Triggers/Category Effect History|Effect History]] |[[File:ui-editoricon-triggercategories_environment.png|link=Triggers/Category Environment]] [[Triggers/Category Environment|Environment]] |[[File:ui-editoricon-triggercategories_game.png|link=Triggers/Category Game]] [[Triggers/Category Game|Game]] |[[File:ui-editoricon-triggercategories_player.png|link=Triggers/Category Game User]] [[Triggers/Category Game User|Game User]] |- |[[File:ui-editoricon-triggercategories_general.png|link=Triggers/Category General]] [[Triggers/Category General|General]] |[[File:ui-editoricon-triggercategories_leaderboards.png|link=Triggers/Category Leaderboard]] [[Triggers/Category Leaderboard| Leaderboard]] |[[File:ui-editoricon-triggercategories_logic.png|link=Triggers/Category Logic]] [[Triggers/Category Logic|Logic]] |[[File:ui-editoricon-triggercategories_math.png|link=Triggers/Category Math]] [[Triggers/Category Math|Math]] |[[File:ui-editoricon-triggercategories_melee.png|link=Triggers/Category Melee]] [[Triggers/Category Melee|Melee]] |- |[[File:ui-editoricon-triggercategories_objective.png|link=Triggers/Category Objective]] [[Triggers/Category Objective|Objective]] |[[File:ui-editoricon-triggercategories_orders.png|link=Triggers/Category Order]] [[Triggers/Category Order|Order]] |[[File:ui-editoricon-triggercategories_ping.png|link=Triggers/Category Ping]] [[Triggers/Category Ping|Ping]] |[[File:ui-editoricon-triggercategories_player.png|link=Triggers/Category Player]] [[Triggers/Category Player|Player]] |[[File:ui-editoricon-triggercategories_playergroup.png|link=Triggers/Category Player Group]] [[Triggers/Category Player Group|Player Group]] |- |[[File:ui-editoricon-triggercategories_point.png|link=Triggers/Category Point]] [[Triggers/Category Point|Point]] |[[File:ui-editoricon-triggercategories_portrait.png|link=Triggers/Category Portrait]] [[Triggers/Category Portrait|Portrait]] |[[File:ui-editoricon-triggercategories_region.png|link=Triggers/Category Region]] [[Triggers/Category Region|Region]] |[[File:ui-editoricon-triggercategories_unitselection.png|link=Triggers/Category Selection]] [[Triggers/Category Selection|Selection]] |[[File:ui-editoricon-triggercategories_sound.png|link=Triggers/Category Sound]] [[Triggers/Category Sound|Sound]] |- |[[File:ui-editoricon-triggercategories_datatable.png|link=Triggers/Category Stats]] [[Triggers/Category Stats|Stats]] |[[File:ui-editoricon-triggercategories_story.png|link=Triggers/Category Story]] [[Triggers/Category Story|Story]] |[[File:ui-editoricon-triggercategories_strings.png|link=Triggers/Category String]] [[Triggers/Category String|String]] |[[File:ui-editoricon-triggercategories_ping.png|link=Triggers/Category Ping]] [[Triggers/Category Talent Tree|Talent Tree]] |[[File:ui-editoricon-triggercategories_techtree.png|link=Triggers/Category Tech Tree]] [[Triggers/Category Tech Tree|Tech Tree]] |- |[[File:ui-editoricon-triggercategories_texttag.png|link=Triggers/Category Text Tag]] [[Triggers/Category Text Tag|Text Tag]] |[[File:ui-editoricon-triggercategories_timer.png|link=Triggers/Category Timer]] [[Triggers/Category Timer|Timer]] |[[File:ui-editoricon-triggercategories_transmission.png|link=Triggers/Category Transmission]] [[Triggers/Category Transmission|Transmission]] |[[File:ui-editoricon-triggercategories_triggers.png|link=Triggers/Category Trigger]] [[Triggers/Category Trigger|Trigger]] |[[File:ui-editoricon-triggercategories_ui.png|link=Triggers/Category UI]] [[Triggers/Category UI|UI]] |- |[[File:ui-editoricon-triggercategories_unit.png|link=Triggers/Category Unit]] [[Triggers/Category Unit|Unit]] |[[File:ui-editoricon-triggercategories_unitgroup.png|link=Triggers/Category Unit Group]] [[Triggers/Category Unit Group|Unit Group]] |[[File:ui-editoricon-triggercategories_unitselection.png|link=Triggers/Unit Selection]] [[Triggers/Category Unit Selection|Unit Selection]] |[[File:ui-editoricon-triggercategories_datatable.png|link=Triggers/Category User Data]] [[Triggers/Category User Data|User Data]] |[[File:ui-editoricon-triggercategories_variable.png|link=Triggers/Category Variable]] [[Triggers/Category Variable|Variable]] |- |[[File:ui-editoricon-triggercategories_visibility.png|link=Triggers/Category Visibility]] [[Triggers/Category Visibility|Visibility]] |} ===Index of Camapaign and Co-op Actions, Conditions, Events & Functions By Category=== {| style="border-spacing: 10px;" |- (WIP) |} === Other Built-Ins Reference (By element type) === * [[Types|Data Types]] * [[Triggers/Presets|Presets]] *[[Triggers/Functions|Functions]] === Coding Concepts & Tutorials === * [[Galaxy/Triggers/Multithreading and AI|Multithreading and AI]] [[Category:Triggers]]
Summary:
Please note that all contributions to the SC2Mapster Wiki are considered to be released under the CC BY-NC-SA
Cancel
Editing help
(opens in new window)
Templates used on this page:
Template:Editor Elements
(
view source
)
Template:Trigger Elements
(
view source
)
Follow on IG
TikTok
Join Fan Lab