• 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!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

DOTA "Cannot carry more than one" help please

Status
Not open for further replies.
Level 10
Joined
Mar 17, 2012
Messages
582
Hi there! Guys help me please, my brain is sleeping! :goblin_cry:
I can't get how to do this thing!(
  • Boots Forbid
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Item-type of (Item being manipulated)) Equal to Boots of Fortification
          • (Item-type of (Item being manipulated)) Equal to Boots of Resistance
          • (Item-type of (Item being manipulated)) Equal to Ward Boots
          • (Item-type of (Item being manipulated)) Equal to Power Treads
          • (Item-type of (Item being manipulated)) Equal to Power Treads
          • (Item-type of (Item being manipulated)) Equal to Power Treads
          • (Item-type of (Item being manipulated)) Equal to Dash Boots
          • (Item-type of (Item being manipulated)) Equal to Boots of Travel
          • (Item-type of (Item being manipulated)) Equal to Boots of Stamina
          • (Item-type of (Item being manipulated)) Equal to Arcane Boots
      • Or - Any (Conditions) are true
        • Conditions
          • ((Triggering unit) has an item of type Boots of Fortification) Equal to True
          • ((Triggering unit) has an item of type Boots of Resistance) Equal to True
          • ((Triggering unit) has an item of type Ward Boots) Equal to True
          • ((Triggering unit) has an item of type Power Treads) Equal to True
          • ((Triggering unit) has an item of type Power Treads) Equal to True
          • ((Triggering unit) has an item of type Power Treads) Equal to True
          • ((Triggering unit) has an item of type Dash Boots) Equal to True
          • ((Triggering unit) has an item of type Boots of Travel) Equal to True
          • ((Triggering unit) has an item of type Boots of Stamina) Equal to True
          • ((Triggering unit) has an item of type Arcane Boots) Equal to True
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
        • Then - Actions
          • Hero - Drop (Item being manipulated) from (Triggering unit)
          • Game - Display to (All allies of (Owner of (Triggering unit))) for 5.00 seconds the text: |cffffcc00You are o...
        • Else - Actions
This thing is throwing my first boot)) how to make it hold the first item?)))
 
Level 28
Joined
Sep 26, 2009
Messages
2,520
Yes it will throw down your boots, because the trigger check if you have boots after you acquire said type of boots.
What you need is to check if you have more than 1 boots. If you have, you drop item being manipulated, else you leave it in inventory.

Also your conditions are bad. This trigger will currently fire as successful even if you have Arcane Boots and pick up Boots of Fortification (unless you want the player to be able to have only 1 boots, no matter the type, in which case your conditions are correct)

Edit: Also, why do you have if/then/else action without any specified conditions in it?
 
Level 28
Joined
Sep 26, 2009
Messages
2,520
I will presume you can have only 1 boots, no matter what type.
Well I have only 2 ideas how to solve this problem:
1st is using a method Maker posted in this thread.
However since you have 10 types of boots and you would need to check if any type is in any slot, it may be more efficient to use method 2.

2nd method is just using 2 triggers. The first trigger will set a boolean "Has_boots" to true when unit picks up boots of any type.
The next time unit picks up boots, it will check and see the boolean is true, then it drops "item being manipulated".
The 2nd trigger would be when you drop boots from your inventory and then it would set the boolean to false.
The cons are: I haven't test it myself (and I have a bad presumption that when hero drops the 2nd boots via trigger, it will also start the "hero drops boots" trigger and set the boolean to false) and you will need to make boolean array and set it for each player and each hero (if player has more than 1 hero).

---
If you could have only 1 type of boots (i.e. you could have boots of fortification and Power treads at the same time), the trigger would be a lot simpler.
 
Level 10
Joined
Mar 17, 2012
Messages
582
I will presume you can have only 1 boots, no matter what type.
Well I have only 2 ideas how to solve this problem:
1st is using a method Maker posted in this thread.
However since you have 10 types of boots and you would need to check if any type is in any slot, it may be more efficient to use method 2.

