• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Trigger] Easy Item Limitation

Status
Not open for further replies.
Level 7
Joined
Apr 13, 2008
Messages
183
I need an easy trigger that drops an acquired item if you Hero already has one it. I made a trigger, but it is not working and I don't know how to fix it!
  • Events
  • A unit Acquires in Item
  • Conditions
  • ((Hero manipulating item) has an item of type (Item-type of (Item being Manipulated))) Equal to True
  • Actions
  • Hero - Drop (Item Being Manipulated) from (Hero Manipulating Item)
+ rep for help
 
Level 5
Joined
May 3, 2009
Messages
129
  • pick up ammo
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Item-type of (Item being manipulated)) Equal to Ammo upgrade +15
          • (Item-type of (Item being manipulated)) Equal to Ammo upgrade +30
          • (Item-type of (Item being manipulated)) Equal to Ammo upgrade +45
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ammo[(Player number of (Owner of (Hero manipulating item)))] Equal to True
        • Then - Actions
          • Hero - Drop (Item being manipulated) from (Hero manipulating item)
          • Game - Display to (Player group((Owner of (Hero manipulating item)))) the text: You already have a ...
        • Else - Actions
          • Set ammo[(Player number of (Owner of (Hero manipulating item)))] = True
 
Level 15
Joined
Aug 11, 2009
Messages
1,606
Let me try a bit.I will edit this post later.
Ok,i think i found a way to do it.It should be something like this
  • LimitItems
    • Events
      • Unit - A unit Acquires an item
    • Conditions
    • Actions
      • Set ItemType = (Item-type of (Item carried by (Hero manipulating item) in slot 1))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Item-type of (Item being manipulated)) Equal to ItemType
        • Then - Actions
          • Hero - Drop the item from slot 1 of (Hero manipulating item)
        • Else - Actions
Did you understood my point?Can you make the rest of the trigger by yourself?Or do you want me to complete it and attach a demo map with it?
 
Level 15
Joined
Aug 11, 2009
Messages
1,606
  • Untitled Trigger 001
    • Events
      • Unit - A unit Acquires an item
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of items carried by (Hero manipulating item)) Not equal to 1
        • Then - Actions
          • Hero - Drop (Item being manipulated) from (Triggering unit)
        • Else - Actions

This is useless...

OK i guess you want something like this right?
  • LimitItems
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • ((Hero manipulating item) is A Hero) Equal to True
    • Actions
      • Set ItemType = (Item-type of (Item carried by (Hero manipulating item) in slot 1))
      • Set ItemType2 = (Item-type of (Item carried by (Hero manipulating item) in slot 2))
      • Set ItemType3 = (Item-type of (Item carried by (Hero manipulating item) in slot 3))
      • Set ItemType4 = (Item-type of (Item carried by (Hero manipulating item) in slot 4))
      • Set ItemType5 = (Item-type of (Item carried by (Hero manipulating item) in slot 5))
      • Set ItemType6 = (Item-type of (Item carried by (Hero manipulating item) in slot 6))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Hero manipulating item) has an item of type ItemType) Equal to True
        • Then - Actions
          • Hero - Drop the item from slot 1 of (Hero manipulating item)
          • Game - Display to (All players) the text: You can have each i...
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Hero manipulating item) has an item of type ItemType2) Equal to True
            • Then - Actions
              • Hero - Drop the item from slot 2 of (Hero manipulating item)
              • Game - Display to (All players) the text: You can have each i...
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Hero manipulating item) has an item of type ItemType3) Equal to True
                • Then - Actions
                  • Hero - Drop the item from slot 3 of (Hero manipulating item)
                  • Game - Display to (All players) the text: You can have each i...
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • ((Hero manipulating item) has an item of type ItemType4) Equal to True
                    • Then - Actions
                      • Hero - Drop the item from slot 4 of (Hero manipulating item)
                      • Game - Display to (All players) the text: You can have each i...
                    • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • ((Hero manipulating item) has an item of type ItemType5) Equal to True
                        • Then - Actions
                          • Hero - Drop the item from slot 5 of (Hero manipulating item)
                          • Game - Display to (All players) the text: You can have each i...
                        • Else - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • ((Hero manipulating item) has an item of type ItemType6) Equal to True
                            • Then - Actions
                              • Hero - Drop the item from slot 6 of (Hero manipulating item)
                              • Game - Display to (All players) the text: You can have each i...
                            • Else - Actions
 
