| 12-25-2002, 06:16 PM | #1 |
Guest | Hi Is there any way to refer to the unit that is doing the construction? I have made a custom unit and a custom building, and the custom unit should be able to build the custom building and disappear afterwards. I use the trigger "A Unit owned by ... begins construction", then I replace the custom building with a new one because building doesn't work for some reason. This is done with "Event Response - Constructing Structure", but I can't find any way to find out the unit that is constructing it. I don't want to do it with Unit in Region or something similar because the player might have more units of the same type standing around, and for my map it is really important to pick exactly the correct unit. Another question: does anyone know how to get the construction to work correctly? At the moment I have a custom unit based of the worker (for each race) and a custom building based of the circle of power, and when I order the worker to build the circle of power, it just appears as being built with progress bar and cancel button, but the progress bar doesn't move. As mentioned above, I got a workaround for this problem, but I would prefer if it worked correctly. The other problem I have at the moment absolutely no idea how to do this. Perhaps there is some way to change the worker behaviour into a wisps, so he disappears automatically? Any ideas? |
| 12-25-2002, 11:07 PM | #2 |
i think you need to use a different event: unit is ussed an order (build) ? |
| 12-26-2002, 11:45 AM | #3 |
Guest | That would work, but then I would get the event when the command is issued, not when the building begins. I want the unit to really walk to the point where it should build the building, otherwise it would be possible to build at locations that can not be reached by a land unit. But it is not absolutely neccessary that the unit builds the building, all I need is an additional button on a unit that raises a trigger, then I could hide/remove the original unit and create the new building on its position. I have only seen additional buttons in the form of trained custom units and a trigger that reacts to the creation of these, but then I can't get the unit whose button is clicked... |
| 12-26-2002, 04:25 PM | #4 |
How about unit finishes construction and use constructed unit variable? |
| 12-26-2002, 04:50 PM | #5 |
Guest | This gives me the unit that is being constructed, I want the unit that does the constructing. |
| 12-26-2002, 04:59 PM | #6 |
Ok then, do constructing unit variable. |
| 12-26-2002, 07:27 PM | #7 |
To add a button to a unit and have a trigger detect when that button is pressed, read my 'tutorial' @ http://www.wc3campaigns.com/forums/s...&threadid=4586 |
| 12-27-2002, 10:45 AM | #8 |
Guest | Fear.Factor: Where is this variable? Extarius: Thanks, I must have overlooked this one. It works for me, but I would still like to build the building, not sell it, because I have a problem with placing the building on top of something. I now have a unit that sells a "Beacon (build)". Then I have two triggers: "Beacon (build)" enters playable map: remove triggering unit order "Beacon (build)" is issued: create "Beacon (active)" at position (Position of triggering unit) ... My Problem is that with this method the "Beacon (active)" could end up at a position where a building is not allowed to be. How can I check if there is enough space to build this building? |
| 12-27-2002, 02:29 PM | #9 |
Sorry it's actually trained unit... but it is there! My mistake. EDIT: Bah, I did it again. Sorry, I just woke up. Anyways, it's constructing structure you want. It's in the list there. Just look for it. ;) It's the 3rd one that starts with Event Response |
| 12-27-2002, 05:21 PM | #10 |
Guest | Constructing structure is the structure that is being constructed in the "begins construction" event. I want the unit that is doing the construction. I don't think this is possible directly, there seems to be no function that returns the worker that is constructing the building. But it doesn't really matter, because I found a workaround (see the post of Extrarius and my reply). It would have been nice if the user could place the building with the building cursor, but I can live with the building getting sold. Thanks anyways |
