| 01-19-2005, 02:52 PM | #1 |
Hello.. Now i need some advanced help! (or maybe it isn't advanced at all) I wonder how to do that if a unit for an example the villager puts up a item that is a bow or something he will become an archer (he will be the villager put he will carry a bow or something). Then i wonder how to do that the archer only can fire arrows if he have arrows(charged item) in the inventory. [not importnant->I also want that the archer shall have an attack all the time but only be able to fire when got ammo! not that the attack 1 for an example becomes enable!<-] |
| 01-19-2005, 05:07 PM | #2 |
Have the item that the villager can pick up. Then he picks it up, then use a trigger to replace him with a unit with an attack appropriate for a bow. He drops it, replace him with a villager. Event - A unit aquires an item Condition - item-type equal to bow and unit-type of hero manipulating item = villager Action- Replace hero manipulating item with a bowman using the old unit's relative life and mana And for the arrows, make an item along the lines of "quiver of arrows" with a few charges on it. Event - a unit it attacked Condition - Unit type of attacking unit = bowman Action - IF number of charges carried by attacking unit of type quiver of arrows greater than or equal to 0 then Set number of charges in item carried by hero of type quiver of arrows = to charges in item carried by hero of type quiver of arrows -1. Else Order with no target - order attacking unit to stop That way, if he attacks and he has no arrows at all, or his quiver is empty, he'll be stopped before he can fire. That hidden bit is trickier to execute. If i thought about it, i could come up with something, but at this point i'm drawing a blank. Well, you did say that wasn't important. |
| 01-19-2005, 05:28 PM | #3 | |
Quote:
Well... I'm glad you answered my thread I would also like if the unit just being transformed instead of replaced.. ^_^ |
| 01-19-2005, 07:11 PM | #4 |
Create a custom "Chaos" ability, and set the "New Unit Type" to be whatever you want the unit to turn in to. Then, instead of replacing it, add the Custom Ability you just created (Unit - Add (Ability) to (Unit)). This will preserve and unit groupings(Ctrl + #) and selections. There is no easy way to just add a weapon to a unit, and have it use the correct animations. You could easily attach a bow, but it would not be animated, and the unit would still use his/her default attack animation (and probally swing it). |
| 01-20-2005, 12:30 PM | #5 |
Thanks |
