• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Solved] Ingame Commands

Status
Not open for further replies.
Level 16
Joined
Mar 27, 2011
Messages
1,349
So I'm new to SC2 Editor and finding it extremely difficult to learn, so excuse my noobiness.

So, for testing purposes I wanted to create a trigger that kills the player's hero when requested via the chat. This was so easy in WC3...

  • Test Kill Hero
  • Events
    • Conversation - Player Any Player selects Any Reply from Any Conversation
    • Local Variables
    • Conditions
    • Actions
      • Unit Group - Pick each unit in (Any units in (Units in (Entire map) having alliance Enemy with player Any Player matching Excluded: Missile, Dead, Hidden, with at most Any Amount) owned by player (Triggering player) matching Excluded: Self, Air, Ground, Light, Armored, Biological, Robotic, Mechanical, Psionic, Massive, Structure, Hover, Worker, Resource (Raw), Resource (Harvestable), Missile, Destructible, Item, Uncommandable, Can Have Energy, Can Have Shields, Prevent Defeat, Prevent Reveal, Buried, Cloaked, Visible, Stasis, Under Construction, Dead, Revivable, Hidden, Hallucination, Invulnerable, Has Energy, Has Shields, Benign, Passive, Detector, Radar, Stunned, Summoned, Unstoppable, Outer, Resistant, with at most Any Amount) and do (Actions)
        • Actions
So I'm struggling on a couple of things here.

(Any units in (Units in (Entire map) Now, why can't I find "playable map area", "Entire map" and what not? I can
find "Units in Region With Alliance to player"

And after my "matching", I have excluded so many types of units. I couldn't find the "Boolean" like in WC3 and simply select which
unit type I want it to equal too!

Oh, and how do I set what command I want? In my event, I couldn't specify a text input like in WC3. Maybe it would be easier if
somebody could post me the trigger so I can see how to do it. Thanks.
 
Last edited:

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,258
(Any units in (Units in (Entire map) Now, why can't I find "playable map area", "Entire map" and what not?
You can, you clearly are not looking hard enough. They are Region Functions which are clearly labelled. In reality they are actually natives unlike WC3's constants which means you will get a new region each time it is called. Regions cannot leak thanks to garbage collection however you may find it slightly more efficient to define a constant global region defining the entire map/playable map area if you do not plan to manipulate the region at all and use it at face value.

I couldn't find the "Boolean" like in WC3 and simply select which
unit type I want it to equal too!
SC2 GUI uses smart conditions. The type of test is based on the type you provide for the first argument. This then changes the type of the second argument to be the same as the first. Be careful to select the top level when changing the first argument as it defaults to owner of unit and tries to fool you into changing the target unit and not the top level function.

Code:
(Unit type of (Picked unit)) == Marine

You might not be able to use such advanced filters during a unit search. You may need to apply them to the results of a less well defined unit search by using a conditional statement.

Oh, and how do I set what command I want? In my event, I couldn't specify a text input like in WC3. Maybe it would be easier if somebody could post me the trigger so I can see how to do it. Thanks.
That is because you are using the wrong event?

Code:
Game - Player Any Player types a chat message containing "BREAK THE DAM, RELEASE THE RIVER!", matching Exactly
The event is basically the same as WC3 except it can be applied to all players (any player constant).
 
Status
Not open for further replies.
Top