| 12-29-2006, 05:46 PM | #1 |
Okay, I'm hacking my way through the Warcraft III engine to try to make a game like Total Annihilation (with resources that deplete over time as you build, instead of being used up as soon as you click, like in Warcraft or StarCraft). One of the key points of the game is that different units can build the same kinds of structure, but some can build them faster than others. Units can also "powerbuild" like in Warcraft III. I rolled my own resource system, and it works fine. What I DON'T know how to do is how to make a Peasant, for example, build a Lumber Mill faster than a Peon. I've thought about making an identical building for each type of worker, which builds faster or slower based on what unit builds it. However, if a Peasant starts the building, then leaves and lets a Peon finish it, I want the building to build at the speed that the Peon would normally build it at, not the Peasant's normal build speed. I think my best chance is to use an invisible dummy unit to "powerbuild" when a unit should build something faster than normal, but I can't find any way to order it to powerbuild through triggers (telling it to "Repair" the building doesn't work, because it isn't finished, and telling it to "Right Click" only makes it move to the building). If I could just find a way to order a dummy unit to help build the building, I could control how fast everything builds by the number of dummy helpers I assign to the building, but I can't get it to work! PLEASE help me! I think this map would be really cool, I just need to do a lot of trigger writing to get there. Thank you for your time! |
| 12-29-2006, 05:50 PM | #2 |
Use a trigger that checks if a unit is powerbuilding, and if it is, set construction percentage to a bit higher, or whatever. |
| 12-29-2006, 05:52 PM | #3 |
Is the dummy unit owned by the player with the peasant building the structure? |
| 12-29-2006, 06:00 PM | #4 | |
Quote:
I actually tried something like this, but the problem is that you can't find out what the construction progress is for a building. Basically, you can't say something like "Set building Construction Progress = (Construction Progress of (Constructing Building) + 1)", because you don't know how close the building is to being completed. Oh, and Illidan, yes, the dummy unit is owned by the same player as the building. |
| 12-29-2006, 07:01 PM | #5 |
Alrightly then either I don't know or it's impossible, sorry. |
| 12-29-2006, 09:50 PM | #6 | |
Quote:
Actually, that isnt quite true. you can find the construction progress, it is very simple. all you have to do is get the percentage of life of the building, that IS the progress, i just tested it. (or you could find it manually current life/max life) |
| 12-29-2006, 10:12 PM | #7 |
Unless someone comes along and smacks the building a few times, thus screwing that calculation up. |
| 12-29-2006, 10:25 PM | #8 |
you'd be paying less for a building that'll come out broken. its like if someone sold you something that didn,t work and gave you back some money... right? I really can't check. Only humans can "powerbuild". |
