IMP1

"haystack".scan(/needle/)
Veteran
Joined
Mar 6, 2014
Messages
66
Reaction score
45
First Language
English
Primarily Uses
RMVXA
Storage Boxes Addon: Item Thefts v1.2
by IMP1

Pastebin Link
This addon allows for items to be 'stolen' (removed from boxes). The probability varies on the item being stolen, the box being stolen from and the time taken since that box was last accessed.

EDIT: Update to add the functionality asked for here
 
Last edited by a moderator:

Dymdez

Newbie-in-Chief
Veteran
Joined
Feb 4, 2014
Messages
752
Reaction score
156
First Language
English
Primarily Uses
Storage Boxes Addon: Item Thefts v1.0
by IMP1

Pastebin Link

This addon allows for items to be 'stolen' (removed from boxes). The probability varies on the item being stolen, the box being stolen from and the time taken since that box was last accessed.

Awesome!! Also, the stealing only happens with boxes that have already been accessed by the player right? So, for example, boxes that exist much later in the game can't be stolen from before the player gets there?

Also your item theft script is titled "item sizes"

IMP1, did anything change in the way we add items through script? my game keeps crashing...debugging now...

Nvmd, was an error on my end. Still testing..

OK Fully tested....

IMP the script is so AWESOME!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

2 things.

1) When there are more than 5 of an item, could you implement a "take all" function?

2) the "close_sound: {}" still plays the applause sound effect rather than nothing. For example here is my box for one of the guard's bodies

    {

        name: "Guard Brance's Corpse", # ID = 10 [Guard Brance]

        size: 5,

        OPEN_SOUND: {},

        CLOSE_SOUND: {},

    },

when I close this box, the applause still plays
 
Last edited by a moderator:

IMP1

"haystack".scan(/needle/)
Veteran
Joined
Mar 6, 2014
Messages
66
Reaction score
45
First Language
English
Primarily Uses
RMVXA
Currently, any boxes can be stolen from. And ones that the player comes across later in the game will have had more time to be stolen from. Maybe I could have a command to set a box as unstealable (and stealable again)? Or you could only add items to those boxes late in the game as well.


1: Would you want a new button for this? Which one?


2: Will fix this tomorrow. Thanks :)
 

Dymdez

Newbie-in-Chief
Veteran
Joined
Feb 4, 2014
Messages
752
Reaction score
156
First Language
English
Primarily Uses
Well, it's just my feeling that boxes should not be stealable until the player has interacted with them and had the chance to get the items out of it first. The way it is coded now, there are some games, statistically speaking, that will have no items in them for a player to get from boxes, on the sheer probability of having them all stolen from.

1. That's a tough one, I was thinking about that. Maybe this would work. When you click an item that has more than 5 amount in a box, you get prompted

"Take One"

"Take All"

That way, if someone wants just one or two or three, etc, they can just keep spamming the button until they get the amount they want. And if someone wants all, they just need to press one additional button. No new buttons needed!

Also, can you edit the Item Size addon to make it so items designated as "<inv size: 0>" actually take up 1 space in the box? This is just a luxury, I was wondering, if its easy, like takes 5 seconds, let me know. I might try to edit it myself anyways.
 
Last edited by a moderator:

IMP1

"haystack".scan(/needle/)
Veteran
Joined
Mar 6, 2014
Messages
66
Reaction score
45
First Language
English
Primarily Uses
RMVXA
So I've added what you're asking for. There's an option to have boxes not stealable until they're first accessed by the player, or a script call.

Also, can you edit the Item Size addon to make it so items designated as "<inv size: 0>" actually take up 1 space in the box? This is just a luxury, I was wondering, if its easy, like takes 5 seconds, let me know. I might try to edit it myself anyways.
I'm not sure what you mean by this. I think I'm being dense, but could you explain?
I'll add the [Take All] option to the todo list!
 

Dymdez

Newbie-in-Chief
Veteran
Joined
Feb 4, 2014
Messages
752
Reaction score
156
First Language
English
Primarily Uses
So I've added what you're asking for. There's an option to have boxes not stealable until they're first accessed by the player, or a script call.

I'm not sure what you mean by this. I think I'm being dense, but could you explain?

I'll add the [Take All] option to the todo list!
Awesome, the Take All button is going to be awesome!

The luxury question I asked for is mostly for ABS's so just forget it no need to waste time for just me lol
 

GolfHacker

