Item (Groups?) One of each.

lindenkron

You can change this now in User CP
Reaction score
102
I searched around alittle, but couldn't seem to find anything that fit what I was looking for (Or I just didn't know how to change it into what I need).

So before I go to sleep, I have alittle request for you guys :).

--> What I need is;
(Item)Heavy Armor +4
(Item)Leather Armor +2
(Item)Cloth Armor +1

When someone picks up one of those items, trigger check to see if there's any items in the heroes inventory matching that item(group?) of "armor". If there is, then drop item again.

I'm abit tired since its 2:30 here in Denmark, so if anyone could make it for when I wake up, I'd appreciate it :) [+REP] ofcause :)
 

darkbeer

Beer is Good!
Reaction score
84
guess you could take advantage of the item classification.

set all armor items to be for example of class artifact

then you simply check when the unit acquires an item of class artifact if the unit already has an item of class artifact and drop it. (or whatever)
 

WolfieeifloW

WEHZ Helper
Reaction score
372
You could do what darkbeer said, or via triggers:
At Map Initialization set items to a group in a variable.
If the unit has an item of that variable already, drop the item being picked up.
 

lindenkron

You can change this now in User CP
Reaction score
102
Could you show such variable? And how to put them in there effectively ? :)

EDIT:
Tried figuring it out myself, I cannot figure out how to put specific items in a specific variable and then checking to see if the item aquired is in same group as the items already in the inventory.

Could anyone draw triggers for this, so I can give out my rep? :)

Thanks
-Lindenkron
 

sheep

New Member
Reaction score
2
Sitting with the same problem, and I have included that it cannot be done. sry. :p

If he god a weapons, armor, helms, ring and so on, then he have to use all his item classification, and it will look very stupid ingame.

But i know that a lot of ppl solved that problem, so try searching around some more. look for inventory/equipment systems. good luck.
 

darkbeer

Beer is Good!
Reaction score
84
(almost) nothing is impossible ....

and your request is quite simple ...

Trigger:
  • Trigger
    • Events
      • Unit - A unit acquires an item
    • Conditions
      • (Item-class of (Item being manipulated)) Gleich Artefakt
    • 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))) Gleich Artefakt
              • (Item being manipulated) Ungleich (Item carried by (Triggering unit) in slot (Integer A))
            • 'THEN'-Actions
              • Hero - Drop (Item carried by (Triggering unit) in slot (Integer A)) from (Triggering unit)
            • 'ELSE'-Actions
 

lindenkron

You can change this now in User CP
Reaction score
102
(almost) nothing is impossible ....

and your request is quite simple ...

Trigger:
  • Trigger
    • Events
      • Unit - A unit acquires an item
    • Conditions
      • (Item-class of (Item being manipulated)) Gleich Artefakt
    • 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))) Gleich Artefakt
              • (Item being manipulated) Ungleich (Item carried by (Triggering unit) in slot (Integer A))
            • 'THEN'-Actions
              • Hero - Drop (Item carried by (Triggering unit) in slot (Integer A)) from (Triggering unit)
            • 'ELSE'-Actions

Whats with all the deutsh words? Making me so confused :(.

I dont see any "item groups" there? Like if you have helmets, it checks if there's any items in the inventory from that "item group" that the aquired item is in. So if you pick a helmet up, it check if theres any items in inventory from helmets.

-- Or am I missing something? :)
 

darkbeer

Beer is Good!
Reaction score
84
yea sorry for german editor version

this checks if an item is of class artifact and then if the hero has any other items of type artifact it drops them.

so if you make every helmet an artifact he can only carry one. there are 8 classifications i think should be enough.
 

Kelvin87

New Member
Reaction score
14
You can use set custom value to the items type as the same custom value in the same group. Do it at map initialization. Loads all the items into items array global variable. This will help you much more.
 

sheep

New Member
Reaction score
2
You can use set custom value to the items type as the same custom value in the same group. Do it at map initialization. Loads all the items into items array global variable. This will help you much more.

