• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!

[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)
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
Judging by your trigger, you are setting Unit-type variable, whereas you should set Unit variable for it to properly selected.

If the unit is pre-set, you can normally use Unit variable, if it's not, then use vendeta said
 
Status
Not open for further replies.
Top