2nd method is just using 2 triggers. The first trigger will set a boolean "Has_boots" to true when unit picks up boots of any type.
The next time unit picks up boots, it will check and see the boolean is true, then it drops "item being manipulated".
The 2nd trigger would be when you drop boots from your inventory and then it would set the boolean to false.
The cons are: I haven't test it myself (and I have a bad presumption that when hero drops the 2nd boots via trigger, it will also start the "hero drops boots" trigger and set the boolean to false) and you will need to make boolean array and set it for each player and each hero (if player has more than 1 hero).

---
If you could have only 1 type of boots (i.e. you could have boots of fortification and Power treads at the same time), the trigger would be a lot simpler.

You undestood me right, any hero Can't wear 2 different types of boots. If he takes Boots of Fortification and then Arcane Boots - Arcane Boots will be dropped...

  • Boots Forbid
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Item-type of (Item being manipulated)) Equal to Boots of Fortification
          • (Item-type of (Item being manipulated)) Equal to Boots of Resistance
          • (Item-type of (Item being manipulated)) Equal to Ward Boots
          • (Item-type of (Item being manipulated)) Equal to Power Treads
          • (Item-type of (Item being manipulated)) Equal to Power Treads
          • (Item-type of (Item being manipulated)) Equal to Power Treads
          • (Item-type of (Item being manipulated)) Equal to Dash Boots
          • (Item-type of (Item being manipulated)) Equal to Boots of Travel
          • (Item-type of (Item being manipulated)) Equal to Boots of Stamina
          • (Item-type of (Item being manipulated)) Equal to Arcane Boots
    • Actions
      • Set Boots_Boolean = True
  • Boots Forbid action
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Item-type of (Item being manipulated)) Equal to Boots of Fortification
          • (Item-type of (Item being manipulated)) Equal to Boots of Resistance
          • (Item-type of (Item being manipulated)) Equal to Ward Boots
          • (Item-type of (Item being manipulated)) Equal to Power Treads
          • (Item-type of (Item being manipulated)) Equal to Power Treads
          • (Item-type of (Item being manipulated)) Equal to Power Treads
          • (Item-type of (Item being manipulated)) Equal to Dash Boots
          • (Item-type of (Item being manipulated)) Equal to Boots of Travel
          • (Item-type of (Item being manipulated)) Equal to Boots of Stamina
          • (Item-type of (Item being manipulated)) Equal to Arcane Boots
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Boots_Boolean Equal to True
        • Then - Actions
          • Hero - Drop (Item being manipulated) from (Triggering unit)
          • Game - Display to (All allies of (Owner of (Triggering unit))) for 5.00 seconds the text: |cffffcc00You are o...
          • Set Boots_Boolean = True
        • Else - Actions
  • Boots sell
    • Events
      • Unit - A unit Pawns an item (to shop)
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Item-type of (Sold Item)) Equal to Boots of Fortification
          • (Item-type of (Sold Item)) Equal to Boots of Resistance
          • (Item-type of (Sold Item)) Equal to Ward Boots
          • (Item-type of (Sold Item)) Equal to Power Treads
          • (Item-type of (Sold Item)) Equal to Power Treads
          • (Item-type of (Sold Item)) Equal to Power Treads
          • (Item-type of (Sold Item)) Equal to Dash Boots
          • (Item-type of (Sold Item)) Equal to Boots of Travel
          • (Item-type of (Sold Item)) Equal to Boots of Stamina
          • (Item-type of (Sold Item)) Equal to Arcane Boots
    • Actions
      • Set Boots_Boolean = False
  • Boots loose
    • Events
      • Unit - A unit Loses an item
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Item-type of (Item being manipulated)) Equal to Boots of Fortification
          • (Item-type of (Item being manipulated)) Equal to Boots of Resistance
          • (Item-type of (Item being manipulated)) Equal to Ward Boots
          • (Item-type of (Item being manipulated)) Equal to Power Treads
          • (Item-type of (Item being manipulated)) Equal to Power Treads
          • (Item-type of (Item being manipulated)) Equal to Power Treads
          • (Item-type of (Item being manipulated)) Equal to Dash Boots
          • (Item-type of (Item being manipulated)) Equal to Boots of Travel
          • (Item-type of (Item being manipulated)) Equal to Boots of Stamina
          • (Item-type of (Item being manipulated)) Equal to Arcane Boots
    • Actions
      • Set Boots_Boolean = False
