PDA

View Full Version : Short Question


Aqo
08-14-2005, 12:40 PM
How do I limit items to specific units?
Like, for example, only footmen with inventory will be able to pick up swords, only archers will be able to pick up bows, etc. If an archer tries to pick up a sword nothing will happen.
Also, don’t suggest me to make a trigger that drops items from units that shouldn’t carry them, because I also want to include powers ups that can be bought (so they won't appear in units inventory at all) thus I want to units not to be able to get items they shouldn’t have from the first place.
If that’s impossible, is there a way to limit the ‘hero select’ and/or 'unit select' abilities to specific units?

Thanks in advance.

XZminX
08-14-2005, 8:13 PM
Easy.
Make a trigger like this:
Action - unit acquires an item
Conds - none
actions - IF {{item == sword} AND {unit != footman}} THEN {remove item from unit and create item where it was before} ELSE {do nothing}

You may want to remember position of item (point variable) so you create item right where it was so the player wouldn't even notice that he picked item (if he wasnt playing with footman, offcourse)

do such IF-THEN-ELSE for each item or item-type.

Thats all.

Aqo
08-15-2005, 11:10 AM
How am I supposed to do the "remove item from unit and create item where it was before" part?
Also, what about powers ups, when you buy them they don't appear at the units inventory at all, they just take effect.

hooded
08-21-2005, 10:23 PM
use actions:
"remove item being manipulated"
and
"create 1 <item being manipulated> at position of <unit manipulating item> of item type <item being manipulated>"
or somthing like that

powerups are another matter, you can individually adjust the attributes of the hero after the unit picks up the item, but there is probably a better way of doing it.

XZminX
08-22-2005, 5:35 PM
As for powerups, there's a option in the Object Manager, it says something like this:
"Use when acquired" (it doesn't say like that, i'm 100% sure, but you got the point, you know what to search for) Untick it.

Aqo
08-23-2005, 6:27 AM
use actions:
"remove item being manipulated"
and
"create 1 <item being manipulated> at position of <unit manipulating item> of item type <item being manipulated>"
or somthing like that
Okay.

As for powerups, there's a option in the Object Manager, it says something like this:
"Use when acquired" (it doesn't say like that, i'm 100% sure, but you got the point, you know what to search for) Untick it.
That works! Thanks!