Adding New Item Categories in Modern Algebra's Customizable Item Menu

Status
Not open for further replies.

Mawichan

Veteran
Veteran
Joined
Jan 24, 2018
Messages
55
Reaction score
6
First Language
Spanish
Primarily Uses
RMVXA
Hello, I'm new to creating threads, so I hope I'm not posting in the wrong section.

Im having a problem with the Customizable Item Menu by Modern Algebra.

Link to Script Explanation Page
Link to Script on Pastebin

I want to add two item categories to the Item Menu. I followed the instructions of the script as much as I could, however when I run a play test I get a NoMethodError.

The game starts, the main menu opens, the item menu opens. It shows the icons for the two item categories I added, but the moment I move the cursor to either of the two item categories the game crashes and I get these messages:

Script 'custom item menu' line 650: NoMethodError ocurred.
Undefined method 'ores' for Vocab:Module

Script 'custom item menu' line 650: NoMethodError ocurred.
Undefined method 'souls' for Vocab:Module

It looks like this

upload_2018-1-23_13-53-7.png

upload_2018-1-23_13-55-54.png

upload_2018-1-23_13-57-15.png

This is what line 650 of the script looks like

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Set Category
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
646 def category=(category)
647 return if @category == category
648 @category = category
649 vocab = MA_CUSTOM_ITEM_MENU[:category_vocab][@category]
650 label = vocab.is_a?(Symbol) ? eval(vocab.to_s) : vocab
651 refresh(label)
652 end
653 end


I'm pretty sure the error is my fault. I think there's an instruction I didn't understand well or didn't follow correctly.
The problem is my lack of scripting knowledge won't allow me to understand what the error means and what part of my input into the script is causing the error.

There's a section in the instructions that says:

(...) all you need to do is first create a symbol for the category and add it to the array below. This can be anything as long as it is unique and in the format:
:unique


The example given is custom_categories: [:item, :potion, :weapon, :armor, :key_item]
The array of categories for what I want would be something like [:item, :weapon, :armor, :key_item, :ores, :souls]

I'm unsure whether this is related to the problem, but when the instructions say "create a symbol" the symbol is the word that follows the colon (like ":potion")? Or is it something else?

This is what my script looks like

Sorry for the long post but I hope the information provided is a good start to find the root of the problem or a solution.
Any help or guidance will be greatly appreciated.
Thank you for your time.
 

Attachments

Last edited:

Sixth

Veteran
Veteran
Joined
Jul 4, 2014
Messages
2,136
Reaction score
805
First Language
Hungarian
Primarily Uses
RMVXA
It happens because you made the settings like this:
Code:
  :ores =>     :"Vocab::ores",
  :souls=>     :"Vocab::souls",
That won't work, since the Vocab module got no such things defined by default, which is what the error tells too.
You should name your custom categories directly there, like:
Code:
  :ores =>     "Ores",
  :souls=>     "Souls",
And it should work than.
 

Mawichan

Veteran
Veteran
Joined
Jan 24, 2018
Messages
55
Reaction score
6
First Language
Spanish
Primarily Uses
RMVXA
You're absolutely right. It's working perfectly now. Thank you very much for your help and timely reply ;w;
 

Kes

Global Moderators
Global Mod
Joined
Aug 3, 2012
Messages
21,466
Reaction score
10,865
First Language
English
Primarily Uses
RMVXA

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

 
Status
Not open for further replies.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

This little brat (my nephew) just invent a new way of enjoying his orange juice by pouring it inside of used perfume bottle and sprayed it to his mouth...
Jamaica? No, Aunty. I said, I'm on RPG Maker :*/
Lunar New Year is over :( but it's time to get back to work!
I keep giving myself deadlines because I'm so excited to finish something but I notice areas where I'm rushing the story and that's what's gonna weaken my overall project, gotta stop that

Forum statistics

Threads
93,690
Messages
914,660
Members
123,289
Latest member
mintminstrel
Top