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.
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.
  • The Helper The Helper:
    Power back on finally - all is good here no damage
    +2
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • The Helper The Helper:
    New recipe is another summer dessert Berry and Peach Cheesecake - https://www.thehelper.net/threads/recipe-berry-and-peach-cheesecake.194169/

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top