System Basic 12 Slots Inventory System

Leazy

You can change this now in User CP.
Reaction score
50
Hello!

Here is my 12 slots inventory system. It's very basic (even though, I added a lot of comments to help you if your completely new to the editor), use a skill, then all items you wear is stored into a variable, new items (if you carry any at this item page) is created and given to you. This system is MPI.

Triggers:
Code:
Inventory System
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        Or - Any (Conditions) are true
            Conditions
                (Ability being cast) Equal to Inventory Page: 1 
                (Ability being cast) Equal to Inventory Page: 2 
    Actions
        Trigger - Turn off Item Stacking System <gen>
        -------- Above: Only add this line to your trigger if your using a item stacking system. --------
        -------- -------------------- Use Bag One Skill -------------------- --------
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Ability being cast) Equal to Inventory Page: 1 
            Then - Actions
                Unit - Remove Inventory Page: 1  from (Triggering unit)
                Unit - Add Inventory Page: 2  to (Triggering unit)
                For each (Integer A) from 1 to 6, do (Actions)
                    Loop - Actions
                        Set InventorySystem_Integer = ((Integer A) + ((Player number of (Owner of (Triggering unit))) x 20))
                        -------- In the line above we set the number of the inventory slot which we will be working with. --------
                        Set InventorySystem_BagTwoItems[InventorySystem_Integer] = (Item-type of (Item carried by (Triggering unit) in slot (Integer A)))
                        -------- In the line above we store the item carried in slot integer A, so we can create it later when using bag page two. I set the variable to integer A + Player number x 20 so it won't get bugged when playing with more than one player. --------
                        Set InventorySystem_BagOneCharges[InventorySystem_Integer] = (Charges remaining in (Item carried by (Triggering unit) in slot (Integer A)))
                        -------- In the line above we store the charges remaining of the item, so it won't be everlasting if you keep changing back and forward between the inventories. --------
                        Set InventorySystem_BagOneCustomVa[InventorySystem_Integer] = (Custom value of (Item carried by (Triggering unit) in slot (Integer A)))
                        -------- In the line above we store the custom value of the item, since some maps set custom values of items to work with their triggers. --------
                        Item - Remove (Item carried by (Triggering unit) in slot (Integer A))
                        -------- In the line above we remove the item in slot integer A. --------
                        Hero - Create InventorySystem_BagOneItems[InventorySystem_Integer] and give it to (Triggering unit)
                        -------- In the line above we create the items that we stored when switching from page one to page two. --------
                        Item - Set charges remaining in (Last created item) to InventorySystem_BagTwoCharges[InventorySystem_Integer]
                        -------- In the line above we set the charges remaining of the new item to the amount we stored before switching inventory. --------
                        Item - Set the custom value of (Last created item) to InventorySystem_BagTwoCustomVa[InventorySystem_Integer]
                        -------- In the line above we set the custom value of the item to the value we stored before switching inventory. --------
            Else - Actions
        -------- -------------------- Use Bag Two Skill -------------------- --------
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Ability being cast) Equal to Inventory Page: 2 
            Then - Actions
                Unit - Remove Inventory Page: 2  from (Triggering unit)
                Unit - Add Inventory Page: 1  to (Triggering unit)
                For each (Integer A) from 1 to 6, do (Actions)
                    Loop - Actions
                        Set InventorySystem_Integer = ((Integer A) + ((Player number of (Owner of (Triggering unit))) x 20))
                        -------- In the line above we set the number of the inventory slot which we will be working with. --------
                        Set InventorySystem_BagOneItems[InventorySystem_Integer] = (Item-type of (Item carried by (Triggering unit) in slot (Integer A)))
                        -------- In the line above we store the item carried in slot integer A, so we can create it later when using bag page one. I set the variable to integer A + Player number x 20 so it won't get bugged when playing with more than one player. --------
                        Set InventorySystem_BagTwoCharges[InventorySystem_Integer] = (Charges remaining in (Item carried by (Triggering unit) in slot (Integer A)))
                        -------- In the line above we store the charges remaining of the item, so it won't be everlasting if you keep changing back and forward between the inventories. --------
                        Set InventorySystem_BagTwoCustomVa[InventorySystem_Integer] = (Custom value of (Item carried by (Triggering unit) in slot (Integer A)))
                        -------- In the line above we store the custom value of the item, since some maps set custom values of items to work with their triggers. --------
                        Item - Remove (Item carried by (Triggering unit) in slot (Integer A))
                        -------- In the line above we remove the item in slot integer A. --------
                        Hero - Create InventorySystem_BagTwoItems[InventorySystem_Integer] and give it to (Triggering unit)
                        -------- In the line above we create the items that we stored when switching from page two to page one. --------
                        Item - Set charges remaining in (Last created item) to InventorySystem_BagOneCharges[InventorySystem_Integer]
                        -------- In the line above we set the charges remaining of the new item to the amount we stored before switching inventory. --------
                        Item - Set the custom value of (Last created item) to InventorySystem_BagOneCustomVa[InventorySystem_Integer]
                        -------- In the line above we set the custom value of the item to the value we stored before switching inventory. --------
            Else - Actions
        Trigger - Turn on Item Stacking System <gen>
        -------- Above: Only add this line to your trigger if your using a item stacking system. --------

