Limiting sections of crafting 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 using Coloeocanth's Crafting System and Modern Algebra's custom Item Menu script.
Fortunately, these two scripts are compatible.
The problem is that all new item categories I created with the item menu script are included when I open the crafting scene, whereas I only want to see the armor and weapon sections when I open that scene.
Is there something I can do to limit the categories shown in the crafting scene?
Thank you in advance.
 

gstv87

Veteran
Veteran
Joined
Oct 20, 2015
Messages
2,248
Reaction score
1,250
First Language
Spanish
Primarily Uses
RMVXA
I believe I understand what you want, but can you make a quick mockup image to be clear?
the solution should be a simple condition check, if I'm right.
 

Mawichan

Veteran
Veteran
Joined
Jan 24, 2018
Messages
55
Reaction score
6
First Language
Spanish
Primarily Uses
RMVXA
This is more less what the layout of the crafting scene looks like

This is more less what I want it to look like

(Are these helpful?)

For the sake making the inventory more orderly, I made separate categories for items that otherwise would have been crammed together in the same space. For example, I left melee weapons on the default "Weapons" category, while I made new ones for shields, bows, and tools for spell casting, even though they're all in the weapons section of the database.
Same thing for armors, There's helmets, gloves, chestpieces, pants, and accesories, but only the chestpieces will be upgradable, so I don't need to feature the other armor sections.
As for items, I left consumables on the default Item section, while I made new ones for crafting materials, items for buffing, items to use as projectiles and such. I don't need any of these to appear on the crafting menu.

I hope I'm conveying this well enough, thank you for taking the time to look into this :)
 

gstv87

Veteran
Veteran
Joined
Oct 20, 2015
Messages
2,248
Reaction score
1,250
First Language
Spanish
Primarily Uses
RMVXA
line 131 of Modern Algebra's script.

*it* should override Coloeoacanth's script, and is wired to self-adjust automatically.
¯\_(ツ)_/¯
 

Mawichan

Veteran
Veteran
Joined
Jan 24, 2018
Messages
55
Reaction score
6
First Language
Spanish
Primarily Uses
RMVXA
I'm really sorry, but I don't understand what you mean.
Line 131 of that script says "# To find out how to assign an item to one of the custom categories you create,"
What should I do there?
 

gstv87

Veteran
Veteran
Joined
Oct 20, 2015
Messages
2,248
Reaction score
1,250
First Language
Spanish
Primarily Uses
RMVXA
read *the end of that sentence* on line 132?
 

Mawichan

Veteran
Veteran
Joined
Jan 24, 2018
Messages
55
Reaction score
6
First Language
Spanish
Primarily Uses
RMVXA
Well, I did before I asked, I looked at line 44 too. That's just the instructions to assign database items to the new categories in the inventory, which I long did already. How does assigning categories to items have anything to do with which sections appear on the crafting menu? I hope I'm not sounding rude.
 

Sixth

Veteran
Veteran
Joined
Jul 4, 2014
Messages
2,162
Reaction score
822
First Language
Hungarian
Primarily Uses
RMVXA
You can't do this without a patch, because Modern Algebra's script overwrites the category selection window for all scenes which use it, and that craft scene happens to use it as well.

You can try this snippet:
Code:
class Window_ItemCategory

  def make_command_list
    if SceneManager.scene.is_a?(Scene_CraftBase)
      # Setup the categories you want to show in the craft menus only here.
      # You can still only use the category symbols you have setup in
      # Modern Algebra's script.
      categories = [:item, :weapon, :armor]
    else
      categories = MA_CUSTOM_ITEM_MENU[:custom_categories]
    end
    vocab = MA_CUSTOM_ITEM_MENU[:category_vocab]
    categories.each {|category|
      text = vocab[category].is_a?(Symbol) ? eval(vocab[category].to_s) : vocab[category]
      add_command(text, category)
    }
  end

end
Put it right below Modern Algebra's script.
Edit the categories array (the one below the comments), add whatever categories you want there.
Of course, I didn't test this, so it's up to you to find out if it works or not. :p
 
Last edited:

Mawichan

Veteran
Veteran
Joined
Jan 24, 2018
Messages
55
Reaction score
6
First Language
Spanish
Primarily Uses
RMVXA
I did figure I'd need a patch for it, though the previous answer threw me off a bit.
Unfortunately, the patch you provided is not working.
Thank you very much Sixth for looking into this either way :D
 

gstv87

Veteran
Veteran
Joined
Oct 20, 2015
Messages
2,248
Reaction score
1,250
First Language
Spanish
Primarily Uses
RMVXA
because Modern Algebra's script overwrites the category selection window for all scenes which use it, and that craft scene happens to use it as well.
precisely what I was basing myself on!

if Modern Algebra's script is run after Coloeocanth's, it'll take over that window, and take it's structure from the items themselves.
your solution only restores the standard structure when using the crafting scene, which the OP wants to change, to begin with.
so, better to build it around Modern Algebra's fix, and call it a day.

I thought it was a sorting problem, but then realized MA's work takes care of it, moving it over to a set of note tags, that's why I pointed to the instructions.
a work around could be to disguise the crafting categories as new, separate categories, but sporting the usual strings (WHICH, the plugin supports)
 
Last edited:

Mawichan

Veteran
Veteran
Joined
Jan 24, 2018
Messages
55
Reaction score
6
First Language
Spanish
Primarily Uses
RMVXA
Just gave a second look at Sixth's snippet. I now know why it didn't work.
In the line:
if SceneManager.scene_is?(Scene_CraftBase)
The scene it should be asking for is Scene_Crafting.

I changed that bit and works wonders now.
Once again, thanks a lot to both of you for your time and patience :D
 

Sixth

Veteran
Veteran
Joined
Jul 4, 2014
Messages
2,162
Reaction score
822
First Language
Hungarian
Primarily Uses
RMVXA
@Mawichan
Yeah, I thought it will recognize the craft scenes if I only use their superclass in the check, but it seems that doesn't work with that scene_is? method.
Changed the snippet, try it now.

Edit:
Ohh, ninja'd. :D
That works too, yeah.
If you need the same categories for the breakdown scene, you will have to add that to the check too.
Or just use the edited snippet, it should work now for both scenes.

@gstv87
I honestly have no idea what are you trying to say.
There is nothing that can be done with any of the script settings provided in any of these scripts to make 2 different category windows.
My patch lets him setup a different group of categories for the crafting scenes, which is exactly what he wrote he wants, unless I misunderstood something.
 

gstv87

Veteran
Veteran
Joined
Oct 20, 2015
Messages
2,248
Reaction score
1,250
First Language
Spanish
Primarily Uses
RMVXA
My patch lets him setup a different group of categories for the crafting scenes,
that's what I thought of, but using MA's own plugin: create new categories, but label them differently.
MA's plugin should support that.
 

Mawichan

Veteran
Veteran
Joined
Jan 24, 2018
Messages
55
Reaction score
6
First Language
Spanish
Primarily Uses
RMVXA
@Sixth
Yes, the edited snippet works fine on both scenes! Before checking your reply I had used my workaround to make it work on the breakdown scene too, but I'll stick to your edited version instead since it's simpler. It's quite helpful.

@gstv87 I don't think creating new categories regardless of labelling or item sorting would have helped. Either way the issue has been solved now, fortunately.
 

mlogan

Global Moderators
Global Mod
Joined
Mar 18, 2012
Messages
15,354
Reaction score
8,533
First Language
English
Primarily Uses
RMMV

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 Posts

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,865
Messages
1,017,059
Members
137,575
Latest member
akekaphol101
Top