Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
I have created 3 items. One of Lanza, another of Espada and another of Ax. How can I make an RPG hero only carry one of these 3 elements? Taking into account the inventory has capacity for 6 items.
Make a trigger that activates when a hero pick an item that checks the hero have no incompatible items and if there is an incompatible item make the picked item drop on the ground.
There are multiple ways to do it. Here's my approach using item classes and a boolean variable.
Acquire Item
Evénements
Unité - A unit Acquiert un objet
Conditions
(Item-class of (Item being manipulated)) Egal à Permanent
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Si - Conditions
HeroHasItem[(Player number of (Owner of (Triggering unit)))] Egal à TRUE
Alors - Actions
Partie - Display to (Player group((Owner of (Triggering unit)))) for 5.00 seconds the text: You can only have 1...
Héros - Drop (Item being manipulated) from (Triggering unit)
Sinon - Actions
Set HeroHasItem[(Player number of (Owner of (Triggering unit)))] = TRUE
Drop Item
Evénements
Unité - A unit Perd un objet
Conditions
(Item-class of (Item being manipulated)) Egal à Permanent
Actions
Set HeroHasItem[(Player number of (Owner of (Triggering unit)))] = FALSE
Basically, when a hero acquires an item of class Permanent (these classes are already built in the item editor, you can use whichever you want), I use a boolean variable to check what to do:
- If it returns false, the hero gets the item and the variable turns to true
- If it returns true, the item is dropped and a message tells the player they can't use more than 1 weapon (optional)
This will only work if you have 1 hero per player, though, but that's the gist of it.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.