• 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.

Item of one Type in Inventory

Status
Not open for further replies.
Level 3
Joined
Feb 20, 2009
Messages
28
Please someone tell me a trigger which you can pick up one armor one sword one shield one jewlery one helm and one inventory slot for potions and other things...
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
Use item classes and variables for that...

  • Events
    • Unit - A unit Acquires an item
  • Conditions
  • Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • (Item-class of (Item being manipulated)) Equal to Permanent
      • Then - Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • Weapon[(Player number of (Owner of (Hero manipulating item)))] Equal to False
            • Game - Display to (All players matching ((Matching player) Equal to (Owner of (Hero manipulating item)))) for 8.00 seconds the text: You are already car...
          • Then - Actions
            • Set Weapon[(Player number of (Owner of (Hero manipulating item)))] = True
          • Else - Actions
            • Hero - Drop (Item being manipulated) from (Hero manipulating item)
      • Else - Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • (Item-class of (Item being manipulated)) Equal to Charged
      • Then - Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • Shield[(Player number of (Owner of (Hero manipulating item)))] Equal to False
          • Then - Actions
            • Set Shield[(Player number of (Owner of (Hero manipulating item)))] = True
          • Else - Actions
            • Hero - Drop (Item being manipulated) from (Hero manipulating item)
            • Game - Display to (All players matching ((Matching player) Equal to (Owner of (Hero manipulating item)))) for 8.00 seconds the text: You are already car...
      • Else - Actions
In this example:
All weapons are Permanent
All shields are Charged

Variables:
Weapon - boolean - Array = amount of players
Shield - boolean - Array = amount of players
 
Level 7
Joined
Oct 14, 2008
Messages
340
Limited technique.. I bet you could make a much better system that could allow like 20 item classes you can only carry one of.. using the game cache :p

But if you only have shields/weapons/armor etc then the built-in classes would do the trick.
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
Limited technique.. I bet you could make a much better system that could allow like 20 item classes you can only carry one of.. using the game cache :p

But if you only have shields/weapons/armor etc then the built-in classes would do the trick.
I know, but this is the easiest and he said he wanted 5 classes, so he still had 1 inventory space for pots/misc items, so this is the best solution for his problem ;)
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
Could you Please Write down the other Way too..?

Why?
There is no reason for that if you only have 6 inventory slots anyway, you've got 7 Item Classes, so you can only wear 1 item per class, that means you can carry 7 different items.
Since you only use 6 of those item classes, there is no need for more difficult triggers as far as I know, but if you've got a good reason, I'll make one...
 
Level 3
Joined
Feb 20, 2009
Messages
28
Why?
There is no reason for that if you only have 6 inventory slots anyway, you've got 7 Item Classes, so you can only wear 1 item per class, that means you can carry 7 different items.
Since you only use 6 of those item classes, there is no need for more difficult triggers as far as I know, but if you've got a good reason, I'll make one...
Yeah you are right...but while i was testing the trigger i found a bug...the trigger can not pick up 2 of the same kind...but if you drop the one you already have then you can not pick up again the same type....:/...i tried to fix it but i only manage to get it when you drop it you will be able to pick up again more than 1...:/
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
Yeah you are right...but while i was testing the trigger i found a bug...the trigger can not pick up 2 of the same kind...but if you drop the one you already have then you can not pick up again the same type....:/...i tried to fix it but i only manage to get it when you drop it you will be able to pick up again more than 1...:/
Yeah... I thought you could figure that out yourself :p


  • Events
    • Unit - A unit Loses an item
  • Conditions
  • Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • (Item-class of (Item being manipulated)) Equal to Permanent
      • Then - Actions
        • Set Weapon[(Player number of (Owner of (Hero manipulating item)))] = False
      • Else - Actions
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • (Item-class of (Item being manipulated)) Equal to Charged
    • Then - Actions
      • Set Shield[(Player number of (Owner of (Hero manipulating item)))] = False
    • Else - Actions


Edit: Maybe you should use Dumb's system... (this should work though)
 
Level 5
Joined
Jul 13, 2008
Messages
109
thanks very much :D

my game has 4 heroes and i already got my own trigger disabling each unit from getting the other classes items.. if you want to use this, you use the item level instead of class type, simply make all items you want one class unit (warrior for example) to level 1, and then level 2 (healer for example) and so on,, level 0 so all classes can equip that certain item :)
 
Level 7
Joined
Jan 13, 2008
Messages
201
thanks very much :D

my game has 4 heroes and i already got my own trigger disabling each unit from getting the other classes items.. if you want to use this, you use the item level instead of class type, simply make all items you want one class unit (warrior for example) to level 1, and then level 2 (healer for example) and so on,, level 0 so all classes can equip that certain item :)

