• 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 unit at a specific point

Status
Not open for further replies.
Level 2
Joined
Mar 5, 2020
Messages
10
Hey,
I have some buildings where i can buy units. How can i define the exact point where units appear when they are bought? They are all spawning on the bottom left of each barrack for now
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,872
Create a Point variable and this trigger:

Edit*
  • Events:
  • A unit finishes training a unit
  • Actions:
  • Set Variable Point1 = Position of Triggering unit
  • Set Variable Point2 = Point1 offset by X distance towards X angle
  • ^ This is called point with polar offset
  • Unit - Move trained unit instantly to Point2
  • Custom script: call RemoveLocation(udg_Point1)
  • Custom script: call RemoveLocation(udg_Point2)
 
Last edited:
Level 6
Joined
Dec 31, 2017
Messages
138
Create a Point variable and this trigger:

  • Events:
  • A unit finishes training a unit
  • Actions:
  • Set Point equal to position of triggering unit offset by X distance towards X angle <--- This is called point with polar offset
  • Move trained unit instantly to point
  • Custom Script: call RemoveLocation(udg_Point) <--- Replace "Point" with the name of your Point variable, keep everything else exactly as it is
Doesn't it leak (Position of (Triggering unit))?
 
Status
Not open for further replies.
Top