Veteran
Veteran
Joined
Feb 15, 2015
Messages
477
Reaction score
682
First Language
English
Primarily Uses
RMVXA
Hi, I've been looking for a good chest/storage system - Theo's is broken (doesn't save and restore properly), and Bravo2Kilo's doesn't have a way to view all items in one list. And neither author has responded to my requests for help.

I found your script today, and it looks like it could fit the bill. But I've got a question about it.

Looking at the script, it looks like each instance of a box is set up ahead of time inside the script itself. Or are those just templates in the BOXES array for different types of boxes? If the box instances are set up ahead of time in the script, then is that going to be a problem for a large game world? I'm creating a fairly large game world, and setting up 1000+ chests inside the script could be burdensome. I'm not even sure if RPG Maker will allow a script that long. I'd hate to get half my game world built, and run into some kind of limitation on the script length.

If script length could be a problem, could the box IDs be setup a different way? I kinda like how Theo's script automatically generates a unique box ID from the event id and map id where it is invoked. If your script were to do something similar, then script call to open the box could take the box name and the open/close sound names in the prepare() call. Alternatively, if I were to pass in box ID 4 (which exceeds the BOXES array), if it could add a box with ID=4 on-the-fly (using default settings), instead of not doing anything, then that would work for me too.
 

fizzly

Veteran
Veteran
Joined
Mar 23, 2012
Messages
1,186
Reaction score
809
First Language
Polish
Primarily Uses
RMMZ
Can you please add prefixes? Then you can for example store food items only in fridge-boxes.
 

IMP1

"haystack".scan(/needle/)
Veteran
Joined
Mar 6, 2014
Messages
66
Reaction score
45
First Language
English
Primarily Uses
RMVXA
@GolfHacker: Good ideas. I'll see what I can do with adding the option of setting up boxes in the script call.


@Fizzly: I'm not sure what you mean by 'prefixes', but I like the idea of limiting which items can go in which types of boxes. The way of doing this that immediately springs to mind is giving boxes a list of tags, and adding notes to the items to say which boxes they can be stored in (items with no such note will be storable in any). That sound okay?
 

fizzly

Veteran
Veteran
Joined
Mar 23, 2012
Messages
1,186
Reaction score
809
First Language
Polish
Primarily Uses
RMMZ
@Fizzly: I'm not sure what you mean by 'prefixes', but I like the idea of limiting which items can go in which types of boxes. The way of doing this that immediately springs to mind is giving boxes a list of tags, and adding notes to the items to say which boxes they can be stored in (items with no such note will be storable in any). That sound okay?
Yes, this is what I really want to see!!  :guffaw:  Thank you.
 
Last edited by a moderator:

Rikifive

Bringer of Happiness
Veteran
Joined
Jun 21, 2015
Messages
1,441
Reaction score
684
First Language
Polish
Primarily Uses
Other
THIS SCRIPT IS AWESOME!

Seriously, I tried many similar scripts and they kept throwing errors on my face.

Your script works FINE (at least for now =P ) and it's so simple, yet powerful.

Can I suggest something?

I would like to have "arrange" option. Because when I put items, weapons and some other stuff there is a mess in that box.

A simple option that works like "formation" (party) in menu. Choose one item, then replace it with second item would be great.

For example it could be like:

When in box - pressing "Z" simply takes items as it is now and pressing for example "A" or something would replace thingies.

Anyway, it's a really good script!
 
Last edited by a moderator:

IMP1

"haystack".scan(/needle/)
Veteran
Joined
Mar 6, 2014
Messages
66
Reaction score
45
First Language
English
Primarily Uses
RMVXA
Storage Boxes Addon: Item Types v1.0
by IMP1

Pastebin Link
This addon allows for boxes to take only certain types of items. Or for boxes to take all but certain types of items. No longer shall you put anything other than clothes in the wardrobe! No longer shall you put metal in the microwaves (super dangerous)!



I also updated the base code (which is needed now for any of the addons) and all of the add ons to be compatible with the new base code, so update whatever you're using from this thread.

@GolfHacker: The new base code update has the option of defining new boxes on the fly for people who don't want to set them all up beforehand. I wouldn't worry about the boxes taking up too much memory in your game though.

@Rikifive: Thanks a lot. Glad you're enjoying it. Organising boxes is a good idea. I'll add it to the list (which is now a lot shorter).
 
Last edited by a moderator:

Glorian

Villager
Member
Joined
Jun 9, 2015
Messages
15
Reaction score
0
Primarily Uses
Hello, i would like to know how can i manually remove items from the box?

For an example, a chest is broken, then once i call the same id, the items won't be there anymore.

Is there a script call for that?

Thanks.
 

Dymdez

Newbie-in-Chief
Veteran
Joined
Feb 4, 2014
Messages
752
Reaction score
156
First Language
English
Primarily Uses
It's not necessary, just change the script box that the event loads into a different one with a conditional branch or a switch.
 

Sixth

Veteran
Veteran
Joined
Jul 4, 2014
Messages
2,201
Reaction score
858
First Language
Hungarian
Primarily Uses
RMVXA
You can remove items with:

$game_boxes.remove_item(item, amount, box_id, false)Leave the last argument on 'false'.
The 'item' is $data_items[iD], $data_weapons[iD], etc. Just like in the add_item call.


The rest should be obvious.


But simply making a dummy storage for these cases and using that as an empty storage once the chest is broken is much more simple, as Dymdez already wrote.
 

Glorian

Villager
Member
Joined
Jun 9, 2015
Messages
15
Reaction score
0
Primarily Uses
You can remove items with:

$game_boxes.remove_item(item, amount, box_id, false)Leave the last argument on 'false'.The 'item' is $data_items[iD], $data_weapons[iD], etc. Just like in the add_item call.

The rest should be obvious.

But simply making a dummy storage for these cases and using that as an empty storage once the chest is broken is much more simple, as Dymdez already wrote.
I am sorry, i did not quite understand the suggestion.

I've created a buildable chest. Wherever the player wants, he can build it, it is a pre-made event, which will be transfered to the player's "Map X and Y". The player will be able to store whatever items he wishes, however, if he decides to destroy the box at some point, and the items are still there, all the items will be gone, how could i make it so, that once he builds the chest again calling the same ID, the once stored items will not be there? I do not want to make various ID's as this is not necessary. My idea at first was to add an script call (when the player choses to destroy the chest) for every and each item i have created in the database, so it will remove everything from the chest, or perharps only one script call to remove everything.

Thank you for your help!
 

Sixth

Veteran
Veteran
Joined
Jul 4, 2014
Messages
2,201
Reaction score
858
First Language
Hungarian
Primarily Uses
RMVXA
Here is a little snippet which will let you clear a box:

class IMP1_Game_Boxes def clear_box(id) return if @boxes[id].nil? @boxes[id] = {} box(id) end end
Whenever you want to clear a box, just use this script call:

$game_boxes.clear_box(ID)Replace the 'ID' with the ID of the box you want to clear.Note that I did not test this, but it should work.
 

shadow2k

Villager
Member
Joined
Oct 12, 2013
Messages
21
Reaction score
2
First Language
English
Primarily Uses
This script looks pretty useful, but is it possible to move the entire inventory into a box with one command?
 

Skurge

Archtross Dev
Veteran
Joined
Jul 12, 2015
Messages
1,272
Reaction score
301
First Language
English
Primarily Uses
N/A
Curious to know with some testing, how do I make an event handle an individual inventory?

For example I have two boxes in a room, if I deposit inventory in one box, they both share the same contents.

Tried reading through the script on how to handle it but I'm not sure what I am doing wrong.
 

shadow2k

Villager
Member
Joined
Oct 12, 2013
Messages
21
Reaction score
2
First Language
English
Primarily Uses
Curious to know with some testing, how do I make an event handle an individual inventory?

For example I have two boxes in a room, if I deposit inventory in one box, they both share the same contents.

Tried reading through the script on how to handle it but I'm not sure what I am doing wrong.
Not sure if this is what you mean, but I accomplished the same thing by just adding the box to the script below the other default boxes and then just have each event open that box.  The effect is that you can access the same inventory from multiple events.
 

Latest Threads

Latest Posts

Latest Profile Posts

Remember to do your 0,01% progress on your game today!
Went to see Jujutsu Kaisen 0 yesterday, it was cool. The movie wasnt really a masterpiece, it had some pacing and characterization problems, but overall I enjoyed it, maybe because it was the first anime film I have ever been to in the cinema lol. The battle animation & music were top-notch. I havent seen much of the anime so people who watched the entire season would probably like it more.
MainMenu.PNG
Finally satisfied with the main menu xD

The plan was to have battle sprites in the menu...But these faces from Ocean's Nostalgia look pretty damn good imo. (Will have to adjust for them ofc and maybe recolor to match the overworld/battle sprites more)
It's always disturbing to me to see my cat eating something off the bathroom floor.

Forum statistics

Threads
121,993
Messages
1,145,754
Members
160,261
Latest member
Darinoplas
Top