Oh, wow, never thought of that... And here I was going about making a new trigger for every item haha thanks! :)
+ Rep
 
Level 5
Joined
Jul 13, 2008
Messages
109
Here's the trigger, it certainly makes hero class restrictions a whole lot easier...

  • Warrior restrictions1
    • Events
      • Unit - Warrior 0002 <gen> Acquires an item
    • Conditions
      • (Item level of (Item being manipulated)) Equal to 2
    • Actions
      • Hero - Drop (Item being manipulated) from Warrior 0002 <gen>
      • Game - Display to (All players) for 10.00 seconds the text: Sorry, you can't equ...
for more than 2 classes simply make a new trigger with everything the same, but change the level of the item in condition to 3, 4 and so on depending on how many heroes your game has :D
 
Level 7
Joined
Jan 13, 2008
Messages
201
Here's the trigger, it certainly makes hero class restrictions a whole lot easier...

  • Warrior restrictions1
    • Events
      • Unit - Warrior 0002 <gen> Acquires an item
    • Conditions
      • (Item level of (Item being manipulated)) Equal to 2
    • Actions
      • Hero - Drop (Item being manipulated) from Warrior 0002 <gen>
      • Game - Display to (All players) for 10.00 seconds the text: Sorry, you can't equ...
for more than 2 classes simply make a new trigger with everything the same, but change the level of the item in condition to 3, 4 and so on depending on how many heroes your game has :D

Yeah.. Wouldn't be easier
  • Events
    • Unit - A unit accuires and item
  • Conditions
    • And Multiple Conditions
    • -(Item level of (Item being manipulated)) Equal to 2
    • -Or Multiple Conditions
      • -Unit-type (triggering Unit) = Human Warrior equal to False
      • -Unit-type (triggering Unit) = ETC. Warrior equal to False
  • Actions
    • Drop item(item being manipulated) from unit(triggering Unit)
 
Level 3
Joined
Feb 20, 2009
Messages
28
Nice one but what about the helm thing i mean the class its okay a unit which is Rogue cant equip an item from Warrior but then a warrior can equip 2 of the same type (EX. 2 Helms...) and since i'm making a map with attachments.
 
Level 7
Joined
Jan 13, 2008
Messages
201
Nice one but what about the helm thing i mean the class its okay a unit which is Rogue cant equip an item from Warrior but then a warrior can equip 2 of the same type (EX. 2 Helms...) and since i'm making a map with attachments.

This is in addition to my weapon system. It'll work for attachments. That would be for plate armor. All plate = item level 1 or what ever
 
Level 3
Joined
Feb 20, 2009
Messages
28
Ohh now i Get it...is Nice...+rep..to Kratos and DumbDumb360...BTW Dumb i played your Map is nice..Good Luck..if you ever need help for more advanced Terrain tell me..
 
Level 5
Joined
Jul 13, 2008
Messages
109
I found a working trigger, don't give me credit for it. this one works wonders. however miscellaneous class type items don't seem to work, so you will have to make all potion like items miscellaneous type class....here's the problem solving trigger!!


  • One Weapon
    • 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 being manipulated)) Equal to (Item-class of (Item carried by (Hero manipulating item) in slot (Integer A)))
              • (Item being manipulated) Not equal to (Item carried by (Hero manipulating item) in slot (Integer A))
              • (Item-class of (Item being manipulated)) Equal to Permanent
            • Then - Actions
              • Quest - Display to (All players) the New Item Received message: You already have a ...
              • Hero - Drop (Item being manipulated) from (Hero manipulating item)
            • Else - Actions
Remember don't give me credit for it :)
 
Level 7
Joined
Jan 13, 2008
Messages
201
I found a working trigger, don't give me credit for it. this one works wonders. however miscellaneous class type items don't seem to work, so you will have to make all potion like items miscellaneous type class....here's the problem solving trigger!!


  • One Weapon
    • 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 being manipulated)) Equal to (Item-class of (Item carried by (Hero manipulating item) in slot (Integer A)))
              • (Item being manipulated) Not equal to (Item carried by (Hero manipulating item) in slot (Integer A))
              • (Item-class of (Item being manipulated)) Equal to Permanent
            • Then - Actions
              • Quest - Display to (All players) the New Item Received message: You already have a ...
              • Hero - Drop (Item being manipulated) from (Hero manipulating item)
            • Else - Actions
Remember don't give me credit for it :)

oh wow.... LMAO thats really simple!!!!!
 
Status
Not open for further replies.
Top