How to check if a building is "complete"?

Immolation

Member
Reaction score
20
How can I check if a building is constructed or it's still being constructed?
Thanks, I really need this condition. :D
 

AceHart

Your Friendly Neighborhood Admin
Reaction score
1,495
Not possible.

However, assuming you don't need its custom value:
Event:
- A unit finishes construction
Conditions:
Actions:
- Unit - Set (Triggering unit)'s custom value to 1

And you can test for that custom value being 1.
 

averes

New Member
Reaction score
17
Not possible.

However, assuming you don't need its custom value:
Event:
- A unit finishes construction
Conditions:
Actions:
- Unit - Set (Triggering unit)'s custom value to 1

And you can test for that custom value being 1.

Just a note, I'm pretty sure in this case Triggering Unit would refer to the builder, youd need to use ConstructedStructure.
 

Bloodcount

Starcraft II Moderator
Reaction score
297
That is AceHart..... you know.... the one above all? If there is anything that you think is inpossible he will offer the answer :p Anyway.... I feel stupid after posting this :p

EDIT: averes... the triggering unit is the one who's construction is finished. Unless the worker is being construcked by the building evrything will be fine.
 

averes

New Member
Reaction score
17
That is AceHart..... you know.... the one above all? If there is anything that you think is inpossible he will offer the answer :p Anyway.... I feel stupid after posting this :p

EDIT: averes... the triggering unit is the one who's construction is finished. Unless the worker is being construcked by the building evrything will be fine.

Exactly... the triggering unit is the units whos construction just finished. IE the builder.

Also, if you do end up needing your structures to have a custom value for something else you can replicate this using a unitgroup. Just add all completed structures to it and check if the building is in the unitgroup.
 

Immolation

Member
Reaction score
20
You're confusing me, using the "Unit finishes costruction":

(Triggering Unit) is the builder and
(Constructed Structure) the structure? :confused:
 

Bloodcount

Starcraft II Moderator
Reaction score
297
DO NOT LISTEN TO HIM FOR GOD"S SAKE. THE TRIGGERING UNIT IS THE BUILDING! Now Averes, STFU. I the expirience I have over you is as big as the universe. The expirience that Ace has over you is bigger then infinity.
 

Kikac_NNGK

Well-Known Member
Reaction score
33
DO NOT LISTEN TO HIM FOR GOD"S SAKE. THE TRIGGERING UNIT IS THE BUILDING! Now Averes, STFU. I the expirience I have over you is as big as the universe. The expirience that Ace has over you is bigger then infinity.

He's right averes. The triggering unit is the units whos construction just finished
 

Bloodcount

Starcraft II Moderator
Reaction score
297
He's right averes. The triggering unit is the units whos construction just finished

I am famous for beeing both as cool as ice and a hot as a flame, so I guess this guy maniged to fire me up. Oh, well. Atleast the question is answered.
 

averes

New Member
Reaction score
17
Yeah just tested it. Apparently they both return the constructed structure... Does that mean there isn't a way to return the builder?
 

Immolation

Member
Reaction score
20
Well then, both this:

Trigger:
  • Finish Building
    • Events
      • Unit - A unit Finishes construction
    • Conditions
    • Actions
      • Unit - Set the custom value of (Triggering unit) to 1
      • Set MilitaryUBarracks_Unitgroup[(Player number of (Owner of (Triggering unit)))] = (Units owned by (Owner of (Triggering unit)) matching (((Unit-type of (Triggering unit)) Equal to Barracks) and ((Custom value of (Triggering unit)) Equal to 1)))
      • Player - Limit training of Footman to (12 x (Number of units in MilitaryUBarracks_Unitgroup[(Player number of (Owner of (Triggering unit)))])) for (Owner of (Triggering unit))


And this:
Trigger:
  • Set Limit
    • Events
      • Unit - A unit Dies
      • Unit - A unit Finishes training a unit
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Unit-type of (Triggering unit)) Equal to Barracks
    • Actions
      • Set MilitaryUBarracks_Unitgroup[(Player number of (Owner of (Triggering unit)))] = (Units owned by (Owner of (Triggering unit)) matching (((Unit-type of (Triggering unit)) Equal to Barracks) and ((Custom value of (Triggering unit)) Equal to 1)))
      • Player - Limit training of Footman to (12 x (Number of units in MilitaryUBarracks_Unitgroup[(Player number of (Owner of (Triggering unit)))])) for (Owner of (Triggering unit))


Aren't working.
 

Bloodcount

Starcraft II Moderator
Reaction score
297
Event: Unit finished construction.

Then the triggering unit is the worker.

Immolation, you want to limit the footmen to 12 per baraks?
 

averes

New Member
Reaction score
17
Event: Unit finished construction.

Then the triggering unit is the worker.

Immolation, you want to limit the footmen to 12 per baraks?

Lmao didn't know there were two events for this. All that hate over 1 letter :(

EDIT: The event you said doesn't exist, atleast I've been unable to find it. Which still leaves the question how one returns the unit that constructed the structure.
 

Bloodcount

Starcraft II Moderator
Reaction score
297
no hate here. Just passion.


Immolation.... I can think up of a coupple of ways to do it.
When a unit finishes training a unit of type footman, check if the player owns more then 12 footnen X number of baracks. If it is more then the number, remove triggering unit from the game, else do nothing,
 

Immolation

Member
Reaction score
20
I want the button to blackout, like using the trigger(limit construction etc... etc... etc...). Any thoughts on why it doesn't work?
 

Bloodcount

Starcraft II Moderator
Reaction score
297
Perhaps:

Fnish Building

* Events
o Unit - A unit Finishes construction
* Conditions
* Actions
if triggering unit is of type Baraks
then
o Set MilitaryUBarracks_Unitgroup[(Player number of (Owner of (Triggering unit)))] = (Units owned by (Owner of (Triggering unit)) matching (((Unit-type of (Triggering unit)) Equal to Barracks) and ((Custom value of (Triggering unit)) Equal to 1)))
o Player - Limit training of Footman to (12 x (Number of units in MilitaryUBarracks_Unitgroup[(Player number of (Owner of (Triggering unit)))])) for (Owner of (Triggering unit))
else do nothing
 

AceHart

Your Friendly Neighborhood Admin
Reaction score
1,495
> Does that mean there isn't a way to return the builder?

Yep. Getting the worker is an ages old, and as of now still unsolved, problem.
There is no sure way to get him.

"Triggering unit", in general, is the unit the trigger is about.
In the case of "finishes construction", it's the unit that just now finished its very own construction, i.e. the building.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top