Szyu's Crafting System

Geieet

Warper
Member
Joined
Mar 1, 2015
Messages
1
Reaction score
0
First Language
English
Primarily Uses
RMMV
I fixed this by having a simple generic recipe for a basic health potion included. Not a glamorous fix but it worked for me, since I needed one anyway.
I'm having an issue where I can't add a recipe to an existing book. I want the player to collect recipes as they go throughout the world and add them to one single crafting book.
Is there any trick to using the CraftingSystem add_recipe 1: i12 plugin command?
I've got it set up so that if the character reads a book it shows some text about the book, like so, and then runs the plugin command, but when calling the CraftingSystem open 0 command it doesn't show the new recipes, only the potion recipe that is pre-defined in to the book.

EDIT: And for some reason if I try and use a book with the category of 0 and add something to it, I get a _recipe_book null error.

View attachment 76860
When you write "CraftingSystem add_recipe x: i3" the "x" should correspond to the number of the book in the item slot. So if your crafting book is int the 15th slot in the items, then you would write "CraftingSystem add_recipe 15: i3"
 

Ryoshu

Veteran
Veteran
Joined
Mar 11, 2013
Messages
134
Reaction score
7
First Language
english
is it possible for you to release a demo of this script. im not too experienced with scripting and im having a hard time understanding how it all works to be completely honest

EDIT: scratch that i figured it out
 
Last edited:

Zacyiia

The Endless Void
Member
Joined
Apr 15, 2015
Messages
11
Reaction score
0
First Language
English
Primarily Uses
RMMV
Will be using for an "Exercise Project" called GLORY TO THE RED CRAYON. May or may not be put on steam ( will not be selling it though since it is just an exercise project).

P.S. If you know anything about the USMC and their obsession with crayons; you might have a better understanding of this game's theme.
 

Amy_Lizzy

Virtuoso in the Art of Trying
Member
Joined
Mar 24, 2018
Messages
5
Reaction score
2
First Language
French
Primarily Uses
RMMV
Hello!
Thanks for this plugin, it's a very good idea. :D

But I have a little issue. When I'm in the Crafting Window, if I use the the keys to move from a product to another, the game crashes because "Cannot read property 'forEach' of null".

Here are the logs.


Somebody for helping me, please? :o
 

Jop890

Warper
Member
Joined
Feb 10, 2019
Messages
1
Reaction score
0
First Language
English
Primarily Uses
RMMV
it's number based 0-10
 

megated123

Warper
Member
Joined
Jun 5, 2016
Messages
3
Reaction score
0
Primarily Uses
Szyu's CraftingSystem
plugin for RPG Maker MV
v1.0​

Introduction
A simple crafting system, to craft items, weapons and armors based on recipes and recipe books.


Download
Link to mediafire



Screenshots





How to Use
For detailed explanations on how to use the plugin, check the plugin manager's help button for this script.

Terms of Use
You are free to use this script for commercial and non-commercial projects. However I'd like you to inform me of the projects you are planning to use it in, so I can keep track of where my scripts are used.
Hey i am planning on using this for my game here

https://gamejolt.com/games/HMR/281485
 

Arramon

Warper
Member
Joined
Dec 25, 2017
Messages
1
Reaction score
0
First Language
English
Primarily Uses
RMMV
Any updates on this crafting system? has anyone been able to add sound FX or animations to the crafting? I was thinking of having the system check (using common event) to see if the newly crafted item is added to the inventory for the first time then show an animation and message, but other than that I'm not sure how to add bells and whistles to this system. I have a blacksmith sitting there hammering, but there's no way to exit the crafting system prior to the item being crafted to show the blacksmith hammering away then the item appear. It just appears in the crafting system with no tada! effects at all.....I want people to be gloriously happy when they craft something =b
The plugin setup where you can edit the text that appears after crafting an item should also allow for a SE to be played. Can someone change the script to include a sound being played? And possibly a yes/no are you sure question prior to the item being crafted.

https://mvplugins.com/plugin/Szyu/Crafting System is the updated script here???? I see a v1.2
 
Last edited by a moderator:

Tactician-Elive

Villager
Member
Joined
Dec 2, 2019
Messages
12
Reaction score
0
First Language
English
Primarily Uses
RMMV
I don't know how quickly you can respond but the plugin won't show the crafting menu no matter how much I try.
here are some images for reference
 

Attachments

Klimber

Warper
Member
Joined
Apr 2, 2020
Messages
1
Reaction score
0
First Language
Ukrainian
Primarily Uses
RMMV
Hello, I’m interested in one thing about your plugin, Szyu. Namely: is it possible to set a restriction on the creation of a certain number of items inside the plugin?
For example: you need the player to be able to create only one oven for the entire game.
Tell me please.
 

bossmanCulley

Warper
Member
Joined
Apr 11, 2020
Messages
2
Reaction score
0
First Language
English
Primarily Uses
RMMV
I just want to add this for anyone who is frustrated trying to get this to work and failing. I spent over an hour trying to figure out why my recipe book kept showing up blank and im happy to say that I found the answer and I'm sure it's helpful. MAKE SURE the recipe book is not set to consumable! I completely overlooked that. Basically when you open the book you "consume" it which then makes it blank. I'm so glad I figured that out because this plugin is awesome. Thank you Szyu!
 

TheGameAfter

I'm here to help and to learn!
Veteran
Joined
Apr 20, 2019
Messages
48
Reaction score
29
First Language
Hebrew
Primarily Uses
RMMV
Hey game makers,

