Limiting items

ZelNaga

New Member
Reaction score
5
Ok so on my map I have four 'special' items, special item A, B, C, and D. I want it so that a hero can only carry one of the four special items. There are multiple heroes on my map and I just can't figure out how to make the trigger work.
 

bOb666777

Stand against the ugly world domination face!
Reaction score
117
Fairly easy.
Trigger:
  • Limit Items
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Item-type of (Item being manipulated)) Equal to SpecialA
          • (Item-type of (Item being manipulated)) Equal to SpecialB
          • (Item-type of (Item being manipulated)) Equal to SpecialC
          • (Item-type of (Item being manipulated)) Equal to SpecialD
    • Actions
      • Hero - Drop (Item being manipulated) from (Triggering unit)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • And - All (Conditions) are true
            • Conditions
              • ((Triggering unit) has an item of type SpecialA) Equal to False
              • ((Triggering unit) has an item of type SpecialB) Equal to False
              • ((Triggering unit) has an item of type SpecialC) Equal to False
              • ((Triggering unit) has an item of type SpecialD) Equal to False
        • Then - Actions
          • Trigger - Turn off (This trigger)
          • Hero - Give (Item being manipulated) to (Triggering unit)
          • Trigger - Turn on (This trigger)
        • Else - Actions
 

Bird

Ultra Cool Member
Reaction score
29
You are going about it all wrong.

You are automatically dropping it - and then trying to give it back if they *don't* have too many special items? You should only be dropping it if they *do* have too many special items.

Here is what you will do. You will have a For Loop (1-6)

When the unit picks up a Special Item, you will Loop through Inventory slots 1-6 and check if it has any other Special Items, if it does, drop one of them.
 

bOb666777

Stand against the ugly world domination face!
Reaction score
117
Bird, that only adds more function calls, that's definately not what you want. You should always seek to use the least calls.
 

Bird

Ultra Cool Member
Reaction score
29
^^ What?? How does automatically dropping it, then trying to check if it ever needed to be dropped in the first place = less commands.
 

Bird

Ultra Cool Member
Reaction score
29
Wups sorry Bob, I thought you were the thread starter, and posting your trigger that wasn't working.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top