| 03-30-2004, 09:50 PM | #1 |
In theory, this is a no-brainer. You go to the standard GUI triggers, and select Unit-set construction progress- 100%. Right? Wrong. I cannot get a building to finish construction unless a unit with the repair ability has the finsihing tap at the structure, and for various reasons this is something I'd prefer to avoid. What am I doing wrong here? Shouldn't it be possible to do this entirely using triggers? |
| 03-30-2004, 10:25 PM | #2 |
Can you explain a little more about what you need to happen? If I was trying to make a trigger that (say) took a building that had been ordered to upgrade and instantaneously turn it into the upgraded building, I'd just catch the order and Replace the building with a new one of the appropriate type... Why do you need to mess with construction? |
| 03-31-2004, 02:24 PM | #3 |
I have several triggers listening in on that building that will need to be replaced or reset or whatever you care to call it if it's replaced. Actually, that's what I'm doing at the moment, but it's something I'd much prefer to avoid. |
| 04-01-2004, 03:53 PM | #4 |
It seems to me like you're going to have to deal with the triggers differently. Are there only a couple of these buildings, or can players build them, or are there a ton of them on the map? Instead of your triggers using "X unit is (destroyed, attacked, whatever)" try using generic unit events and conditions to get there, using a Unit Group for the buildings. Then when a building of any kind you want the triggers to happen for is created, add it to the Unit Group. And in the replacement trigger, remove the unit from the Unit Group before you replace it, and add it afterwards. Would that simplify things? Oh well. Good hunting! |
| 04-01-2004, 05:24 PM | #5 |
I'm afraid they're both player built and there will be quite a few on the map- though I'm limiting 6 players to 32 buildings each. One idea I've been hoping would work would be to use CreateSpellEffect (or some such similar JASS function,) to use repair on the building without having to equip a unit with the ability. Thanks for the advice. |
| 04-01-2004, 06:52 PM | #6 |
It's funny that it would need to be repaired... have you tried setting the unit's life to 100% too? At the WORST, you could have a modified repair ability that was extremely fast, create an invisible repairing unit for the upgrader at the position of the building, order it to repair the building, and then explode it. |
| 04-01-2004, 09:11 PM | #7 |
Yup. It increments the unit's current health by 10 every 2 seconds, scaling the construction progress accordingly. I'll get back to you if there are further problems :) |
