HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Event Response - Builder?

03-29-2007, 07:06 PM#1
The__Prophet
Am I missing somthing, or is there no way to detect what peon finished constructing a building. I originally tried using GetTriggerUnit() but after much testing, i found out that GetTriggerUnit() refers to the unit being built, not the builder.
03-29-2007, 07:12 PM#2
wussupallies
Under the Unit - Generic Unit there is an option for Finishes Construction of Building

After this it should be simple to add a condition for the building, and find the unit.

Here's what I did (GUI):

Trigger:
Build
Collapse Events
Unit - A unit Finishes construction
Collapse Conditions
(Unit-type of (Constructed structure)) Equal to Farm
Collapse Actions
Floating Text - Create floating text that reads "I did it!" above (Triggering unit) with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
03-30-2007, 01:46 AM#3
Pyrogasm
When the peon begins construction, attach it to the unit being built via Local Handle Variables or Structs (though I don't know how to use structs).

Then, when the unit is finished, just get the attached unit as the builder.

Of course, this would bug out if you started construction with one peon, then told it to stop, and finished construction with a new one.
03-30-2007, 02:13 AM#4
The__Prophet
What your saying works out in theory, but I don't see how it could possibly work. Since im ordering my peon to build a building, the building does not exist while running the intial trigger. Trust me, I've though long and hard about this problem. Thanks for your imput though.
03-30-2007, 04:47 AM#5
Zyrixion
If you could be a little more specific about what you are trying to do with your trigger, I could help you a lot more. The way to go about this kinda depends on what you're trying to get this to do.
03-30-2007, 05:06 AM#6
The__Prophet
Basically, Im creating an AI using jass, (cuase you can't run ai scripts with neutral players, plus I tried learning the AI stuff, and it was a pain in the butt, but anyways...) So basically, I had it set up where there was a list of buildings that needed to be built, and I wanted it so every time a peon was done building a building, to basically order him to start the next building.
03-30-2007, 06:24 AM#7
Zyrixion
You might try the event "a unit starts constructing," and use "triggering unit" for the builder and "constructing structure" for the target. Not tested, but that's my thought on the perliminary dig through the trigger editor. (dunno what these are in Jass, but you can just convert, I guess)
03-30-2007, 06:51 AM#8
The__Prophet
And, to quote myself earlier:
Quote:
Originally Posted by The__Prophet
Am I missing somthing, or is there no way to detect what peon finished constructing a building. I originally tried using GetTriggerUnit() but after much testing, i found out that GetTriggerUnit() refers to the unit being built, not the builder.

Blizzard is so lame for not making this a function.
03-30-2007, 10:39 AM#9
wussupallies
Quote:
Originally Posted by The__Prophet
And, to quote myself earlier:

Blizzard is so lame for not making this a function.
Oh, now I understand. I'll look into it more.