Are you sure that works? I tyed that ones, and It turned out as a fail.
The custom value changed itself ingame, or something.
If it can be done I would like to see it.
 

Flare

Stops copies me!
Reaction score
662
Custom value works with individual items, so if you have multiple drops of the same item type (say, Cloth Armor), then you would have to set it's custom value when it's dropped/bought/whatever.

It's a plausible method, but darkbeer's is simplest, and it's only weakness being the fact that it requires Item Classification, which may/may not be a problem based on the map it's required for
 

sheep

New Member
Reaction score
2
when i come to think of it, then acehart made a item system

http://www.thehelper.net/forums/showthread.php?t=57747
Trigger:
  • ThisItemOnlyOnce
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Item-type of (Item being manipulated)) Equal to Healing Salve
          • (Item-type of (Item being manipulated)) Equal to Rod of Necromancy
    • Actions
      • For each (Integer A) from 1 to 5, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Or - Any (Conditions) are true
                • Conditions
                  • (Item-type of (Item carried by (Hero manipulating item) in slot (Integer A))) Equal to Healing Salve
                  • (Item-type of (Item carried by (Hero manipulating item) in slot (Integer A))) Equal to Rod of Necromancy
            • Then - Actions
              • For each (Integer B) from ((Integer A) + 1) to 6, do (Actions)
                • Loop - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • Or - Any (Conditions) are true
                        • Conditions
                          • (Item-type of (Item carried by (Hero manipulating item) in slot (Integer B))) Equal to Healing Salve
                          • (Item-type of (Item carried by (Hero manipulating item) in slot (Integer B))) Equal to Rod of Necromancy
                    • Then - Actions
                      • Hero - Drop the item from slot (Integer B) of (Hero manipulating item)
                      • Quest - Display to (Player group((Owner of (Hero manipulating item)))) the Warning message: Sorry, this item only once
                    • Else - Actions
            • Else - Actions



In this example, your Hero can have one of Healing Salve or one of Rod of Necromancy,
but not two of the same type,
and not more than one of each.

It might be alot of work, but you avoide using the item classification.
 

lindenkron

You can change this now in User CP
Reaction score
102
yea sorry for german editor version

this checks if an item is of class artifact and then if the hero has any other items of type artifact it drops them.

so if you make every helmet an artifact he can only carry one. there are 8 classifications i think should be enough.

Thanks for looking into it for me, think ill go with the other method :) Still +rep.


EDIT: Sorry about dobble posting -->

I took a closer look at it, and the trigger arent build up as I would like it, If anyone could link me one where there's "Item groups". So you can just Set a variable (Add an item there) to a group and then work with that group. Really what I'm looking for :)


-->>> MOVED -->>>
http://www.thehelper.net/forums/showthread.php?p=935500#post935500
 

lindenkron

You can change this now in User CP
Reaction score
102
Modify this system for me please!

Trigger:
  • acquire the same item
    • 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-type of (Item carried by (Triggering unit) in slot (Integer A))) Equal to (Item-type of (Item being manipulated))
              • (Item carried by (Triggering unit) in slot (Integer A)) Not equal to (Item being manipulated)
            • Then - Actions
              • Hero - Drop (Item being manipulated) from (Triggering unit)
            • Else - Actions


Trigger:
  • order to pick up the same item
    • Events
      • Unit - A unit Is issued an order targeting an object
    • Conditions
      • (Issued order) Equal to (Order(smart))
      • (Target item of issued order) Not equal to No item
    • 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 (Triggering unit) in slot (Integer A))) Equal to (Item-type of (Target item of issued order))
              • (Item carried by (Triggering unit) in slot (Integer A)) Not equal to (Target item of issued order)
            • Then - Actions
              • Set TempPoint = (Position of (Target item of issued order))
              • Unit - Order (Triggering unit) to Move To TempPoint
              • Custom script: call RemoveLocation (udg_TempPoint)
            • Else - Actions


This system does: You can only pick up one of the same type of item.

