☐⇄☐ Item Storage (Alpha Released!)

Poll

What feature are you looking forward to the most in v5?

Ecumbrance System
4 (3.3%)
Item Stacking System
8 (6.7%)
Events (?)
11 (9.2%)
Item Durability / Degradation Over Time
3 (2.5%)
Crafting & Item Forming
25 (20.8%)
Smelting with the Furnace & Crucible
0 (0%)
Vehicle Storage
13 (10.8%)
Display Bricks
2 (1.7%)
Storage Locking & Lock-Picking
7 (5.8%)
Backpacks & Containers
16 (13.3%)
Hybrid Item / Brick Planting
0 (0%)
Shops & Integrated Loot System (?)
5 (4.2%)
Item Modding & Repair (with the Anvil)
3 (2.5%)
Hunger, Thirst & Armor Support
23 (19.2%)

Total Members Voted: 115

Author Topic: ☐⇄☐ Item Storage (Alpha Released!)  (Read 120074 times)

So that's why it wouldn't work when I tried to save items! Thanks!
No problem.

I know that you have a lot coming at you in this thread, but I'd like to throw out a mod idea that would work pretty well with this.
Yeah I saw that earlier. It shouldn't be too difficult to make a mod like that; it would basically involve spawning static versions of items, manipulating their position on a certain axis, and using relays or zones. I wouldn't have time to work on that right now though, sorry.



Update: Someone sent me a message asking for help on setting up a GUI-based store that can handle multiple items with various prices. Just encase anyone else needed help with this, I decided to post an example here (attached as a .bls save - which I verified to work - with a screenshot of the events also attached).

If you download the save, first make sure you enable version 3 of System_ItemStorage and Event_Variables. Then, once the save is loaded: disable events 27-29; save a bow, spear and sword to the brick's inventory; then, re-enable events 27-29 and try it out! If you are referencing the screenshot: the red boxes show the repeating patterns when looping through various checks, and the blue box highlights the section that prevents adding items to the store. Hope this helps!

