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

Spawn & Move

Status
Not open for further replies.
Level 4
Joined
May 24, 2007
Messages
73
I require help with a certain trigger. I'm making a trigger that once you purchse a unit at a tavern, the unit moves to a random base location (Base location is a unit). But I also want it to make sure that other players dont get the same base location as them. Think someone can help?
 
Level 4
Joined
Jan 2, 2008
Messages
103
This is not madness!

Ok If I understand right...

  • Sell Me
    • Events
      • Unit - A unit Sells a unit
    • Conditions
    • Actions:Unit Group - Pick every unit in (Units owned by (Owner of (Buying unit)) matching ((Unit-type of (Picked unit)) Equal to Footman)) and do (Unit - Move (Sold unit) instantly to (Position of (Picked unit)))
Swap Footman with Base location
 
Level 4
Joined
May 24, 2007
Messages
73
Unless you really need the base location for other things, why not simply remove the base location when a unit is bought?

Wait, would this work
  • Lala
    • Events
      • Unit - A unit enters Region 000 <gen>
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Human
    • Actions
      • Unit - Remove (Buying unit) from the game
      • Unit - Create 1 Town Hall for (Owner of (Triggering unit)) at (Position of (Random unit from (Units of type Base Location))) facing Default building facing degrees
      • If ((Unit-type of (Triggering unit)) Equal to Base Location) then do (Unit Group - Pick every unit in (Units within 512.00 of (Position of (Triggering unit))) and do (Unit - Remove (Triggering unit) from the game)) else do (Do nothing)
 
Level 4
Joined
May 24, 2007
Messages
73
How about now. I swapped the event around but i dont know if itll work. Since i want the wisp to purchase the thing at the tavern and get removed.
  • Lala
    • Events
      • Unit - A unit Sells a unit
    • Conditions
      • (Unit-type of (Sold unit)) Equal to Human
    • Actions
      • Unit - Remove (Buying unit) from the game
      • Unit - Create 1 Town Hall for (Owner of (Triggering unit)) at (Position of (Random unit from (Units of type Base Location))) facing Default building facing degrees
      • If ((Unit-type of (Triggering unit)) Equal to Base Location) then do (Unit Group - Pick every unit in (Units within 512.00 of (Position of (Triggering unit))) and do (Unit - Remove (Triggering unit) from the game)) else do (Do nothing)
 
Level 21
Joined
Aug 21, 2005
Messages
3,699
  • Lala
    • Events
      • Unit - A unit Sells a unit
    • Conditions
      • (Unit-type of (Sold unit)) Equal to Human
    • Actions
      • Unit - Remove (Buying unit) from the game
      • set unit_var = Random unit from (Units of type Base Location))
      • Unit - create 1 town hall at position of unit_var
      • Unit - Remove (unit_var) from the game
 
Status
Not open for further replies.
Top