I need it to work on groups, where I can set what items is in the groups. Meaning if a group have:
Orb of Frost
Orb of Fire
Orb of Nature

Only one is allowed! Anyone can do this? :) Will rep when possible.
AceHart(Notice I didn't type heart) You have messed around with this before, maybe you could help out?.

In advance
Thanks
-Lindenkron
 

sheep

New Member
Reaction score
2
I posted that already :p


ok, here is an idear:

Lets say that your map is a 10 player map, you have 10 different weapon/armor types.

Then make a boolean variable with an array on 110.
You also have to make an integer variable for every weapon you got.
Trigger:
  • Items init
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set sword_of_fire = 1
      • Set helm_of_rock = 2
      • Set Boots_of_the_wind = 3
      • Set Orb_of_Fire = 4
      • Set Orb_of_vemon = 4

1 = swords/weapons
2 = stuff that goes on your head
3 = boots
4 = orbs
and so on.

OBS you can max have 10 different item types.

Trigger:
  • Equiping items get
    • Events
      • Unit - A unit Acquires an item
    • Conditions
    • Actions
      • -------- Items --------
      • If ((Item-type of (Item being manipulated)) Equal to Orb of Fire) then do (Set i = Orb_of_fire) else do (Do nothing)
      • If ((Item-type of (Item being manipulated)) Equal to Orb of Venom) then do (Set i = Orb_of_venom) else do (Do nothing)
      • -------- Other stuff --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • equipment[(i + (10 x (Player number of (Triggering player))))] Equal to True
        • Then - Actions
          • Hero - Drop (Item being manipulated) from (Triggering unit)
        • Else - Actions
          • Set equipment[(i + (10 x (Player number of (Triggering player))))] = True

Trigger:
  • Equiping items drop
    • Events
      • Unit - A unit Loses an item
    • Conditions
    • Actions
      • -------- Items --------
      • If ((Item-type of (Item being manipulated)) Equal to Orb of Fire) then do (Set i = Cast_int) else do (Do nothing)
      • If ((Item-type of (Item being manipulated)) Equal to Orb of Venom) then do (Set i = Cast_int) else do (Do nothing)
      • -------- Other stuff --------
      • Set equipment[(i + (10 x (Player number of (Triggering player))))] = False


It is alot of work, but it is another way you can do it.
Ï know it can work, (dont know if this piece of code works becuse i dident test it) because I use it in my own inventory systen, well mine is mutch more complex.
good luck :D
 

lindenkron

You can change this now in User CP
Reaction score
102
I read this through, don't know if I'm just not smart enough, but I completely fail to see how this works out, and if I cant figure it out from reading I wont bother trying to make it. Because then I cant fix it when it Bugs... And it will bug, TRUST me, it always bugs for me :(

I would think making something check arrays in a variable (loop it or something) would be easy, and then just add the items to that variable ArmorGroup[1] = Cloth armor, ArmorGroup[2]= Leather armor, Then check the group of the item aquired and check if any of the items currently in inven is in the matching group?

How you put this into triggers .. Dont ask me haha :)
 

sheep

New Member
Reaction score
2
I read this through, don't know if I'm just not smart enough, but I completely fail to see how this works out, and if I cant figure it out from reading I wont bother trying to make it. Because then I cant fix it when it Bugs... And it will bug, TRUST me, it always bugs for me :(

I would think making something check arrays in a variable (loop it or something) would be easy, and then just add the items to that variable ArmorGroup[1] = Cloth armor, ArmorGroup[2]= Leather armor, Then check the group of the item aquired and check if any of the items currently in inven is in the matching group?

How you put this into triggers .. Dont ask me haha :)

If you want me to, then i can call you and explaion it, after all we are from the same country :D And the call should be on skyoe or msn. ;)

I dont know if there is any way to make sutch a check with trigger, it is pritty basic programming but just not that easy to do in trigger. :S
maybe someone who know jass can tell you how to make sutch a check.
 
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