Technical issues with Szyu's Crafting system script

Discussion in 'RGSSx Script Support' started by Midashe, Jul 4, 2019.

  1. Midashe

    Midashe Warper Member

    Messages:
    3
    Likes Received:
    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.
    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: Jul 6, 2019
    #1
  2. mlogan

    mlogan Global Moderators Global Mod

    Messages:
    13,611
    Likes Received:
    7,520
    Location:
    Texas
    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.

     
    #2
  3. Midashe

    Midashe Warper Member

    Messages:
    3
    Likes Received:
    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.
     
    #3
  4. Roninator2

    Roninator2 Gamer Veteran

    Messages:
    1,513
    Likes Received:
    324
    Location:
    Canada
    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
     
    #4
  5. Midashe

    Midashe Warper Member

    Messages:
    3
    Likes Received:
    0
    First Language:
    Swedish
    Primarily Uses:
    RMVXA
    Thanks Roninator2, works like a charm.
     
    #5

Share This Page