HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

No multiple items

07-16-2007, 09:56 PM#1
Dooblivion
Hi
I see that it some maps(mostly rpgs), when you pick an item like: Amour or a weapon,
and if you already have a weapon or an armour with you you drop the item back...
I'd like to know how to do that plz
Example: Item system with D3fi4anc3
07-16-2007, 09:57 PM#2
Anopob
You can do it like this:

Make a class of an item (Artifact, Purchasable, etc.) to say, WEAPON, and then check when a unit picks up an item. If they already have the same item class (Artifact, etc.) then drop the item.
07-16-2007, 11:09 PM#3
maximilianx
yes thats the easy way, but if you want to have many types of items..
like ring, potion, sword, armor, boots, leggings, helm, necklace, bracelets, like a lot more than there are actual item classifications, then you can use a more complicated trigger

variable: Has_Ring (type boolean)

list events:
  • unit picks up item of type(ring1)
  • unit picks up item of type(ring2)
  • etc..

and actions:
  • if Has_Ring equal to False
    • then set Has_Ring to True
    • else drop item being manipulated

and you can do one of those for every type of item, you will also need a trigger with the dropping events to set the Has_Ring variable to False when the unit drops a ring..don't ask why i didn't use trigger tags for this post.
07-17-2007, 01:16 AM#4
midiway
here


a good tutorial
07-17-2007, 01:25 AM#5
maximilianx
seems like a really complicated way of doing it, but it'd work just fine.