• 🏆 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] Anti Item Stack?

Status
Not open for further replies.
Level 12
Joined
May 4, 2008
Messages
1,111
i need an anti itemstacking trigger... but the one i use will destroy the item he picks up... and if i make that he drops it then it scans inventory then Warcraft just crash...
  • antiduplicate
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • (Item-class of (Item being manipulated)) Equal to Artifact
    • 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 (Hero manipulating item) in slot (Integer A))) Equal to (Item-type of (Item being manipulated))
            • Then - Actions
              • Item - Remove (Item being manipulated)
            • Else - Actions
              • Hero - Give (Item being manipulated) to (Hero manipulating item)
 
Level 11
Joined
Oct 13, 2005
Messages
233
i need an anti itemstacking trigger... but the one i use will destroy the item he picks up... and if i make that he drops it then it scans inventory then Warcraft just crash...

Could you explain your situation a bit more clearly. Right now I'm having some difficulty understanding your question. I'd be glad to help solve your problem, but I'm unsure entirely what you're asking.
 
Level 12
Joined
May 4, 2008
Messages
1,111
i need to know if there is a way to not have 2X the same item of a certain class using triggers since when i use the trigger i posted Deleted the item without even it having a suplicate in the inventory
 
Level 5
Joined
Jan 15, 2007
Messages
199
Lawl.. with yours, when you drop it, it starts an infinite loop

i need an anti itemstacking trigger... but the one i use will destroy the item he picks up... and if i make that he drops it then it scans inventory then Warcraft just crash...
  • antiduplicate
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • (Item-class of (Item being manipulated)) Equal to Artifact
    • 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 (Hero manipulating item) in slot (Integer A))) Equal to (Item-type of (Item being manipulated))
            • Then - Actions
              • Item - Remove (Item being manipulated)
            • Else - Actions
              • Hero - Give (Item being manipulated) to (Hero manipulating item)

Try this:

  • Drop Doubles
    • Events
      • Unit - A unit Acquires an item
    • Conditions
    • 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-class of (Item carried by (Triggering unit) in slot (Integer A))) Equal to (Item-class of (Item being manipulated))
            • Then - Actions
              • Set bln = True
            • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • bln Equal to True
        • Then - Actions
          • Hero - Drop (Item being manipulated) from (Triggering unit)
          • Set bln = False
        • Else - Actions
 
Level 12
Joined
May 4, 2008
Messages
1,111
the ONLY problem with that trigger is
it scans the inventory AFTER the picked item is in it... so... in other words. it sees the ''item being manipulated'' and drops it... ill try something...

EDIT: it worked i added at the loop action thingy in condition. Item being carried by hero in slot Integer A is not equal to item being manipulated... ARG i only needed that one string for it to work
 
Level 2
Joined
May 24, 2008
Messages
21
Another way of doing this would be to move the new item to a specific slot, then scan the other 5 slots and if you find a duplicate, drop the new one.
 
Level 2
Joined
May 24, 2008
Messages
21
What do you mean it works bad? I currently use this sort of system in my map to only allow characters to carry one "weapon" and I accomplish it with a pretty simple single trigger using the above method.
 
Level 12
Joined
May 4, 2008
Messages
1,111
cuz if u say to put in lets say inventory slot 6 and the guy who owns the unit has one in that slot? i think its easyer to say to it ''condition : Item in slot integer A is not equal to Item being manipulated
 
Status
Not open for further replies.
Top