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"
Szyu's Crafting System
JS Plugin Releases (RMMV)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"
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
EDIT: scratch that i figured it out
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.
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.
Hello!
Thanks for this plugin, it's a very good idea. 😀
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? 😮
Thanks for this plugin, it's a very good idea. 😀
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.
it's number based 0-10
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
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
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
here are some images for reference
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.
For example: you need the player to be able to create only one oven for the entire game.
Tell me please.
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!
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
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
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:
With these changes, you can now set up your item's recipe like so:
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>
I plan on using this for my project "Project Weak and Strong" as well as the possible full game.
This is exactly what I was hoping would be added, but it doesn't seem to load for me; any attempts to open the crafting fail. Is there any chance you could share the compiled version?
Update: I was able to figure it out (except for the sound effect; don't know enough about java to know where exactly to type it in, but that's not a big deal.)
The neat thing that Rohsek's tweak also allows: you can now pull out the book to check the recipes without allowing people to craft anywhere.
How to:
Create 2 key items: a recipe book and a crafting station.
>Give the PC a recipe book that pulls up up the crafting event (and let them keep it in their inventory). Set the recipe book to accessible from main menu.
>Every recipe includes the ingredient "crafting station" (which is set to false, non-disposable)
>Whenever the PC uses the crafting station event, they gain the key item "crafting station," then take it away when they leave the station.
The neat thing that Rohsek's tweak also allows: you can now pull out the book to check the recipes without allowing people to craft anywhere.
How to:
Create 2 key items: a recipe book and a crafting station.
>Give the PC a recipe book that pulls up up the crafting event (and let them keep it in their inventory). Set the recipe book to accessible from main menu.
>Every recipe includes the ingredient "crafting station" (which is set to false, non-disposable)
>Whenever the PC uses the crafting station event, they gain the key item "crafting station," then take it away when they leave the station.
I just noticed something that confuses me.
What is "Price" for?
Given how money is in the crafting recipe with 'currency' I do not really understand its purpose
What is "Price" for?
Given how money is in the crafting recipe with 'currency' I do not really understand its purpose
I replaced all of the code, but that somehow causes the game to crash with the message "Cannot reach property *forEach' of null"
So random question is there a way to add a level requirement to this or is there one built in that is not spoken of etc?
Not quite.
The plugin TECHNICALLY has options for "adding a recipe to an existing book," which you can trigger at a certain level; But it never seemed to work for me. So I made a worked around: just add an extra item.
Ex. The base book (key item) includes items a-e.
At level 15, they gain a key item "advanced crafting techniques," and that key item lets them access crafting for items F & G.
Glad you got it figured out. That's a pretty nice way to handle crafting and recipe tracking, I like that. And with a little more tweaking of the different "crafting station" options, you could have it so you can only smelt ore at a smelter, or process like... pelts at a tannery, etc. That could be in-depth and pretty cool.
As for the sound effects: the way it's currently implemented, it seems there's a single sound effect for the entire category, not per recipe. So you'd set it up in the plugin settings under the 'CraftingSounds' section, I believe.
As a small side note, RPGMV and MZ use JavaScript which is a completely different language than Java, so if you do go to google something for it, note they are different things. JS is used mostly in web development, though technically things like Node and Electron can let you use them for Desktop environments (Discord, built in Electron, is basically a web browser under the hood). Interestingly enough, they both appeared around the same time, though Java came first: Java came out in May of 1995, and JavaScript in December of 1995.
Price and currency refer to the same thing in different ways. In the code/recipe it's referred to as currency as in the amount of money required to craft the item (such as a crafting NPC that you pay to craft things with your ingredients) in the raw "ingredients required" sense, but the "Price" text is only for what gets displayed on the crafting GUI under the requirements,
e.g. if you had a recipe that cost money, then in the GUI you'd see:
Code:
Ingredients:
SomeItem x1
OtherItem x2
Price:
Gold x10
Given how JS is, I'd imagine you might have left off a semi-colon or a curly-brace somewhere. If you can show me the output of the Developer Console, I'd be happy to help you track down the problem. I don't feel comfortable handing out my version of the file, however, since that's basically just 'unauthorized' re-distributing of Szyu's work and according to his profile he's logged in as recently as May of 2020, even if he hasn't posted in five years. I don't know if it's really considered "abandoned."
Original thread: https://forums.rpgmakerweb.com/threads/szyus-crafting-system.49243/