I hope this system has not been made like a million times :p Enjoy!



Changelog
#Made this system work proper with charged items.
#This system now stores custom values.
#Made the system more user-friendly
 

Attachments

  • 12 Slots Inventory System.w3x
    24.4 KB · Views: 326

gameman

It's been a long, long time.
Reaction score
96
What about aura items? are you going to allow the aura's to work when there in "bag 2"?
 

CysticCraze

New Member
Reaction score
12
Auras as in "+damage" Or auras as in "Increases attack speed of all units"? I mean i assume your reffering to the second. But in my opinion being able to carry a bag around and then in a sense equip your items is pretty kewl in itself, kinda liek you have 8 items pick which 5 to use, the other 3 are stored for future use. Ill try this later man seems kewl and simple.
 

gameman

It's been a long, long time.
Reaction score
96
It removes the items and stores them into a variable, and it removes the items effects.
 

Leazy

You can change this now in User CP.
Reaction score
50
Yeah, no items will work if you don't have them in the current bag. This is for example, if your making an RPG and your a tank. Then, you can have your tank equipment in bag one and damage dealing equipment in bag two. Even if the map is not an RPG, you could still use it for example keeping potions in one bag.
 

Romek

Super Moderator
Reaction score
964
I think this should be a snippet, not a system.
There have also been much better systems, similar to this made before. :p
 

Leazy

You can change this now in User CP.
Reaction score
50
I think this should be a snippet, not a system.
There have also been much better systems, similar to this made before. :p

Well, yeah maybe it should be a snippet, I was not certain so I made it a system. Well, of course there is better systems, but I doubt any of those are as simple as this is, even if you started with the editor yesterday you should be able to copy this one.
 

Romek

Super Moderator
Reaction score
964
Well, yeah maybe it should be a snippet, I was not certain so I made it a system. Well, of course there is better systems, but I doubt any of those are as simple as this is, even if you started with the editor yesterday you should be able to copy this one.
It's actually easier to copy JASS triggers into maps, than GUI triggers.
Just Copy and paste. (No need to open the map).
With GUI, you either spend ages trying to make it, or you have to open the map and CnP the triggers.
 

Leazy

You can change this now in User CP.
Reaction score
50
It's actually easier to copy JASS triggers into maps, than GUI triggers.
Just Copy and paste. (No need to open the map).
With GUI, you either spend ages trying to make it, or you have to open the map and CnP the triggers.

Of course it's easier, but what about if you want to change something? Then you have to ask in the JASS forums each time you want to change something. For example, maybe someone just want potions to be stored in one bag, then this system allows you to change that easy. Other systems might be better, but I don't understand what could be better in a system that is like this (allows you to change between two inventories). Could you link me some of those so I could look and learn?
 

darkRae

