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

Setting Item Requirements and Slots

Status
Not open for further replies.
Level 6
Joined
Apr 1, 2009
Messages
201
I'm trying to develop an item requirement system and am having trouble getting started. I'm going to base the system off of item classification but that is only the start. I then need to set conditions that check if the hero has more than one item of that class. On top of that I need to figure out how to set certain item classes to certain item slots and when you pickup an item it goes to the slot it is assigned. Then I need to set conditions so you can't move the item to other slots. One of the item classifications (Permanent) is weapons and you are able to use two as long as they are one handed weapons. Finally I need one item to take up two slots known as a two handed weapon. I'm not sure how to set this part or even where to begin on this trigger. I know how to move an item to the slot when the hero picks it up and how to check what classification the item is. I would prefer it in GUI, but I can deal with Jass. I just need a starting trigger or some conditions then I can work from there. I've been searching through the forums but couldn't find any trigger similar of the system I'm looking to create.
 
Level 11
Joined
Nov 15, 2007
Messages
800
For the item slot thing, if you make all of your equipment items undroppable, the player won't be able to move them in the inventory. Of course then you'd need a separate system for dropping items via a dialogue menu or spellbook or chat command or whatever. I assume you're already using a triggered inventory for non-equipment items so that shouldn't be a problem.

The rest, I'm too tired to think about right now :)
 
Level 17
Joined
Jun 17, 2010
Messages
2,275
So i typed this all from my knowledge, i dont have any world editor program so i cant give you the exact, but this should give you the gist im sure you can understand it.

  • Init
  • Events
    • Map Initilization
  • Conditions
  • Actions
    • Set Armor[1] = Item
    • Set Armor[2] = Item
    • Set ....
    • Set Weapon[1] = Item
    • Set ...
    • ...
  • Item
  • Events
    • Unit - Picks up an item
  • Coniditions
  • Actions
    • For every ArmorGlobal from (1-(Number of items you stored)) do (Actions)
      • Loop Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (Item being Manipulated) = Armor[ArmorGlobal]
          • Then - Actions
            • Put the item in Item slot whatever
          • Else - Actions
            • For every WeaponGlobal from (1-(Number of items you stored)) do (Actions)
              • Loop Actions
                • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  • If - Conditions
                    • (Item being Manipulated) = Weapon[WeaponGlobal]
                  • Then - Actions
                    • Put the item in Item slot whatever
                  • Else - Actions
                    • Repeat...
 
Level 17
Joined
Nov 13, 2006
Messages
1,814
I'm trying to develop an item requirement system and am having trouble getting started. I'm going to base the system off of item classification but that is only the start. I then need to set conditions that check if the hero has more than one item of that class. On top of that I need to figure out how to set certain item classes to certain item slots and when you pickup an item it goes to the slot it is assigned. Then I need to set conditions so you can't move the item to other slots. One of the item classifications (Permanent) is weapons and you are able to use two as long as they are one handed weapons. Finally I need one item to take up two slots known as a two handed weapon. I'm not sure how to set this part or even where to begin on this trigger. I know how to move an item to the slot when the hero picks it up and how to check what classification the item is. I would prefer it in GUI, but I can deal with Jass. I just need a starting trigger or some conditions then I can work from there. I've been searching through the forums but couldn't find any trigger similar of the system I'm looking to create.

u can check my template.
the main ideea is every item is charged item class:
every equipable item get different item level in object editor(hold shift then click to level and u can type there higher number than 8), example:


heavy armor 1 is lv 100
heavy armor 2 is lv 101
heavy armor 3 is lv 102
..............................
Light armor 1 is lv 150
Light armor 2 is lv 151
Light armor 3 is lv 152
.......................
Sword 1 is lv 750
Sword 2 is lv 751
................
etc

at map init all store into integer array exclude Item_type (Item_type variable array is item type array)
Item_type[*item level*]=item
example:
Item_type[100]=heavy armor 1
and u do this for every item what kinda long but good at end because u can use this in more place
make item level requiment with integer varriable array:
Item_Lv[item level]=item level requiment
Item_Lv[100]=10
if u make this then u can make also stat requiment what depend on level i will give example.
---------------------
Bonus stats if u use multiboard inventory what anything where ur item is equipable then
Item_Bonus[item level]=number
example:
Item_HP=10
when u equip then check if u have equiped item already or no
if u have equiped item then currenthp=new item hp-old item hp
like: chp=Item_HP[newitemlevel]-Item_HP[olditemlevel]
and add same amount hp than chp is

