Storage Boxes

If you want to just add the item (and not go to the item storage scene), then you just need the second line. And it looks like it's missing a close-square-bracket, so it'd be something like :

Code:
$game_boxes.add_item($data_items[1 + rand(6)], 10 + rand(25), 4)

I'm not at all irritated, just didn't have a lot of time to respond. I hope this works for you!
Okay thanks, also I want to add the storage scene. the rand code is giving me a game_interpreter error

unexpected tLPAREN, expecting ']' (6)],, 10+ rand(25),4)
Could you copy and paste what you have in your script call?
Storage Boxes
TheoAllen - Limited Inventory
Item Sizes
Item Types


hello, I have some issues when using those scripts.
it works fine without " Limited Inventory"
but when I use Limited Inventory: (set weapon size 15 or 1 for exmaple)

1.they can put items over the box size
like this:
bjTgige.jpg



2.when actor nearly reach their bag limited
they cant put item into box
like this:
bmvMsoE.jpg


or this:
cNZjdUe.jpg


Im not sure if I did anything wrong tho
does anyone have same issues?
Could you copy and paste what you have in your script call?
SceneManager.call(Scene_ItemStorage)
SceneManager.scene.prepare(4, true)
$game_boxes.add_item($data_items[1 + rand
(6)], 10 + rand(25), 4)
SceneManager.call(Scene_ItemStorage)
SceneManager.scene.prepare(4, true)
$game_boxes.add_item($data_items[1 + rand
(6)], 10 + rand(25), 4)
If the script call is too long, don't cut it halfway. rand(6) is supposed to be in one line, so what you do
Code:
$game_boxes.add_item($data_items[1 + 
rand(6)], 10 + rand(25), 4)
Ending a line with operand like "+" will make the program seek the continuation of it. If not, it will assume end of line, and will throw error.
If the script call is too long, don't cut it halfway. rand(6) is supposed to be in one line, so what you do
Code:
$game_boxes.add_item($data_items[1 +
rand(6)], 10 + rand(25), 4)
Ending a line with operand like "+" will make the program seek the continuation of it. If not, it will assume end of line, and will throw error.
It says wrong number of arguments (0 for 1)

SceneManager.call(Scene_ItemStorage)
SceneManager.scene.prepare(4, true)
$game_boxes.add_item($data_items[1 +
rand(6)], 10 + rand(25), 4)
you can do

p1=$data_items[1+rand(6)]
p2=10+rand(25)
$game_boxes.add_item(p1,p2,4)
you can do

p1=$data_items[1+rand(6)]
p2=10+rand(25)
$game_boxes.add_item(p1,p2,4)
still, wrong number of arguments.
How many does it say now? still 0 for 1?

actually if it says 0 for 1 then the problem isnt the add item line because that method takes 3 arguments so it should have said 0 for 3

the only line in the code right now that dont pass an argument is the SceneManager.call line, maybe thats the problem. Maybe the Scene_ItemStorage part needs an argument

try changing it to

SceneManager.call(Scene_ItemStorage(4))

PS: I just commented on the third line of code on my first reply because it looked chopped up to me into several lines but I realized its probably because I'm reading this in mobile which has a smaller window
Can you even use Scene_ItemStorage(4) tho?
My guess is the problem is in somewhere else, on in this particular script call.
Maybe triggered by this script call, but not THE script call itself. I'd say let's wait for the OP.
How many does it say now? still 0 for 1?

actually if it says 0 for 1 then the problem isnt the add item line because that method takes 3 arguments so it should have said 0 for 3

the only line in the code right now that dont pass an argument is the SceneManager.call line, maybe thats the problem. Maybe the Scene_ItemStorage part needs an argument

try changing it to

SceneManager.call(Scene_ItemStorage(4))

PS: I just commented on the third line of code on my first reply because it looked chopped up to me into several lines but I realized its probably because I'm reading this in mobile which has a smaller window
It looks like the correct script call should be:
Code:
SceneManager.call(Scene_ItemStorage)
SceneManager.scene.prepare(4)
Not sure if someone already said that (too lazy to go trough 6 forum pages LOL), but this could also be useful to do some resident evil-ish item storage box!
how to fix this error?
@Nobihaza: Hard to know without more details. What other scripts are you using?
@Nobihaza: Hard to know without more details. What other scripts are you using?
I'm using some scripts from Japan for my game
upload_2019-7-14_16-19-49.png
Hi, I'm trying to set up the boxes in the script but everything after Box 0 wont work. What did I do wrong??
Script below:

Spoiler: Script
BOXES = [ # Do not remove.

# This first Box has the ID 0. IDs go up by 1 with each box.
{
# Box 0 (farm, craft room).
name: "Drawer",
# Size of the box (set to 0 for infinite).
size: 15,
# SE (Sound Effect) played when opening the box. If left black, the
# default will be used.
open_sound: {
name: "Open5", # Name of SE
volume: 80, # Volume to play it at (0-100%)
pitch: 100, # Pitch to play it at (50-150%)
},
# Same as above, but played when closing the box.
close_sound: {
name: "Close1", # Name of SE
volume: 80, # Volume to play it at (0-100%)
pitch: 100, # Pitch to play it at (50-150%)
},
},
{
# Box 1 (farm, bedroom).
name: "Drawer",
size: 10,
open_sound: {
name: "Open5",
volume: 80,
pitch: 100,
},
close_sound: {
name: "Close1",
volume: 80,
pitch: 100,
},
},
{
# Box 2 (farm, bedroom).
name: "Bedside Table",
size: 5,
open_sound: {
name: "Open5",
volume: 80,
pitch: 100,
},
close_sound: {
name: "Close1",
volume: 80,
pitch: 100,
},
},
{
# Box 3 (farm, bedroom).
name: "Cupboard",
size: 5,
open_sound: {
name: "Open5",
volume: 80,
pitch: 100,
},
close_sound: {
name: "Close1",
volume: 80,
pitch: 100,
},
},

]# Do not remove.
@Queerpg: When you say it won't work, what does that mean? Are you getting an error (if so, what is it)?
Or is nothing happening when you trigger the event? In which case, could you screenshot the event where you call the storage screen?
Or are you always getting access to the same box? That'd be the event as well.

@Nobihaza: I think it'd be useful to see your box setup as well, and some info about when this error happens and what you're trying to do when it happens.
This is the error code I'm getting when I try to open any box other than box 0
error code.jpg
So most likely something to do with the opening and closing sounds.
(Line 334 is: if !@box_info[box_id].has_key?🙂open_sound))
I tested the script and your code for the boxes. It works fine. What is the script call command you are using?

Original thread: https://forums.rpgmakerweb.com/threads/storage-boxes.27727/