• 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.

[Trigger] How to select newly created units with a command

Status
Not open for further replies.
Level 7
Joined
May 23, 2011
Messages
179
What am i suppose to do when i type "-s" then the Unit Shop is selected.
Heres my trigger
  • Index
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set Shoppe = Shop
  • Select Shop
    • Events
      • Player - Player 2 (Blue) types a chat message containing -s as An exact match
    • Conditions
    • Actions
      • Selection - Select Unit for Player 2 (Blue)
I cant select the desired unit since the unit is newly created... Please help...
 
Level 3
Joined
Nov 10, 2011
Messages
51
First create a variable of type *unit* then go to the trigger where you have created the new unit and add Set- Variable=Last created unit. it should be like that.

  • Index
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Unit - Create 1 Arcane Vault for Player 1 (Red) at (Center of (Playable map area)) facing Default building facing degrees
      • Set NewUnit = (Last created unit)
  • Select shop
    • Events
      • Player - Player 2 (Blue) types a chat message containing -s as An exact match
    • Conditions
    • Actions
      • Selection - Select NewUnit for Player 2 (Blue)
 
Status
Not open for further replies.
Top