Lets see in action
  • Map init
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set Item_Type[100] = Long Sword (19)
      • Set Item_Type[100] = Long Sword (29)
      • Set Item_Type[100] = Long Sword (39)
      • Set Item_Lv[100] = 10
      • Set Item_Lv[101] = 20
      • Set Item_Lv[102] = 30
  • Pick gear
    • Events
      • Unit - A unit Uses an item
    • Conditions
      • (Item level of (Item being manipulated)) Greater than or equal to 100
    • Actions
      • Set ManItem = (Item being manipulated)
      • Set Temp1 = (Item level of ManItem)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Item_Lv[Temp1] Less than or equal to (Hero level of (Triggering unit))
        • Then - Actions
          • -------- if weapon integer variable array is 0 then its mean u dont got equiped item --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Weapon[Temp1] Equal to 0
            • Then - Actions
              • -------- add bonus --------
              • Set Weapon[(Player number of (Triggering player))] = Temp1
            • Else - Actions
              • -------- add bonus but remove the previous item bonus --------
          • Game - Display to (All players) the text: (You picked a + (Name of ManItem))
        • Else - Actions
          • -------- You give item back to hero --------
          • Hero - Create Item_Type[Temp1] and give it to (Triggering unit)
or u can do this if u want do it with stat, in my trigger for that item what need level 10 hero also need 10*3 str and 10*2 agility for wear it, pretty similiar the class thing if u do like this (100-150 heavy armor then check if item level is between 100-150 then give item to hero else create a same item to hero)
  • Pick gear
    • Events
      • Unit - A unit Uses an item
    • Conditions
      • (Item level of (Item being manipulated)) Greater than or equal to 100
    • Actions
      • Set Temp1 = (Item level of (Item being manipulated))
      • Set ManItem = (Item being manipulated)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Item_Lv[Temp1] Less than or equal to (Hero level of (Triggering unit))
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Item_Lv[Temp1] x 3) Equal to (Strength of (Triggering unit) (Exclude bonuses))
              • (Item_Lv[Temp1] x 2) Equal to (Strength of (Triggering unit) (Exclude bonuses))
            • Then - Actions
              • -------- if weapon integer variable array is 0 then its mean u dont got equiped item --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Weapon[Temp1] Equal to 0
                • Then - Actions
                  • -------- add bonus --------
                  • Set Weapon[(Player number of (Triggering player))] = Temp1
                • Else - Actions
                  • -------- add bonus but remove the previous item bonus --------
              • Game - Display to (All players) the text: (You picked a + (Name of ManItem))
            • Else - Actions
              • -------- You give item back to hero --------
              • Hero - Create Item_Type[Temp1] and give it to (Triggering unit)
        • Else - Actions
          • -------- You give item back to hero --------
          • Hero - Create Item_Type[Temp1] and give it to (Triggering unit)
 
Level 6
Joined
Apr 1, 2009
Messages
201
@Meticulous
Ahhh I didn't think about making the item undroppable and I already have triggers to move items around, thank you

@InfinateAnswers
Thank you for taking the time to read this, but I already have the types of items like armor, one handed weapons, two handed weapons, etc. set to item classes. There are enough item classes to fill the amount of different types of item categories.

@shadowvzs
Thank you for reading this and posting your template. I already have an item level requirement system though and I'm not using bonus stats yet.

So far I have come up with nothing and am trying to figure out how to set one item to take up two slots, any ideas?
 
Level 7
Joined
Sep 9, 2007
Messages
253
Why not make a dummy item which takes up the extra slot. It could have a tool tip which says something like "This slot is taken up by the 2 handed weapon". You can simply make triggers to control when to give the dummy item to the hero.

  • Trigger 1
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Item-type of (Item being manipulated)) Equal to 2 handed weapon type 1
          • (Item-type of (Item being manipulated)) Equal to 2 handed weapon type 2
          • (Item-type of (Item being manipulated)) Equal to 2 handed weapon type 3
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of items carried by (Triggering unit)) Equal to 6
        • Then - Actions
          • Set TempPoint = (Position of (Triggering unit))
          • Unit - Order (Triggering unit) to drop (Item being manipulated) at TempPoint
          • Custom script: call RemoveLocation(udg_TempPoint)
          • Game - Display to (Player group((Owner of (Triggering unit)))) the text: A 2 handed weapon r...
        • Else - Actions
          • Hero - Create DUMMY ITEM and give it to (Triggering unit)

  • Trigger 2
    • Events
      • Unit - A unit Loses an item
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Item-type of (Item being manipulated)) Equal to 2 handed weapon type 1
          • (Item-type of (Item being manipulated)) Equal to 2 handed weapon type 2
          • (Item-type of (Item being manipulated)) Equal to 2 handed weapon type 3
          • (Item-type of (Item being manipulated)) Equal to DUMMY ITEM
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Item-type of (Item being manipulated)) Equal to DUMMY ITEM
        • Then - Actions
          • Set TempPoint = (Position of (Triggering unit))
          • Unit - Order (Triggering unit) to drop (THE 2 HANDED ITEM) at TempPoint
          • Custom script: call RemoveLocation(udg_TempPoint)
        • Else - Actions
          • Set TempPoint = (Position of (Triggering unit))
          • Unit - Order (Triggering unit) to drop (DUMMY ITEM) at TempPoint
          • Custom script: call RemoveLocation(udg_TempPoint)
In order for this to work You will also need to save the 2 handed item into a variable during the first trigger. This way you can easily specify the correct item when you want to force drop it in the second trigger.

