StarCraft® II

General questions on Triggers

Posts: 2
Hello!

I'm new to SC2's map editor, but several years ago I was fluent in Brood War's map editor and SCX-tra (or something like that). Immediately I noticed that the new map editor is much more complex (unnecessarily so in my opinion) and I am having a hard time creating simple triggers that take seconds to make in the SC: Brood War editor. I have made several attempts to use online tutorials and YouTube videos to help me with my specific issues with little to no help as most guides are on basic trigger functions. Listed below are a few things that I want to do with Triggers, and to clear up confusion (or add to it), I have added the comparable trigger from the old map editor (Brood War). Any help or tips are greatly appreciated.

1. I want to create a civilian (male) unit for all current human players upon map start-up at a specific point. In Brood War's map editor it would look like this:
Players>Force 1
Conditions>Always (or) Elapse time [1 second]
Action>Create Unit [Create 1 Civilian at Location(Now called Regions) for Force 1 (or) Current Players]

2. I want to move a civilian unit to a Terran beacon (Region 1), remove said unit at the region, then create a new unit (marine) at a different region (we'll say Region 2). Essentially, I would be using a civilian to select a hero unit. In the old map editor the Trigger would look like:
Players>Force 1
Condition>Bring [Current player brings 1 Civilian to Region 1]
Action>Remove unit [Remove all Civilian for Current Player at Region 1]
>Create units [Create 1 Terran Marine at Region 2 for Current Player]
>Preserve Trigger

There are several other Triggers that I can't quite figure out, but if I can get some insight on how to execute the two above, I may have a strong enough base to figure the rest out on my own. Thanks for any input!
Reply Quote
Posts: 95
This is how both of these triggers would look in SC2's GUI. I used a probe in my example, just swap it out for any unit you want to use in your map.

1.
Events
Game - Map initialization //This will run the trigger right away on map load.

Local Variables
None

Conditions
None

Actions
Player Group - Pick each player in (Active Players) and do (Actions)
Actions
Unit - Create 1 Probe for player (Picked Player) at
(Center of Region 001) facing 270.0 degrees (No Options)


2.
Events
Unit - Any Unit Enters Region 002

Local Variables
None

Conditions
(Unit type of (Triggering unit)) == Probe

Actions
Unit - Create 1 Marine for player (Owner of (Triggering unit)) at
(Center of Region 003) facing 270.0 degrees (No Options)
Unit - Remove (Triggering unit) from the game


If you have any questions about these let me know.
Edited by MegaBlast on 2/11/2012 1:15 AM PST
Reply Quote
Posts: 5
In the Event->Conditions->Actions, can you specify actions to do depending on various conditions in the same trigger, or does each case require it's own trigger? Here's some pseudo-code for what I'd like to achieve in the triggers: "if (var == 1) do action 1; else do action 2;" or "if (var == 1) do action 1; else if (var = string) do action ShowString();"
Edited by Aeireon on 3/13/2012 12:50 PM PDT
Reply Quote
Posts: 510
03/13/2012 12:45 PMPosted by Aeireon
In the Event->Conditions->Actions, can you specify actions to do depending on various conditions in the same trigger, or does each case require it's own trigger? Here's some pseudo-code for what I'd like to achieve in the triggers: "if (var == 1) do action 1; else do action 2;" or "if (var == 1) do action 1; else if (var = string) do action ShowString();"


You're looking for "If Then Else" or "If Then Else-If".
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)
Submit Cancel

Reported!

[Close]