• 🏆 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!

How to detect when construction has started

Status
Not open for further replies.
Level 5
Joined
Mar 27, 2008
Messages
107
This is pretty much the kind of trigger I want, but I cant find any event response to replace 'Construct' with, which doesnt really exist in the trigger editor.
Event Responce - Constructed Structure refers to the unit building it btw, so dont bother with that.

  • Building Built
    • Events
      • Unit - A unit Finishes construction
    • Conditions
      • (Unit-type of (Construct)) Equal to Farm
    • Actions
      • Unit - Kill (Construct)
So yeah basically, a unit builds a building. If that building is of unit type Farm, it should be killed.

Thank you!
 
There is some library on the TheHelper.net (kinda old) that detects the builder. You can also make a periodic event to check if the current order of the builder is not equal to build (detect that order with a trigger, before you make the check) and if the life of the constructing structure is equal to 100% of its max health. If they are true, kill the unit (add in a unit group).
 

Dr Super Good

Spell Reviewer
Level 63
Joined
Jan 18, 2005
Messages
27,188
Event Responce - Constructed Structure refers to the unit building it btw, so dont bother with that.
No it does not, it refers to the unit that was built.

The fact is one can not refer to the builder who finishes building a building because buildings can be built by multiple builders (human) or none at all (anciencts where builder dies and undead where buildings auto build). I agree that blizzard did miss out some important event data though...

Construction starts event does not let you get the builder who started the structure. Only way around this is a complex system of hashing build orders and approximating via logic who is most likly go have started that building. Closest I got was separate player accuracy but 2 build orders at the same place for the same player might yield wrong results.

For your problem... I advise you look at the night elf wisps and how they make ancients. That behaviour looks like what you want.
 
Level 7
Joined
May 13, 2011
Messages
310
@DSG: I think what Softy wants is to detect the unit being built, not the unit building it. Therefore your answer "No it does not, it refers to the unit that was built" was probably sufficient.

So, Softy, this is what you want:

  • Kill All Farms
    • Events
      • Unit - A unit Finishes construction
    • Conditions
      • (Unit-type of (Constructed structure)) Equal to Farm
    • Actions
      • Unit - Kill (Constructed structure)
And I can assure you that "Event Response - Constructed Structure" does do what you want. The World Editor itself says:

When responding to a 'Finishes Construction' unit event, this refers to the unit whose construction has finished.
 
Level 17
Joined
Apr 27, 2008
Messages
2,455
Level 19
Joined
Feb 4, 2009
Messages
1,313
The fact is one can not refer to the builder who finishes building a building because buildings can be built by multiple builders (human) or none at all (anciencts where builder dies and undead where buildings auto build). I agree that blizzard did miss out some important event data though...

the wisps are hidden until the building is finished (you can reveal them actually) so checking for units which were removed directly after or before (don't know) the building is finished should reveal the builder
 
Status
Not open for further replies.
Top