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

[General] Simple Trigger Problem

Status
Not open for further replies.
Level 1
Joined
Feb 6, 2017
Messages
2
Quite simple trigger. Maybe I'm just completely blind, but it seems there is no way to refer to the Unit constructing the structure (not the constructed unit). "Triggering Unit" does not work.

Edit: My problem is (if I wasn't clear enough): I can't find a way to refer to the Constructing Unit,



upload_2019-10-21_3-4-7.png
 
Level 45
Joined
Feb 27, 2007
Messages
5,578
There isn't a native way, as explained by Dr Super Good in this thread.
Dr Super Good said:
Impossible without a complex system. This is because buildings do not have to be started by a builder and can infact be started by any old unit.

Thus the only real way is to guess who builds a building via triggers.

How I did this was start by getting when an order to build a building is issued, and then knwoing that unit must build the building there. If a building is started construction at that point then it must be from that builder. You add other checks mike making sure the building is owned by the right player, that the building is the right type etc and you can obtain near 100% accuracy. The only thing my system failed to do was if more than one builder orderd the same building at the same point for the same player, then it would get one of the builders seemingly randomly and make it the constructor.
 
Status
Not open for further replies.
Top