Technical issues with Szyu's Crafting system script

Midashe

Warper
Member
Joined
Sep 19, 2014
Messages
3
Reaction score
0
First Language
Swedish
Primarily Uses
RMVXA
Hello, first-time poster here in need of some scripting assistance.

Hi, name's Midashe (Username at least) and I need some help regarding Szyu's Crafting system script, link below to their thread for easy access.

https://forums.rpgmakerweb.com/index.php?threads/szyus-crafting-system.31377/

I basically have two issues with this script. The first and main issue is that I can't get it to properly work (Most likely and hopefully something I'm doing wrong). The second issue is that I want to expand its functionality a little but I couldn't script to save my life so I have no idea how to do that. So, one at a time.

[SOLVED]Issue 1: I can't get categories to work. [SOLVED]
Szyu's crafting system script has this feature that allows you to create custom crafting categories (Like cooking, smithing or even blublublu if that's what you want). You don't have to use this feature however and can instead open the crafting window with all unlocked recipés available. I've chosen not to do that and instead use custom categories. Thing is, opening the crafting window with all recipés works fine but when I try to use categories, none of the recipés show up. The window itself opens up but the recipés are not there. I've tried following the instructions that come with the script but they seem to lack details and may even contradict themselves. Here, I'll try to give an example of how I set things up.
Within the script
CRAFTING_CATEGORIES = ["Cooking","Smithing"]

Item notetagging
001: Potion
<category: Cooking>
<ingredients>
i: 2x 5
</ingredients>
010: Recipé book
<recipe book>
<recipes>
i: 1
</recipes>

Scriptcall used to open crafting window
SceneManager.call(Scene_Crafting, "Cooking")
OR
SceneManager.call(Scene_Crafting)
When I use the second scriptcall (Uncategorized) it works just fine but when I use the first scriptcall (Categorized) the recipés just won't show up. The window shows up but the recipés don't. I've tried rearranging the notetags, I've tried with and without quotation marks but I just can't get it to work. Anyone have any idea what I'm doing wrong?

Issue 2: Crafting yields only one item.
You can define how many ingredients are required, you can make a crafting recipé require several of one item to craft as well as several of several different items, it can even require weapons or armour and even money. This is all well and good but no matter how much the item requires to be crafted, the result will always be one of that item. Here, example, let's make a 'sandwich'. To make a sandwich you will need a 'loaf of bread' a 'chunk of meat' a 'box of butter' and a 'chunk of cheese'. Now, with all of that, you'd expect to be able to make several sandwiches. However, this script limits you to make only one sandwich. That's what I want to improve. I want to create a new notetag for the script that allows me to determine how many of the same item the crafting yields. Anyone have any idea how to accomplish this? I sure as heck don't.

There, those are the issues I need help with. I really hope someone can help me with this 'cause I've already implemented this script into my game to several points of no return. I really don't wanna go back to crafting through eventing *Shudder*. Thanks for listening.
 
Last edited:

mlogan

Global Moderators
Global Mod
Joined
Mar 18, 2012
Messages
14,659
Reaction score
8,085
First Language
English
Primarily Uses
RMMV

I've moved this thread to Script Support. Please be sure to post your threads in the correct forum next time. Thank you.

 

Midashe

Warper
Member
Joined
Sep 19, 2014
Messages
3
Reaction score
0
First Language
Swedish
Primarily Uses
RMVXA
Okay, so, umm... After some extensive testing I finally managed to get the script to work. I had made a lot of errors but that's all fixed now and the script works just fine. So, that takes care of issue 1. All I need now is a solution for issue 2, which I'm still waiting for. Just thought I'd put up such an update.
 

Roninator2

Gamer
Veteran
Joined
May 22, 2016
Messages
2,226
Reaction score
456
First Language
English
Primarily Uses
RMVXA
Place <craft quantity: X> on the item to get crafted more than one.
Code:
##    use the following:
##    <craft quantity: X>  where X is the number of items to craft

module R2
  module Craft_Quantity
    Regex = /<craft[-_ ]quantity:[-_ ]\s*(\d+)\s*>/imx
  end
end

class Scene_Crafting < Scene_ItemBase
def craft_item
    item = @item_window.item
    gi = 1
    item.ingredients.each do |ing|
      if ing[0].is_a?(RPG::BaseItem)
        $game_party.lose_item(ing[0],ing[1])
      else
        $game_party.lose_gold(ing[1])
      end
    end
    results = item.note.scan(R2::Craft_Quantity::Regex)
    results.each do |res|
      gi = res[0].to_i
    end
    $game_party.gain_item(item,gi)
    
    if @cr_category != -1
      csf = CUSTOM_CRAFT_SOUNDS_BY_CAT[@cr_category]
    else
      if item.is_a?(RPG::Item)
        csf = CUSTOM_CRAFT_SOUNDS_BY_TYPE[0]
      elsif item.is_a?(RPG::Weapon)
        csf = CUSTOM_CRAFT_SOUNDS_BY_TYPE[1]
      elsif item.is_a?(RPG::Armor)
        csf = CUSTOM_CRAFT_SOUNDS_BY_TYPE[2]
      end
    end
    RPG::SE.new(csf, 100, 50).play
    
    @item_window.refresh
    @item_window.activate
  end
end
 

Midashe

Warper
Member
Joined
Sep 19, 2014
Messages
3
Reaction score
0
First Language
Swedish
Primarily Uses
RMVXA
Thanks Roninator2, works like a charm.
 

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

Latest Threads

Latest Posts

Latest Profile Posts

The video of a psycho chasing people on the streets with a sword before getting subdued is wild. Apparent screenshots of his Twitter feed before it went private reveal a dangerous delusional mindset. I heard there was a bow person too. The crazies are really coming out of the woodworks.
Stream will be live shortly with some Witcher 3, followed by a session of the Interactive Text Adventure! Feel free to drop by!
Managed to find a way to hang a bed cover over my window. So no more being toasted alive in the afternoon!:kaoswt2:
So, uh, has anyone tried buying any resources from KokoroReflections? Because I've been looking for a 'buy' button on the site for like 10 minutes now and can't find one.
Any also thought it's too cringy to put the word "and you" in your credit as a special thanks?
Cause that's what I thought...

Forum statistics

Threads
97,993
Messages
948,390
Members
129,254
Latest member
Swiftz
Top