Ansilvund216

Veteran
Veteran
Joined
Apr 28, 2018
Messages
50
Reaction score
1
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/)
Veteran
Joined
Mar 6, 2014
Messages
67
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

Veteran
Veteran
Joined
Apr 28, 2018
Messages
50
Reaction score
1
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
Veteran
Joined
Mar 16, 2012
Messages
6,812
Reaction score
9,117
First Language
Indonesian
Primarily Uses
RMVXA
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

Veteran
Veteran
Joined
Apr 28, 2018
Messages
50
Reaction score
1
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'
Veteran
Joined
May 15, 2012
Messages
14,693
Reaction score
3,026
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'
Veteran
Joined
May 15, 2012
Messages
14,693
Reaction score
3,026
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
Veteran
Joined
Mar 16, 2012
Messages
6,812
Reaction score
9,117
First Language
Indonesian
Primarily Uses
RMVXA
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

Veteran
Veteran
Joined
Apr 28, 2018
Messages
50
Reaction score
1
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: 8

A-Moonless-Night

WINTER IS COMING
Veteran
Joined
Mar 17, 2012
Messages
695
Reaction score
451
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

Veteran
Veteran
Joined
Apr 24, 2015
Messages
120
Reaction score
70
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/)
Veteran
Joined
Mar 6, 2014
Messages
67
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/)
Veteran
Joined
Mar 6, 2014
Messages
67
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
Veteran
Joined
May 22, 2016
Messages
3,999
Reaction score
1,044
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 Profile Posts

UHHHHH. What is this and how did someone find my game on here? 1653527395160.png
ScreenShot_5_25_2022_7_37_13.png

my game has distinct areas where travel through what are known as "battle stations" these are more or less areas to explore and fight. occasionally, you'll stumble across secret rooms with sidequests ready to be taken. this area is in the high school attic of all places... but how do ya get there is the question.
Redoing my intro scene for the 10 millionth time is pain
So this flat Earther named Mike Hughes build his own rocket to prove that the Earth was flat. But on liftoff he still had the ladder he climbed up to the rocket laying against it. Needless to say things didn't go as planned.
Anyone else just get battle system ideas but not have a game to attach them to?

Forum statistics

Threads
122,122
Messages
1,146,681
Members
160,407
Latest member
Meowsica
Top