Does this make sense? if not I can explain again but right now I have to go to bed :( Good Luck!
 
Last edited:
Level 17
Joined
Nov 13, 2006
Messages
1,814
Why not make a dummy item which takes up the extra slot. It could have a tool tip which says something like "This slot is taken up by the 2 handed weapon". You can simply make triggers to control when to give the dummy item to the hero.

  • Trigger 1
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Item-type of (Item being manipulated)) Equal to 2 handed weapon type 1
          • (Item-type of (Item being manipulated)) Equal to 2 handed weapon type 2
          • (Item-type of (Item being manipulated)) Equal to 2 handed weapon type 3
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of items carried by (Triggering unit)) Equal to 6
        • Then - Actions
          • Set TempPoint = (Position of (Triggering unit))
          • Unit - Order (Triggering unit) to drop (Item being manipulated) at TempPoint
          • Custom script: call RemoveLocation(udg_TempPoint)
          • Game - Display to (Player group((Owner of (Triggering unit)))) the text: A 2 handed weapon r...
        • Else - Actions
          • Hero - Create DUMMY ITEM and give it to (Triggering unit)

  • Trigger 2
    • Events
      • Unit - A unit Loses an item
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Item-type of (Item being manipulated)) Equal to 2 handed weapon type 1
          • (Item-type of (Item being manipulated)) Equal to 2 handed weapon type 2
          • (Item-type of (Item being manipulated)) Equal to 2 handed weapon type 3
          • (Item-type of (Item being manipulated)) Equal to DUMMY ITEM
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Item-type of (Item being manipulated)) Equal to DUMMY ITEM
        • Then - Actions
          • Set TempPoint = (Position of (Triggering unit))
          • Unit - Order (Triggering unit) to drop (THE 2 HANDED ITEM) at TempPoint
          • Custom script: call RemoveLocation(udg_TempPoint)
        • Else - Actions
          • Set TempPoint = (Position of (Triggering unit))
          • Unit - Order (Triggering unit) to drop (DUMMY ITEM) at TempPoint
          • Custom script: call RemoveLocation(udg_TempPoint)
In order for this to work You will also need to save the 2 handed item into a variable during the first trigger. This way you can easily specify the correct item when you want to force drop it in the second trigger.

Does this make sense? if not I can explain again but right now I have to go to bed :( Good Luck!

nice but what happen if u have more than 3 2handed weapon on ur map?
u make 100 condition? i use over 300+ custom item and far easier check the item level what is only 2 integer condition for weapons :p

also i use 1 handed weapon and u can use near that weapon a shield if u want or 2 handed weapon and idk but i think inventory equipments kinda bad coz 6 slot very very insufficient if u have helm/boot/armor/weapon/potions/quest item, ofc u can use a backup item but what u store there? equipments if u put there then item ability dont work on ur main hero, potion also kinda bad when u are in fight and must click to back up unit for heal...

i think simplear if weapon items level are lets say between 700-1000 and 700-800 the 1handed then u must check only if item level is between 800-1000 (=>2handed) or 700-800 (1 handed) and check ur current weapon item level what u could save into integer variable array and u dont need the item so u can have 6 slot for potion&quest item what still isnt too much but far more then 1-2 free slot for quest item/potion
 
Level 7
Joined
Sep 9, 2007
Messages
253
ELECTROLYTE Hasn't mentioned off hand items like shields but I'm sure that wouldn't be too hard to incorporate. You're right, checking item level or item class would be much smarter than checking each 2 handed item.
 
Level 17
Joined
Nov 13, 2006
Messages
1,814
ELECTROLYTE Hasn't mentioned off hand items like shields but I'm sure that wouldn't be too hard to incorporate. You're right, checking item level or item class would be much smarter than checking each 2 handed item.

item class useless coz dont have much choose :/ item level could be between 0-8190, and i doubt somebody can make more item on his map without going mad, so pretty sufficient to every item type :D
 
Level 6
Joined
Apr 1, 2009
Messages
201
@shadowvzs
Thanks for posting your system but I found a system that does what I need it to do minus a few things but I'm working on that right now.

@Greenwhy
The system I found makes it so you can only 1 two handed weapon or 2 one handed weapons or 1 one handed weapon plus a shield.

@InfinateAnswers
I might have to do that if this system doesn't work out with all the item slots and types I have.
 
Level 17
Joined
Jun 17, 2010
Messages
2,275
you can do a classification check, if its equal to the item in your inventory replace that item, and drop the item if its greater then level 0, level 0 would be the dummy item that takes the spot first, so it replaces the slot and never leaves it open, but you can still replace items.
 
Level 7
Joined
Sep 9, 2007
Messages
253
@Greenwhy
The system I found makes it so you can only 1 two handed weapon or 2 one handed weapons or 1 one handed weapon plus a shield.

You said: "So far I have come up with nothing and am trying to figure out how to set one item to take up two slots, any ideas?"

The triggers I posted should be able to fix this issue, if you also employ the change suggested by shadowvzs then I think it will be quite effective. I'm not seeing the problem, are the triggers I posted somehow incompatible with your system?
 
Status
Not open for further replies.
Top