Still the same... :ogre_rage:
 
Level 28
Joined
Sep 26, 2009
Messages
2,520
You don't need that many triggers. Two triggers are enough.

The following trigger is for when unit picks up boots
  • Boots forbid
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Item-type of (Item being manipulated)) Equal to Boots of Fortification
          • (Item-type of (Item being manipulated)) Equal to Boots of Resistance
          • (Item-type of (Item being manipulated)) Equal to Ward Boots
          • (Item-type of (Item being manipulated)) Equal to Power Treads
          • (Item-type of (Item being manipulated)) Equal to Power Treads
          • (Item-type of (Item being manipulated)) Equal to Power Treads
          • (Item-type of (Item being manipulated)) Equal to Dash Boots
          • (Item-type of (Item being manipulated)) Equal to Boots of Travel
          • (Item-type of (Item being manipulated)) Equal to Boots of Stamina
          • (Item-type of (Item being manipulated)) Equal to Arcane Boots
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Boots_Forbid[(Player number of (Owner of (Triggering unit)))] Equal to True
        • Then - Actions
          • Trigger - Turn off Boots Enable <gen>
          • Hero - Drop (Item being manipulated) from (Triggering unit)
          • Trigger - Turn on Boots Enable <gen>
          • Game - Display to (All players) for 2.00 seconds the text: Can only have one of those!
        • Else - Actions
          • Set Boots_Forbid[(Player number of (Owner of (Triggering unit)))] = True
The following trigger is when units looses boots
  • Boots Enable
    • Events
      • Unit - A unit Loses an item
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Item-type of (Item being manipulated)) Equal to Boots of Fortification
          • (Item-type of (Item being manipulated)) Equal to Boots of Resistance
          • (Item-type of (Item being manipulated)) Equal to Ward Boots
          • (Item-type of (Item being manipulated)) Equal to Power Treads
          • (Item-type of (Item being manipulated)) Equal to Power Treads
          • (Item-type of (Item being manipulated)) Equal to Power Treads
          • (Item-type of (Item being manipulated)) Equal to Dash Boots
          • (Item-type of (Item being manipulated)) Equal to Boots of Travel
          • (Item-type of (Item being manipulated)) Equal to Boots of Stamina
          • (Item-type of (Item being manipulated)) Equal to Arcane Boots
    • Actions
      • Set Boots_Forbid[(Player number of (Owner of (Triggering unit)))] = False
To explain
The "Boots_Forbid[(Player number of (Owner of (Triggering unit)))]" is a Boolean variable (with array checked and "size" set to maximum number of players).
If you have only 1 hero per player, using player's number as index is enough.

You don't need 2 triggers for when unit picks boots. You need only one which checks the boolean whenever unit picks up boots is enough.

You also don't need 2 triggers when unit looses boots, because when unit sells boots, it first looses them from inventory.
If you have both triggers and unit sold the item to vendor, both triggers would fire.
(use the unit pawns an item if you want the trigger to fire only when unit sells the item to shop and not fire when unit drops the item)

When the hero is forced to drop boots (because he already has one boots), the "Boots enable" trigger is momentarily switched off, so it wouldn't fire when hero through trigger 1 drops boots.
 