Ueki Fan (Ueki is watching you)
Reaction score
173
What if there are charges on the items?
Like, say, Wand of Illusions?

If you do it this way, you'll have infinite amount of them :eek:
 

Leazy

You can change this now in User CP.
Reaction score
50
What if there are charges on the items?
Like, say, Wand of Illusions?

If you do it this way, you'll have infinite amount of them :eek:

Great point!

I'll fix that right away, +rep for noticing this :)

Edit: I'll fix it later, gotta do some things now :)
 

Romek

Super Moderator
Reaction score
964
Of course it's easier, but what about if you want to change something? Then you have to ask in the JASS forums each time you want to change something. For example, maybe someone just want potions to be stored in one bag, then this system allows you to change that easy. Other systems might be better, but I don't understand what could be better in a system that is like this (allows you to change between two inventories). Could you link me some of those so I could look and learn?

Hardly.
There is no easy way of changing that in this snippet either. The user would probably have to write more lines than this entire code himself to do that.
And in Jass, there are configurables at the top of scripts. Unlike GUI.
 

Leazy

You can change this now in User CP.
Reaction score
50
Hardly.
There is no easy way of changing that in this snippet either. The user would probably have to write more lines than this entire code himself to do that.
And in Jass, there are configurables at the top of scripts. Unlike GUI.

Hardly what? Is it hardly possible to keep charges when switching inventory or hardly possible to change items between inventories in a good way?

#Updated!
Should now work with charges as well!
 

Samael88

Evil always finds a way
Reaction score
181
Why don't you just store the items in an array and at the same time you place them in a small unused region and then just switch them around like you do now?
That is much easier and you don't need to check for charges and stuff beacuse you will really be moving the "original" items:p
 

Leazy

You can change this now in User CP.
Reaction score
50
Why don't you just store the items in an array and at the same time you place them in a small unused region and then just switch them around like you do now?
That is much easier and you don't need to check for charges and stuff beacuse you will really be moving the "original" items:p

Hmm, may be but then people in for example maps with blink could get to them I think, that would need a lot more customizing by importing people. However, thanks for your tips and +rep! =)
 

WilliamPa

Active Member
Reaction score
51
Too bored to test the map atm, but should you try making it to a targetable unit or something like that rather than skill. If you are wearing damage gear in bag 1, and pots in bag2, boss or player enemy might stun you and deal huge amount of dps, and most likely you are dead when you are switching bags?

E2: Also silence affects the ability using.
E: Also make variable to store custom values? Some maps use item custom values as real important integers.
 

Leazy

You can change this now in User CP.
Reaction score
50
Too bored to test the map atm, but should you try making it to a targetable unit or something like that rather than skill. If you are wearing damage gear in bag 1, and pots in bag2, boss or player enemy might stun you and deal huge amount of dps, and most likely you are dead when you are switching bags?

E2: Also silence affects the ability using.
E: Also make variable to store custom values? Some maps use item custom values as real important integers.

I fixed so it stores custom values. Also made it work if your using an item stacking system. I will keep it as an ability, because else you could for example have one inventory with all +hp items and then just switch to it when your stunned or something. If it's really important you could customize it by yourself, it's very easy.

To come: 10 seconds cooldown so you can't for example just have one bag with all +int gear and then cast spells and then switch back.

P.S: +rep for comment :)
 

Andrewgosu

The Silent Pandaren Helper
Reaction score
716
You can optimise the system by setting all the "Integer A's" and "Triggering Unit's" etc. into variables.

The sumbission is graveyarded, though, because it's not very user friendly (like all GUI systems, spells etc) and there are better ones out there.
 

Leazy

You can change this now in User CP.
Reaction score
50
You can optimise the system by setting all the "Integer A's" and "Triggering Unit's" etc. into variables.

The sumbission is graveyarded, though, because it's not very user friendly (like all GUI systems, spells etc) and there are better ones out there.

What could I do to make it more user friendly then?
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Monovertex Monovertex:
    How are you all? :D
    +1
  • Ghan Ghan:
    Howdy
  • 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

      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