I just did some research to find a crafting plugin for my project, since Szyu's didn't respond/post here for some time and I see some people have problems with this plugin I wanted to share other 'crafting' system you might miss, hopefully, someone will find it useful :)

you can see the plugins in this post.

TGA
 

rohzek

Warper
Member
Joined
Oct 7, 2017
Messages
2
Reaction score
1
First Language
English
Primarily Uses
RMMV
Hey everyone.

I've made a few changes to this plugin for use on my own project, figured I'd share here if anyone else wanted to play with them. YMMV, this works perfect in my situation but it's not tested in every situation - Example: I'm not even using currency so there's no way you could craft with it.


To add in my changes, just open the script in a text editor (preferably something like Notepad++) control+F the first line of the code and change/replace the function to match what I have.

What I've done is added the ability to set an item not to be removed when crafted with, and the ability to set the number of items outputted with a single craft:

Code:
DataManager.load_ingredientLists = function(){
        var dbs = [$dataItems, $dataWeapons, $dataArmors];
        dbs.forEach(function(db){
            db.filter(function(obj){return obj != null;}).forEach(function(item){
                item._ingredients = null;
                item._craftamount = null;
                
                if (item.note.match(/<recipe>[\s\S]*<\/recipe>/gim)){
                    item._ingredients = [];

                    item.note.match(/([iwa]:\s*\d+,\s*\d+,\s*(true|false)|[co]:\s*\d+)/gim).forEach(function(ing_line){
                        var ing = ing_line.match(/([iwa]):\s*(\d+),\s*(\d+),\s*(true|false)|([co]):\s*(\d+)/i);
                        var ing_db;
                        var needed;
                        var consumed;
                        var output;
                        
                        if (ing[1] != null){
                            switch (ing[1]){
                                case 'w': ing_db = $dataWeapons[parseInt(ing[2])]; break;
                                case 'a': ing_db = $dataArmors[parseInt(ing[2])]; break;
                                case 'i': ing_db = $dataItems[parseInt(ing[2])]; break;
                            }
                        } else {
                            if (ing[5] == 'c'){
                                ing_db = currencyText;
                            }
                            
                            if (ing[5] == 'o'){
                                ing_db = "output";
                            }
                        }
                        
                        consumed = ing[4] === 'true' ? true : false;
                        
                        if (ing_db == currencyText){
                            needed = parseInt(ing[6]);
                        } else if(ing_db === "output") {
                            output = parseInt(ing[6]);
                            
                            if(item._craftamount === null) {
                                item._craftamount = output === null ? 1 : output;
                            }
                        } else {
                            needed = parseInt(ing[3]);
                            item._ingredients.push({'item': ing_db, 'amount':needed, 'consumed': consumed});
                        }
                    },this);
                }
            },this);
        },this);
    }
Code:
Scene_CraftingMenu.prototype.onCraft = function(){
        // Create crafting sound
        var craftingSound = new Object();
        craftingSound.name = craftingSounds[this._category];
        craftingSound.pan = 0; 
        craftingSound.pitch = 100; 
        craftingSound.volume = 90;
        AudioManager.playSe(craftingSound); // play crafting sound

        var numberToCraft = this._indexWindow.item()._craftamount;
        $gameParty.gainItem(this._indexWindow.item(), numberToCraft);
        this.loseIngredients();
        
        // Show gain item Message
        $gameMessage.setBackground(0);
        $gameMessage.setPositionType(1);
        
        var out = numberToCraft > 1 ? " x" + numberToCraft : "";
        var message = itemCraftedText + '\n' + this._indexWindow.item().name + out;
        
        $gameMessage.add(message);
    };
Code:
Scene_CraftingMenu.prototype.loseIngredients = function(){
        var item = this._indexWindow.item();
           var ing;
           var db;
           var needed;
        var consumed;
        
           item._ingredients.forEach(function(ing){
               needed = ing['amount'];
            consumed = ing['consumed'];
               if (ing['item'] == currencyText){
                   $gameParty.loseGold(needed);
               } else {
                if(consumed) {
                    $gameParty.loseItem(ing['item'], needed);
                }
               }
           }, this);
        this._ingredientsWindow.refresh();
    };

With these changes, you can now set up your item's recipe like so:

Code:
<recipe>
   o: 4 # Number of items to be outputted with a single craft
   i: 12, 1, true # Requires 1 of item #12, and this item will be consumed
   i: 71, 1, false # Requires 1 of item# 71, and this item will not be consumed
</recipe>

1.png
2.png
3.png
 

SolidSilver

Warper
Member
Joined
Jun 29, 2020
Messages
1
Reaction score
0
First Language
English
Primarily Uses
RMMV
I plan on using this for my project "Project Weak and Strong" as well as the possible full game.
 

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

Latest Threads

Latest Posts

Latest Profile Posts

A collab cover of White Wishes with @PixeLockeT!!~

Multiple takes of my recordings ended in this way, I wish I could've done it better, but I still love this!
Just saw an article stating a Back to the FutureXTransformer comic crossover--and Doc Browns car is an Autobot. I am ALL FOR THIS!!
Well I sure didn't know fans could overheat and die. Room fans.
Felt like I dodged a bomb, my project was fine right after I force resetted due to a crash as I have yet to start working on it today..... :kaoback:
I have no idea what to do with my evening. I was working on the next Slip into Ruby but I kinda want to do something else for a bit. But I have no idea what. Yay indecision!

Forum statistics

Threads
99,176
Messages
962,652
Members
130,750
Latest member
AmateruYukitteru
Top