Last edited:
Level 15
Joined
Aug 11, 2009
Messages
1,606
yes exactly^^.I will try fix them.Although i need some time :p
I will post an updated map later,i hope you don't mind waiting.

EDIT:Hmm...I think i have understood the problem...but i don't see a way to fix it.Each time you pick an item the integer goes up up up like 2,3,4,5,6 ...and then if you drop an item it stays like this.Then each time you try to pick an item the integer is for example 8 and due to conditions you can't pick the item again.A possible way to fix this would be to set it to 0 or -1 again,but it seems i'm out of ideas.Any suggestions?

EDIT2:Nevermind,i found a way to do it.Working on it...

EDIT3:Ok i think i fixed the bug you mentioned.Anything else?
All these integers cause me a headache,so i gonna work on it again later.
 
Last edited:
Level 7
Joined
Apr 13, 2008
Messages
183
Hmm.. I don't get your point at all! Every item should be level 1 and an Artifact ? Or every item should be different ? I don't get it :eekani: :confused: . Should I just send you my little RPG for you to put the system in ?
 
This is useless...

OK i guess you want something like this right?
  • LimitItems
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • ((Hero manipulating item) is A Hero) Equal to True
    • Actions
      • Set ItemType = (Item-type of (Item carried by (Hero manipulating item) in slot 1))
      • Set ItemType2 = (Item-type of (Item carried by (Hero manipulating item) in slot 2))
      • Set ItemType3 = (Item-type of (Item carried by (Hero manipulating item) in slot 3))
      • Set ItemType4 = (Item-type of (Item carried by (Hero manipulating item) in slot 4))
      • Set ItemType5 = (Item-type of (Item carried by (Hero manipulating item) in slot 5))
      • Set ItemType6 = (Item-type of (Item carried by (Hero manipulating item) in slot 6))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Hero manipulating item) has an item of type ItemType) Equal to True
        • Then - Actions
          • Hero - Drop the item from slot 1 of (Hero manipulating item)
          • Game - Display to (All players) the text: You can have each i...
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Hero manipulating item) has an item of type ItemType2) Equal to True
            • Then - Actions
              • Hero - Drop the item from slot 2 of (Hero manipulating item)
              • Game - Display to (All players) the text: You can have each i...
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Hero manipulating item) has an item of type ItemType3) Equal to True
                • Then - Actions
                  • Hero - Drop the item from slot 3 of (Hero manipulating item)
                  • Game - Display to (All players) the text: You can have each i...
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • ((Hero manipulating item) has an item of type ItemType4) Equal to True
                    • Then - Actions
                      • Hero - Drop the item from slot 4 of (Hero manipulating item)
                      • Game - Display to (All players) the text: You can have each i...
                    • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • ((Hero manipulating item) has an item of type ItemType5) Equal to True
                        • Then - Actions
                          • Hero - Drop the item from slot 5 of (Hero manipulating item)
                          • Game - Display to (All players) the text: You can have each i...
                        • Else - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • ((Hero manipulating item) has an item of type ItemType6) Equal to True
                            • Then - Actions
                              • Hero - Drop the item from slot 6 of (Hero manipulating item)
                              • Game - Display to (All players) the text: You can have each i...
                            • Else - Actions

doesn't this always return true?? I think its better to use ItemType of Item being manipulated is equal to ItemType...
 
Status
Not open for further replies.
Top