Notes:
-It automatically prevents items from being added to the store (if an item is added - by itself or swapped - it'll return the item(s) and cancel the rest of the events from firing - due to the 55 millisecond delay on line 1 and the cancel events output on line 29).
-Every time an item is removed from the store, it checks if that item is a bow, spear or sword. Depending on the item removed, it'll then make sure the player has sufficient funds to purchase that item, then deduct the necessary amount from that player's money var.
-I forgot to add events to reset everything if an item is purchased, but you can easily do this for your own store by copying the events on lines 25 and 26, but using onVariableTrue instead.
« Last Edit: November 21, 2013, 06:56:11 PM by [GSF]Ghost »

Thanks been wondering how to do it muchas gracias.

If you want to exempt workers.

0. OnISRemoveItem condition stuff.
1. OnITConditionTrue >> Self >> VCEifValue >> "<var:cl:IsEmployee>"* == "0" "2 2"
2. OnVariableTrue money checks.

I'm having an issue. I didn't read the entire topic so I don't know if it's already been answered, but I can't make more than 1 storage brick and backpacks won't work.

If I try to make more than 1 storage brick I get this error

and I also can't use the backpack at all, it spawns, I can pick it up, but when I try to use it it gives me the error that backpacks are disabled, which they aren't.

My settings (note: this is after I deleted a save)


and another issue is I can't even create a new save with a letter that I have already used, regardless of whether there's actually a save in use starting with that letter.


any help would be appreciated

Are you using a dedicated server?  I am and am having the same problem.

Are you using a dedicated server?  I am and am having the same problem.
Yes. I am using an rtb dedicated server.

Yes. I am using an rtb dedicated server.
I have exactly the same problem.  These need to be RTB prefs.

Please add an input event that checks if a player has opened or closed the storage brick.

Please add an input event that checks if a player has opened or closed the storage brick.
That was there in V2.  Is it gone now?

Please add an input event that checks if a player has opened or closed the storage brick.
There should already be one included; try using the onISGUIOpened input event.

I'm having an issue. I didn't read the entire topic so I don't know if it's already been answered, but I can't make more than 1 storage brick and backpacks won't work.

. . .
Are you using a dedicated server?  I am and am having the same problem.
It turns out that the add-on doesn't support dedicated servers after all... I need to continue work on my own game for awhile, but I'll try to fix this issue soon. I'm thinking that when a dedicated server is created, it'll load the client GUI settings from the data saved in the client configuration folder (which will also support loading it from the RTB server (?)). This way, all you need to do is setup your GUI settings, then launch the dedicated server afterward and it'll reference your last saved settings. I can look into using RTB prefs, but I'd prefer to set it up so that you can join the dedicated server, change the GUI settings, and the server will reference the changes.

I'll also include more events and a new Item Cost/Value GUI for VCE variables to make event-stores much easier. This way version 4 will be more of an update rather than just a bug-fix.

That sounds marvelous.  It would also be neat if you could check specific cells for specific items, or if there are any items at all.

That sounds marvelous.  It would also be neat if you could check specific cells for specific items, or if there are any items at all.
Here is my progress so far (pic below); I'll also be experimenting with item stacking, just to get an idea of how complex it'll be to implement.


Also, there should already be a way to check if an inventory is empty, if there is at least one item in it or if an inventory is full using the ISifItemPresent output event. However, I'll consider adding an event to check specific cells; what could you use it for though?

That's awesome.

Just to clarify, this is what I meant by detecting an item.

For instance, you have a 4x4 grid for storage.  The first number is the first parameter, the slot number, numbered from left to right in rows downward, and the second is the item by drop down menu, denoted by a 0 for no item, or a letter for an item.

[1, 0][2, 0][3, 0][4, 0]
[5, 0][6, A][7, B][8, 0]
[9, 0][10, C][11, 0][12, 0]
[13, 0][14, 0][15, 0][16, 0]

What I was thinking was detecting the item slot, the item, and then telling the event lines it affects.

0.  Input >> Self >> ISifItemInSlot *param1* *param2* *param3*
1.  OnISConditionTrue >> …
2.  OnISConditionFalse >> …

*param1*  -  The slot number.  0-16 for detecting a specific slot, and -1 for detecting if it's in any slot.

*param2*  -  The Item.  Provides the standard item drop down menu.

*param3*  -  The lines which are affected by the event, controlled by range.  This is present in VCE.  So for instance, if I wanted to affect lines 1 and 2, I would say "1 2", or for 5, 6, 7, 8, 9, I would use "5 9".

Edit:  or ISonConditionTrue/False

Edit2:  How is the price handled?  Score?  VCE?
« Last Edit: November 28, 2013, 02:07:14 AM by SWAT One »

It turns out that the add-on doesn't support dedicated servers after all... I need to continue work on my own game for awhile, but I'll try to fix this issue soon.
Thank you, I was wondering if I was doing something wrong.

Thank you, I was wondering if I was doing something wrong.
Sure; I have a good idea already on how to fix it, so it shouldn't be overly difficult.

That's awesome.

Just to clarify, this is what I meant by detecting an item.

For instance, you have a 4x4 grid for storage.  The first number is the first parameter, the slot number, numbered from left to right in rows downward, and the second is the item by drop down menu, denoted by a 0 for no item, or a letter for an item.

[1, 0][2, 0][3, 0][4, 0]
[5, 0][6, A][7, B][8, 0]
[9, 0][10, C][11, 0][12, 0]
[13, 0][14, 0][15, 0][16, 0]

What I was thinking was detecting the item slot, the item, and then telling the event lines it affects.

0.  Input >> Self >> ISifItemInSlot *param1* *param2* *param3*
1.  OnISConditionTrue >> …
2.  OnISConditionFalse >> …

*param1*  -  The slot number.  0-16 for detecting a specific slot, and -1 for detecting if it's in any slot.

*param2*  -  The Item.  Provides the standard item drop down menu.

*param3*  -  The lines which are affected by the event, controlled by range.  This is present in VCE.  So for instance, if I wanted to affect lines 1 and 2, I would say "1 2", or for 5, 6, 7, 8, 9, I would use "5 9".

Edit:  or ISonConditionTrue/False

Edit2:  How is the price handled?  Score?  VCE?
I meant how could you use it though, sorry. I think I may have considered adding an event like this in the past, but decided not to because I wasn't sure it would be useful.

The buy/sell values will be accessed via an ISVCEBuyItem and ISVCESellItem events. The buy item event will automatically check if you have enough money to buy the item (based on the value in the GUI), then execute the input event onISBuySuccess or onISBuyFailure depending (it will also automatically handle subtracting the buy value from the VCE money var; I might also add a text box in the GUI so you can define the custom VCE money var, as well as change the VCE vars itemA and itemB to be relative to which is bought/sold rather than which is selected first/second). The buy/sell values can also be accessed through VCE vars, so that you can message the player with the item bought/sold along with the how much it was bought/sold for.

In short, what took 30 events in the past just to sell 3 items will now take much less to handle any item; example:
onActivate -> Self -> ISStoreItems -> Large
onISGUIAddItem -> Self -> ISVCEBuyItem
onISGUIRemoveItem -> Self -> ISVCESellItem
onISVCEBuySuccess -> Client -> MessageBoxOk -> "You bought a <var:cl:itemA> for <var:cl:buyAm>"
onISVCEBuyFailure -> Client -> MessageBoxOk -> "You need <var:cl:buyAm> to buy the <var:cl:itemA>"
« Last Edit: November 30, 2013, 01:00:56 PM by [GSF]Ghost »