HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

GetWorker()

04-11-2009, 05:06 PM#1
Troll-Brain
I get boring and realize i did'nt make something useless since a long time, so i plan to create a custom event response.
In fact i've already did it since months, but i need some motivation to continue it.
Because the hardest part is front of me, manage human and undead workers.
If someone is really interested by this function, i will try my best to finish it.
It could be useful for a TD or this kind of game.

First you have to know that the build ability is hardcoded, i mean only the unit race of the builder does matter of how the worker will build it (like an human,an undead or all the other races, night elves,orcs,nagas,neutral, and so one)
If you can remove the building ability in game, you can't add it, unless you use a morph ability ofc.

Actually it already works for all CONSTRUCT events, but not for humans and undeads.

They are pretty annoying to manage. I will try my best, but honestly i dunno if i will get something enough accurate and efficient, due the limitations of the editor.

Here is the code :
Expand JASS:


Link to Table :
http://www.wc3campaigns.net/showthread.php?t=101246

GetWorker() is not MUI by itself, you need use a local variable if you use waits. And for speed freak you should set a variable anyway, if you need to use it several times in the same function.

If you plan to Remove buildings with the function RemoveUnit, you should use


Code:
KillUnit(u) + ShowUnit(u,false)

instead, because it could leak if you don't.

Any (constructive) comments and ideas are welcome.

To do :

- Manage human workers
- Manage undead workers
- Manage humans building abilities like 'AIbl'