• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[General] How to get building unit?

Status
Not open for further replies.
Level 12
Joined
May 22, 2015
Messages
1,051
Would it be possible to detect it on:
"A unit enters <Playable map area>"?

Then you'd check if it is a building. Not sure if that's what you want and also note that this event might fire very often...
 
Level 12
Joined
May 22, 2015
Messages
1,051
What is the triggering unit for "unit starts construction"? Is that the building? That would be what I got confused by lol. I thought you wanted to get the unit being built.

Just reread your main post and that answered my question lol. My B.
 
Level 11
Joined
Jun 2, 2013
Messages
613
Since Warcraft likes to make things difficult and if you still wanted to use the 'Unit Begins Construction Event', technically this should be your building unit.
It wouldn't really work with powerbuilding obviously, but hey, it's the thought that counts right? I guess you could also do a condition check to make sure the picked unit's order is a build order and then set the unit variable if you wanted the extra check.

So yeah storing the ordered unit is ew, but then again this is probably more ew...

EDIT*
Oh, also this might not even work. I didn't actually test it...

  • Trigger
    • Events
      • Unit - A unit Begins construction
    • Conditions
    • Actions
      • Set TempPoint = (Position of (Triggering unit))
      • Set BuildingUnits = (Units within 120.00 of TempPoint matching (((Unit-type of (Matching unit)) Equal to Peasant) and ((Matching player) Equal to (Owner of (Triggering unit)))))
      • Unit Group - Pick every unit in BuldingUnits and do (Actions)
        • Loop - Actions
          • Set YourBuilder = (Picked unit)
      • Custom script: call RemoveLocation(udg_TempPoint)
      • Custom script: call DestroyGroup(udg_BuildingUnits)
 
Last edited:
Status
Not open for further replies.
Top