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

[Trigger] Get Builder?

Status
Not open for further replies.
Is there a way (custom script or not) to identify the specific builder that begins the construction of a building? I tried triggering unit but that didn't work since in this instance the triggering unit is the building that is being built. I'm using 'Unit - A unit Begins construction' as event.

Anyone have any idea of how I can solve this?
 
Level 13
Joined
Mar 24, 2013
Messages
1,105
You could use
  • Unit - A unit Is issued an order targeting a point

Check if its order == farm/barracks/whatever

And if its order is something like this you can choose to save this unit to a variable to use it for something later
 
GetConstructingStructure() does not work?
well I need the builder/worker, not the building. And if you're refering to pOke's reply, it doesn't work.

store the building by using the key of the builder to load the key of the building.
then load what u need from that part of the hashtable using the buildings key.
That's precisely what I can't get. If I have one I can't find the other. There is no Set HandleInt = (Key(Constructing Unit)) option. I thought triggering unit would identify the builder but it just identified the building instead.
 
Level 7
Joined
Apr 5, 2011
Messages
245
attachment.php
 

Attachments

  • KappaKappa.JPG
    KappaKappa.JPG
    20.4 KB · Views: 191
@TO
how are u checking for the unit can u show us plz.
  • Events
    • Unit - A unit Begins construction
  • Conditions
    • (Unit-type of (Triggering Unit)) Equal to BuildingX
  • Actions
    • Set HandleInt = (Key(Triggering Unit)) //Should be builder instead of building but I can't find the option for that
    • Hastable - Save Handle of(Triggering unit) as HandleInt of 2 in MainHashtable
    • //...etc
 
Level 7
Joined
Apr 5, 2011
Messages
245
I don't know why should you need your builder be locust, but if you need it be locust since its creation, you can try to Hide unit, then Show (this removes Locust), then Pick, then again add Locust. I dunno if this works though :S
 
I don't know why should you need your builder be locust, but if you need it be locust since its creation, you can try to Hide unit, then Show (this removes Locust), then Pick, then again add Locust. I dunno if this works though :S
I'm making a custom type of base-building where the buildings are connected to the main one. The locusted builder is a dummy that creates the building because the Town Hall is the builder.

I meant register every locust in unit array, for example
(When it just appeard)
Well that still won't tell me which builder built the building.
 
if ur builder has locust then how do u order it to build ? can u show me that trigger ?

@ krogoth
plz stop double posting it is against the rules.
  • Events
    • Unit - A unit is issued an order targeting a point
  • Conditions
    • (Unit-Type of (Triggering unit)) Equal to Town Hall
  • Actions
    • Set TempPoint = (Target Point of Issued Order)
    • Unit - Create DummyBilder at blah blah
    • Unit - Issue Order to build etc etc
^This trigger works, but I can't identify the building being built since it hasn't happened yet, so I used a second trigger (the one I showed earlier) to know when the construction has started. It's the earlier trigger that I'm having some difficulty with because I can't identify the builder.

So, what the reason to not use Town Hall directly? Build range can be increased easily. (Not exactly "easily" though =D)
Well the Town Hall can't move and stuff that can't move can't build :(
 
Level 7
Joined
Apr 5, 2011
Messages
245
Well the Town Hall can't move and stuff that can't move can't build :(
If you do not use mana on your Town Hall, you can use Build Tiny Farm ability ('Albf') to build your units, increase its cast range and set manacost equal to gold cost (as well as sync Town Hall's mana with player's gold)
Place your abilities in a Spellbook, change Spellbook's icon / title to Build icon / title
This would be much better than weird triggering
 
If you do not use mana on your Town Hall, you can use Build Tiny Farm ability ('Albf') to build your units, increase its cast range and set manacost equal to gold cost (as well as sync Town Hall's mana with player's gold)
Place your abilities in a Spellbook, change Spellbook's icon / title to Build icon / title
This would be much better than weird triggering
Er, no, I'd prefer to have a system that tells you how much gold and lumber something will cost, with it's actual gold/lumber icons. What your suggesting doesn't have a presentation I want. It can work but I'd rather try my luck with what I'm trying to do :). I know I can make it work I just need this one little thing I asked in the OP. I can already make it work if I remove the locust on the builder but it will conflict if there's any overlap. (buildings selecting more than one builder, for instance. It's unlikely to happen, but just to be sure)
 
It would be easier if u dont put locust on the dummy unit.
If u dont use locust unit u can use unit group to check if the unit is in range.

The reason i asked for the actual trigger was u can possibly combine the 2 triggers to make it work. I cant see that without the actual trigger tho.

Im not gonna sit here guessing how ur system works so plz post it so i can help more.

Also y do u add locust ?
 
It would be easier if u dont put locust on the dummy unit.
If u dont use locust unit u can use unit group to check if the unit is in range.

The reason i asked for the actual trigger was u can possibly combine the 2 triggers to make it work. I cant see that without the actual trigger tho.

Im not gonna sit here guessing how ur system works so plz post it so i can help more.

Also y do u add locust ?
I'll just show you the map it'll be easier. The building you want ot focus on is the Gryphon Aviary since the rest are not meant to trigger the system's connecting line mechanic.

Map

Trigger in question is 'Connect to Main'

PS: I removed locust because the acolyte wasn't being picked, but I put locust in because it's a DummyBuilder as in you're not supposed to know it's there/interact with it. I'll eventually give it no model.
 
The DummyBuilder is being used as the key that connects the Town Hall with the other building, and a bunch of other dummy units that trace a line on the ground so that when the building dies the the DummyBuilder is selected and from there I kill the dummy units that compose the line, and clear the child hashtable. I'll test with hiding the unit and see if it can still be loaded from a hashtable when hidden.

EDIT: It worked! Thanks :)
 
Status
Not open for further replies.
Top