Get Building Unit Help

cstorm

New Member
Reaction score
1
Im trying to set a variable(Unit) to the unit constructing a building. Any help?
Clarification- My hero has a build function, how do I set my variable(Unit) to the hero constructing so I can add experience to that unit(Via Variable because their are multiple heroes who can also construct) later.
 

OMGOMGOMG

UMBWGMG (Unidentified Human Being.)
Reaction score
28
What you need to do is set the Unit variable to Unit-Type then under the array click the blue box and click the unit you want.

I can make a quick map with the variable in it. just tell me the unit that's getting constructed or constructing the unit.
 

cstorm

New Member
Reaction score
1
-

not quite sure what that would help me do since it wouldnt save the builder as a specific unit i can modify.
 

OMGOMGOMG

UMBWGMG (Unidentified Human Being.)
Reaction score
28
You would need triggers to go with that
Trigger:
  • Events
    • Your events
    • Conditions
      • Your conditions
    • Actions
      • Set <Your UnitVariable> = Triggering unit
      • Your actions


And also if you want to save the builder as a specific unit, change the constructed unit to the unit that is building that unit. And if you want to save the constructed unit as a unit go:

Trigger:
  • Untitled trigger
    • Events
      • Your events
    • Conditions
      • Your conditions
    • Actions
      • Set <Your UnitVariable> = Triggering unit
      • Set Constructedunit = Constructing Unit
      • Your actions
 

cstorm

New Member
Reaction score
1
Trigger:
Untitled trigger
Events
Your events
Conditions
Your conditions
Actions
Set <Your UnitVariable> = Triggering unit
Set Constructedunit = Constructing Unit
Your actions
The bolded part is incorrect. There is no "Constructing Unit" choice which is my problem. There is a "Constructing Structure" but that selects the Structure being built. "Triggering Unit" does not select the builder. I need the builder, and There doesn't seem to be a function for that.
 

OMGOMGOMG

UMBWGMG (Unidentified Human Being.)
Reaction score
28
ConstructingStructure = Constructing Structure

Set Constructingunit = triggering unit,

refresh the post for the link to the map for the triggers and variables

That should work and use [WC3 ] [/WC3 ] for triggers. (no spaces)

Variables REMEMBER the unit's, you only need variables if there's more than one trigger that needs it.

This is for one whole trigger.
Trigger:
  • Untitled Trigger
    • Events
    • Conditions
      • (Triggering Unit) = Peon
      • (Constructing structure) = Barracks
    • Actions


So, I'm guessing it worked?
 

KaerfNomekop

Swim, fishies. Swim through the veil of steel.
Reaction score
613
Begins Construction: Triggering Unit and Constructing Structure return the building that began construction.
Cancels Construction: Triggering Unit and Cancelled Structure return the building that was canceled.
Finishes Construction: Triggering Unit and Constructed Structure return the building that finished construction.

None of them have an event response for the building unit. You can use the event A unit Is issued an order targeting a point, which tells you when the order to build a building is issued, then check the Issued Order to know what building it was.
 

Accname

2D-Graphics enthusiast
Reaction score
1,464
There is unfortunately no safe way to get the constructing unit.
Like KaerfNomekop said the best you can get is a approximation but to make it really accurate in any condition it would take alot, and i mean alot, of triggers and work.

I dont know why blizzard did this but it is kind of sad.
 

Kayoss666

Member
Reaction score
7
you could do something like this:

Trigger:
  • build
    • Events
      • Unit - A unit Begins construction
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units in (Region centered at (Position of (Constructing structure)) with size (100.00, 100.00))) and do (Actions)
        • Loop - Actions
          • Unit Group - Add (Picked unit) to buildingHero
      • Trigger - Turn on buildexp &lt;gen&gt;
      • Trigger - Run buildexp &lt;gen&gt; (ignoring conditions)

Trigger:
  • buildexp
    • Events
      • Time - Every 10.00 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in buildingHero and do (Actions)
        • Loop - Actions
          • Hero - Add 50 experience to (Picked unit), Hide level-up graphics

Trigger:
  • finbuild
    • Events
      • Unit - A unit Finishes construction
    • Conditions
    • Actions
      • Trigger - Turn off buildexp &lt;gen&gt;
 

Accname

2D-Graphics enthusiast
Reaction score
1,464
@Kayoss666:
What if the player cancels construction, you need another trigger for that.
What if the building units race is human, then you would need to check whether the construction process of the constructing structure has changed since the last iteration. (not the HP! because the structure might get attacked while being constructed)
What if the building units race is orc and is thus not detected as a unit in range of the constructing structure in your trigger since it is removed from the playable map area when construction begins?

To get the building unit accurately you will need a very complex trigger system. If you focus on the building of a single race, undead would be best, then it will become easier.
For humans it will become incredibly hard, and getting it MUI will be a real pain.
 

Kayoss666

Member
Reaction score
7
@Accname:
i figured it would be more complicating then that i was just trying to give a starting idea.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top