Level 37
Joined
Mar 6, 2006
Messages
9,243
  • Untitled Trigger 088
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Item-type of (Item being manipulated)) Equal to Claws of Attack +15
          • (Item-type of (Item being manipulated)) Equal to Crown of Kings +5
    • Actions
      • For each (Integer A) from 1 to 6, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Item-type of (Item carried by (Triggering unit) in slot (Integer A))) Equal to (Item-type of (Item being manipulated))
              • (Item carried by (Triggering unit) in slot (Integer A)) Not equal to (Item being manipulated)
            • Then - Actions
              • Hero - Drop (Item being manipulated) from (Triggering unit)
              • Skip remaining actions
            • Else - Actions

  • Untitled Trigger 088
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Item-type of (Item being manipulated)) Equal to Claws of Attack +15
          • (Item-type of (Item being manipulated)) Equal to Crown of Kings +5
    • Actions
      • Set u = (Triggering unit)
      • Set it = (Item being manipulated)
      • Set ityp = (Item-type of it)
      • For each (Integer A) from 1 to 6, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Item-type of (Item carried by u in slot (Integer A))) Equal to ityp
              • (Item carried by u in slot (Integer A)) Not equal to it
            • Then - Actions
              • Hero - Drop (Item being manipulated) from u
              • Skip remaining actions
            • Else - Actions
 
Last edited:
Level 28
Joined
Sep 26, 2009
Messages
2,520
But doesn't your trigger prevent only having the same item-type twice?

What he has is a category "Boots" under which 10 different pairs of boots (10 different items) belong.
When your hero carries one pair of boots (one item from that category), he wants to prevent your hero from carrying any other boots.
(something like in WoW you cannot equip 2 pairs of boots. You can have only 1 pair equipped at a time)
 
Level 10
Joined
Mar 17, 2012
Messages
582
  • Untitled Trigger 088
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Item-type of (Item being manipulated)) Equal to Claws of Attack +15
          • (Item-type of (Item being manipulated)) Equal to Crown of Kings +5
    • Actions
      • For each (Integer A) from 1 to 6, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Item-type of (Item carried by (Triggering unit) in slot (Integer A))) Equal to (Item-type of (Item being manipulated))
              • (Item carried by (Triggering unit) in slot (Integer A)) Not equal to (Item being manipulated)
            • Then - Actions
              • Hero - Drop (Item being manipulated) from (Triggering unit)
              • Skip remaining actions
            • Else - Actions

  • Untitled Trigger 088
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Item-type of (Item being manipulated)) Equal to Claws of Attack +15
          • (Item-type of (Item being manipulated)) Equal to Crown of Kings +5
    • Actions
      • Set u = (Triggering unit)
      • Set it = (Item being manipulated)
      • Set ityp = (Item-type of it)
      • For each (Integer A) from 1 to 6, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Item-type of (Item carried by u in slot (Integer A))) Equal to ityp
              • (Item carried by u in slot (Integer A)) Not equal to it
            • Then - Actions
              • Hero - Drop (Item being manipulated) from u
              • Skip remaining actions
            • Else - Actions

Looks very nice, but using your trigger hero can wear 2 different boots... woah))) I'm too slow)))
 
Level 9
Joined
Aug 7, 2009
Messages
380
^ Then it will counts the item you picked up as the item the hero is holding
AND, the trigger is wayyyy too manual set-up so,... it's making me headache when look at. Besides, it will make you takes more time on just adding/removing the items from the "IF list". But well, that's your style i have no other comments then.
How about searching for some systems out there, they could help
 
Level 28
Joined
Sep 26, 2009
Messages
2,520
Why not try to check if Hero manipulating item has an item equal to your item?
As I wrote - he has a category for certain items and what he wants is to prevent you to have 2 items of a category.
In this case the category is "boots" under which 10 different boots item belong. If you pick any boots, he wants to prevent you via triggers to have any other boots (it doesn't have to necessarily be the same item-type; it has to be the same item-category)
 
Level 10
Joined
Mar 17, 2012
Messages
582
As I wrote - he has a category for certain items and what he wants is to prevent you to have 2 items of a category.
In this case the category is "boots" under which 10 different boots item belong. If you pick any boots, he wants to prevent you via triggers to have any other boots (it doesn't have to necessarily be the same item-type; it has to be the same item-category)

Now I see the only way - to make 100 triggers with different relationships :vw_death:
 
Status
Not open for further replies.
Top