Ansilvund216

Regular
Regular
Joined
Apr 28, 2018
Messages
50
Reaction score
2
First Language
English
Primarily Uses
RMVXA
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)
 

IMP1

"haystack".scan(/needle/)
Regular
Joined
Mar 6, 2014
Messages
70
Reaction score
45
First Language
English
Primarily Uses
RMVXA
Could you copy and paste what you have in your script call?
 

Titicha

Warper
Member
Joined
Jul 24, 2018
Messages
1
Reaction score
0
First Language
Madarine
Primarily Uses
RMVXA
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?
 

Ansilvund216

Regular
Regular
Joined
Apr 28, 2018
Messages
50
Reaction score
2
First Language
English
Primarily Uses
RMVXA
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)
 

TheoAllen

Self-proclaimed jack of all trades
Regular
Joined
Mar 16, 2012
Messages
7,534
Reaction score
11,996
First Language
Indonesian
Primarily Uses
N/A
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.
 

Ansilvund216

Regular
Regular
Joined
Apr 28, 2018
Messages
50
Reaction score
2
First Language
English
Primarily Uses
RMVXA
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)
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Regular
Joined
May 15, 2012
Messages
14,693
Reaction score
3,035
First Language
Tagalog
Primarily Uses
RMVXA
you can do

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

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Regular
Joined
May 15, 2012
Messages
14,693
Reaction score
3,035
First Language
Tagalog
Primarily Uses
RMVXA
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
 
Last edited:

TheoAllen

Self-proclaimed jack of all trades
Regular
Joined
Mar 16, 2012
Messages
7,534
Reaction score
11,996
First Language
Indonesian
Primarily Uses
N/A
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.
 

Ansilvund216

Regular
Regular
Joined
Apr 28, 2018
Messages
50
Reaction score
2
First Language
English
Primarily Uses
RMVXA
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
 

Attachments

  • ddw.png
    ddw.png
    36.2 KB · Views: 9

A-Moonless-Night

WINTER IS COMING
Regular
Joined
Mar 17, 2012
Messages
696
Reaction score
454
First Language
English
Primarily Uses
RMVXA
It looks like the correct script call should be:
Code:
SceneManager.call(Scene_ItemStorage)
SceneManager.scene.prepare(4)
 

Otto

Regular
Regular
Joined
Apr 24, 2015
Messages
120
Reaction score
72
First Language
Engilsh
Primarily Uses
RM2k3
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!
 

Nobihaza

Warper
Member
Joined
May 29, 2019
Messages
2
Reaction score
0
First Language
Vietnamese
Primarily Uses
RMVXA
how to fix this error?
 

Attachments

  • Untitled.png
    Untitled.png
    3.7 KB · Views: 13

IMP1

"haystack".scan(/needle/)
Regular
Joined
Mar 6, 2014
Messages
70
Reaction score
45
First Language
English
Primarily Uses
RMVXA
@Nobihaza: Hard to know without more details. What other scripts are you using?
 

Queerpg

Villager
Member
Joined
Jul 22, 2019
Messages
22
Reaction score
1
First Language
English
Primarily Uses
RMVXA
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:

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.
 

IMP1

"haystack".scan(/needle/)
Regular
Joined
Mar 6, 2014
Messages
70
Reaction score
45
First Language
English
Primarily Uses
RMVXA
@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.
 

Queerpg

Villager
Member
Joined
Jul 22, 2019
Messages
22
Reaction score
1
First Language
English
Primarily Uses
RMVXA
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))
 
Last edited:

Roninator2

Gamer
Regular
Joined
May 22, 2016
Messages
5,237
Reaction score
1,568
First Language
English
Primarily Uses
RMVXA
I tested the script and your code for the boxes. It works fine. What is the script call command you are using?
 

Latest Threads

Latest Posts

Latest Profile Posts

Behold, our jam game's main character!1701683080788.png
Uh... Forum test, forum test. Am I live?
New but not so new here. (Like, been lurking around as a guest). I hope to change my destiny.
That is, to make friends and learn from the community. I hope we all have fun and create memories worth keeping. :ptea:
made a face sprite for the little guy using default cat for comparison, I'm rather pleased with how it turned out!

image.png
Playing arounnd with NUUN's Battle Result as a VS Victory Aftermath alternative. Loving it so far despite the learning curve (there are a LOT of parameters)

1701665328725.png

Just have to figure out how to addin sub class progress.

Forum statistics

Threads
136,730
Messages
1,269,274
Members
180,453
Latest member
Gfvasd
Top