Szyu's Crafting System

Szyu

Villager
Member
Joined
Aug 22, 2013
Messages
29
Reaction score
57
First Language
German
Primarily Uses
Here is an example how to set up the notes for a Blacksmithing recipe and book:



To call the menu, just call a plugin command "CraftingSystem open 0"
 

Iliketea

Tea lover
Veteran
Joined
Oct 28, 2015
Messages
848
Reaction score
944
First Language
German
I got the menu to come up I am trying to figure out how to make recipe book or how to add items to it.
For the recipe book you need tp make a key item and then write in the note : 

  <recipe_book>

category: x 

i: ( any item you want in it : 1,2,5,8,19 etc)

w: ( any weapon you want in it) 

a:  ( any armor you want in it)

</recipe_book>
 

Szyu

Villager
Member
Joined
Aug 22, 2013
Messages
29
Reaction score
57
First Language
German
Primarily Uses
Since I got some question about how to switch between the status display and the ingredients display, here is the answer:

While in the crafting menu, press "W" to switch to the status display and press "Q" to switch back to the ingredients display.
 

Iliketea

Tea lover
Veteran
Joined
Oct 28, 2015
Messages
848
Reaction score
944
First Language
German
Since I got some question about how to switch between the status display and the ingredients display, here is the answer:

While in the crafting menu, press "W" to switch to the status display and press "Q" to switch back to the ingredients display.
Oh nice!

BTW, do you plan to make the recipe book usable? I mean like that you can look up all recipes you currently have in it and what indigents they need?

That would be totally awesome.
 

sarugaki339

Villager
Member
Joined
Oct 31, 2015
Messages
28
Reaction score
4
First Language
English
Primarily Uses
Quick question; I tried pressing Q and W in the crafting menu and it does switch between ingredients and status, however in status the only thing I can see is price, I can't see weapon type equip stats, ect.
 

winkr7

Veteran
Veteran
Joined
Oct 27, 2015
Messages
99
Reaction score
31
First Language
english
Primarily Uses
N/A
Hello;

Does this plugin include crafting animations?  Like a hammer pounding metal, or a bubbling cauldron for potions?

thanks lots.
 

cropots

Veteran
Veteran
Joined
Oct 31, 2015
Messages
175
Reaction score
27
First Language
Portugues
It did not work for me. The category number is what?
 

Szyu

Villager
Member
Joined
Aug 22, 2013
Messages
29
Reaction score
57
First Language
German
Primarily Uses
Oh nice!

BTW, do you plan to make the recipe book usable? I mean like that you can look up all recipes you currently have in it and what indigents they need?

That would be totally awesome.
I didn't intend to.. but perhaps I'll consider it for a newer version.

Quick question; I tried pressing Q and W in the crafting menu and it does switch between ingredients and status, however in status the only thing I can see is price, I can't see weapon type equip stats, ect.
I tried it out, but can't seem to reproduce this problem... everything will be displayed just finde.

Hello;

Does this plugin include crafting animations?  Like a hammer pounding metal, or a bubbling cauldron for potions?

thanks lots.
Nope, until now, now crafting animations.. I tried to keep it as simple as possible.

It did not work for me. The category number is what?
What doesn't work for you in detail?

The category number indicates the index of the category you define in the pluginmanager:

"Blacksmithing, Alchemy, Cooking, Tailoring"

Blacksmithing would be index 0

Alchemy -> 1

Cooking -> 2

Tailoring -> 3
 

cropots

Veteran
Veteran
Joined
Oct 31, 2015
Messages
175
Reaction score
27
First Language
Portugues
I did several tests and always goes blank as shown.


EDIT: I did! Thank you.
 
Last edited by a moderator:

Szyu

Villager
Member
Joined
Aug 22, 2013
Messages
29
Reaction score
57
First Language
German
Primarily Uses
So could you tell what the problem was for reference for others please? I can't seem to reproduce how you all get these problems, so this could be helpful for the future
 

Dr Anthrax

Warper
Member
Joined
Nov 8, 2015
Messages
2
Reaction score
0
First Language
English
Dear Szyu, I Will Be Using This Plugin in the Development of A Game Title with your permission. if you Would like to inquire about anything involving this Project Please Get Ahold of me. i just hope Both RMMV and This Plugin can handle the Intense Strain i will be putting it through.

EDIT: i learned this doesnt work with Yanfly's Item Core and thus i will no longer be using this as it wont work with the game im making. im sorry to give up a crafting plugin, but i do say that otherwise this is still a great plugin. keep it up.
 
Last edited by a moderator:

DBDragoner

Veteran
Veteran
Joined
Apr 2, 2012
Messages
123
Reaction score
89
Double check your recipe book spelling. It's <recipe_book>. My cousin forgot the _ and we sent several minutes racking our brains trying to figure it out.
 

cropots

Veteran
Veteran
Joined
Oct 31, 2015
Messages
175
Reaction score
27
First Language
Portugues
So could you tell what the problem was for reference for others please? I can't seem to reproduce how you all get these problems, so this could be helpful for the future
I thought it was all automatic or that the item should be consumable, but found that simply create the recipe book and once you are with him kept in inventory, revenue is enabled in NPC. Works 100% for me now, endless possibilities. Very grateful for the work.

 

Sorry for the English, I am Brazilian.
 

Jeffrey Torres

Villager
Member
Joined
Oct 4, 2013
Messages
7
Reaction score
2
First Language
English
Primarily Uses
Just FYI, I was able to get my issue resolved. I was doing everything right but... well... It turns out there's a difference between "thinking" you've updated your plugins and "actually" updating your plugins. Go figure.

Also, I made a modification to the layout that I'm really fond of, hope you don't mind. I'm Javascript illiterate so I feel like this took WAY longer than it should have, but, hey... I trimmed some infor off the status menu and made it permanent. The ingredients list only allows for 4 ingredients now, but that's fine for my needs.

 
 
Last edited by a moderator:

Addictator

Villager
Member
Joined
Oct 29, 2015
Messages
12
Reaction score
0
First Language
Français
Hi Szyu,

I've got a big issue with your plugin.

Everything works fine for recipes and books BUT when I save, quit then reload the game, the script is considering I got no items needed for crafting.

I can gather these items and craft immediately, that works fine but as soon as I quit game and be back, the script is unable to read my items.

Have you got any idea ?

Thx a lot,

Addictator.
 

Jeffrey Torres

Villager
Member
Joined
Oct 4, 2013
Messages
7
Reaction score
2
First Language
English
Primarily Uses
Hi Szyu,

I've got a big issue with your plugin.

Everything works fine for recipes and books BUT when I save, quit then reload the game, the script is considering I got no items needed for crafting.

I can gather these items and craft immediately, that works fine but as soon as I quit game and be back, the script is unable to read my items.

Have you got any idea ?

Thx a lot,

Addictator.
Confirmed, I'm having the exact same issue.
 

sarugaki339

Villager
Member
Joined
Oct 31, 2015
Messages
28
Reaction score
4
First Language
English
Primarily Uses
Saw the last post and decided to check. Mine is a bit different however. Mine just doesn't recognize my items no matter what. It says I have 0 of whatever item I need no matter how many I have, no matter if it's immediately after receiving the item or if I save and restart. No matter what, the plug in doesn't recognize those items in my inventory.
 

cropots

Veteran
Veteran
Joined
Oct 31, 2015
Messages
175
Reaction score
27
First Language
Portugues
Just FYI, I was able to get my issue resolved. I was doing everything right but... well... It turns out there's a difference between "thinking" you've updated your plugins and "actually" updating your plugins. Go figure.

Also, I made a modification to the layout that I'm really fond of, hope you don't mind. I'm Javascript illiterate so I feel like this took WAY longer than it should have, but, hey... I trimmed some infor off the status menu and made it permanent. The ingredients list only allows for 4 ingredients now, but that's fine for my needs.

 
I like that style could make the file available?
 

Jeffrey Torres

Villager
Member
Joined
Oct 4, 2013
Messages
7
Reaction score
2
First Language
English
Primarily Uses
Saw the last post and decided to check. Mine is a bit different however. Mine just doesn't recognize my items no matter what. It says I have 0 of whatever item I need no matter how many I have, no matter if it's immediately after receiving the item or if I save and restart. No matter what, the plug in doesn't recognize those items in my inventory.
 I noticed it wont recognize items affected by Yanfly's scripts that add variance. Like the equipemtn scripts adds -5 to +5 to a weapons stats by default at random, and that throws things off. Not sure if it's the same with you but I'd try turning of Equipment Core and Item Core and whatever extensions and see if it works.

I like that style could make the file available?
My resolution is set to 960x540, and I modified the code with that resolution in mind. Like I said, I'm really not very good with Javascript...

Code:
//=============================================================================// CraftingSystem.js//=============================================================================/*: * @plugindesc Craft items, weapons and armors based on categorized recipe books. * @author Julian "Szyu" Heinen * * @param Categories * @desc The names of the categories. * @default Blacksmith, Alchemy *  * @param Price Text * @desc Text used for item's price in status display  * @default Price *  * @param Equip Text * @desc Text used for item's equipment type in status display  * @default Equip *  * @param Type Text * @desc Text used for item's equipment type in status display  * @default Type *  * @param Ingredients Text * @desc Text used for indicating an item's crafting ingredients * @default Ingredients: *  * @param Currency Text * @desc Text used for currency ingredients * @default Currency *  * @param Item Crafted Text * @desc Text used after crafting an item * @default Item crafted: *  * * @help *   * Plugin Command: *   CraftingSystem open 0    		# Opens the crafting scene for category #0 *   CraftingSystem add_recipe 5: w3		# Adds the recipe of weapon #3 to recipe book #5 *   CraftingSystem remove_recipe 5: a1	# Removes the recipe of armor #1 from recipe book #5 * * Defining recipes for items, weapons and armors in their notes: *    <recipe> *    i: 1, 5	# requires 5 of item #1 *    w: 3, 2	# requires 2 of weapon #3 *    a: 2, 5	# requires 5 of armor #2 *    c: 1000	# requires 1000 of currency *    </recipe> * * Defining recipe books (only items) in their notes: *    <recipe_book> *    category: x	# recipe book is of category #x *    i: 1, 3, 4	# recipe book contains the recipes of items #1, #3 and #4 *    w: 3 		# recipe book contains the recipes of weapon #3 *    a: 2, 1 		# recipe book contains the recipes of armors #1 and #2 *    </recipe_book> * */ (function(){	var parameters = PluginManager.parameters('CraftingSystem');	var categories = parameters['Categories'].replace(/^\s+|\s+$/gm,'').split(',') || ['Blacksmithing', 'Alchemy'];	var priceText = String(parameters['Price Text'] || 'Price');    var equipText = String(parameters['Equip Text'] || 'Equip');    var typeText = String(parameters['Type Text'] || 'Type');    var ingredientsText = String(parameters['Ingredients Text'] || 'Ingredients:');	var currencyText = String(parameters['Currency Text'] || 'Currency');	var itemCraftedText = String(parameters['Item Crafted Text'] || 'Item crafted:');	/*----------------------------------------------	* Game_Interpreter	*---------------------------------------------*/	var _szcrsy_Game_Interpreter_pluginCommand = Game_Interpreter.prototype.pluginCommand;	Game_Interpreter.prototype.pluginCommand = function(command, args){		_szcrsy_Game_Interpreter_pluginCommand.call(this, command, args);		console.log(categories);		console.log(priceText);		console.log(equipText);		console.log(typeText);		console.log(ingredientsText);		console.log(currencyText);		console.log(itemCraftedText);		if (command == 'CraftingSystem'){			switch (args[0]){				case 'open':					SceneManager.push(Scene_CraftingMenu)					SceneManager.prepareNextScene(args[1])					break;				case 'add_recipe':					this.addRecipes(args.splice(1,args.length-1));					break;				case 'remove_recipe':					this.removeRecipes(args.splice(1,args.length-1));					break;			}		}	};		Game_Interpreter.prototype.addRecipes = function(args){		var book = $dataItems[parseInt(args[0])];		var item;		var regex;		if (book._recipe_book == null) return;		for (var i=1;i<args.length;i++){			regex = args[i].match(/([iwa])(\d+)/i);			switch (regex[1]){				case 'i': item = $dataItems[parseInt(regex[2])]; break;				case 'w': item = $dataWeapons[parseInt(regex[2])]; break;				case 'a': item = $dataArmors[parseInt(regex[2])]; break;			}			if (item._ingredients == null) continue;			if (book._recipe_book['recipes'].filter(function(obj){return obj == item;}).length > 0) continue;			book._recipe_book['recipes'].push(item)		}	}	Game_Interpreter.prototype.removeRecipes = function(args){		var book = $dataItems[parseInt(args[0])];		var item;		var regex;		if (book._recipe_book == null) return;		for (var i=1;i<args.length;i++){			regex = args[i].match(/([iwa])(\d+)/i);			switch (regex[1]){				case 'i': item = $dataItems[parseInt(regex[2])]; break;				case 'w': item = $dataWeapons[parseInt(regex[2])]; break;				case 'a': item = $dataArmors[parseInt(regex[2])]; break;			}			if (item._ingredients == null) continue;			if (book._recipe_book['recipes'].filter(function(obj){return obj == item;}).length == 0) continue;			book._recipe_book['recipes'].splice(book._recipe_book['recipes'].indexOf(item), 1);		}	}	/*----------------------------------------------	* DataManager	*---------------------------------------------*/	var _szcrsy_DataManager_createGameObjects = DataManager.createGameObjects;	DataManager.createGameObjects = function() {		_szcrsy_DataManager_createGameObjects.call(this);		// Create recipe book object		this.load_recipeBooks();		this.load_ingredientLists();	}	DataManager.load_recipeBooks = function() {		$dataItems.forEach(function(item){			if (item == null) {return;}			item._recipe_book = null;			if (item.note.match(/<recipe_book>[\s\S]*<\/recipe_book>/m)){				item._recipe_book = {'recipes':[]};				var cat;				// check if category is correct				if ((cat = item.note.match(/category:\s*(\d+)/m))){					item._recipe_book['category'] = parseInt(cat[1]);					//now item is sure to be a recipe book with correct category					var rec;					var db;					item.note.match(/([iwa]:\s*[\d+,\s]*)/gim).forEach(function(recipe_line){						rec = recipe_line.match(/([iwa]):\s*([\d+,\s]*)/i);						switch (rec[1]){							case 'w': db = $dataWeapons; break;							case 'a': db = $dataArmors; break;							case 'i': db = $dataItems; break;						}						rec[2].split(',').forEach(function(id){							item._recipe_book['recipes'].push(db[parseInt(id)]);						}, this);					}, this);				}			}		}, this);	}	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;				if (item.note.match(/<recipe>[\s\S]*<\/recipe>/gim)){					item._ingredients = [];					item.note.match(/([iwa]:\s*\d+,\s*\d+|[c]:\s*\d+)/gim).forEach(function(ing_line){						var ing = ing_line.match(/([iwa]):\s*(\d+),\s*(\d+)|([c]):\s*(\d+)/i);						var ing_db;						var needed;						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[4] == 'c'){								ing_db = currencyText;							}						}						if (ing_db == currencyText){							needed = parseInt(ing[5]);						} else {							needed = parseInt(ing[3]);						}						item._ingredients.push({'item': ing_db, 'amount':needed});					},this);				}			},this);		},this);	}	var _szcrsy_DataManager_makeSaveContents = DataManager.makeSaveContents;	DataManager.makeSaveContents = function() {	    // A save data does not contain $gameTemp, $gameMessage, and $gameTroop.	    var contents = _szcrsy_DataManager_makeSaveContents.call(this);	    var recipe_books = {};	    $dataItems.filter(function(item){return item != null && item._recipe_book != null;}).forEach(function(item){	    	recipe_books[item.id] = item._recipe_book;	    },this);	    contents.recipe_books       = recipe_books;	    return contents;	};	var _szcrsy_DataManager_extractSaveContents = DataManager.extractSaveContents;	DataManager.extractSaveContents = function(contents) {		_szcrsy_DataManager_extractSaveContents.call(this, contents);		var recipe_books = contents.recipe_books;		for (var key in recipe_books){			$dataItems[key]._recipe_book = recipe_books[key];		}	};	/*----------------------------------------------	* Scene_CraftingMenu	*---------------------------------------------*/	function Scene_CraftingMenu() {		this.initialize.apply(this, arguments);	}		Scene_CraftingMenu.prototype = Object.create(Scene_MenuBase.prototype);	Scene_CraftingMenu.prototype.constructor = Scene_CraftingMenu;		Scene_CraftingMenu.prototype.initialize = function(){		Scene_MenuBase.prototype.initialize.call(this);	};		Scene_CraftingMenu.prototype.prepare = function(category) {		this._category = category;	};		Scene_CraftingMenu.prototype.create = function(){		Scene_MenuBase.prototype.create.call(this);		// Create category window		this._categoryWindow = new Window_CraftingCategory(this._category);		this.addWindow(this._categoryWindow);		// Create item window		this._indexWindow = new Window_CraftingItems(0, this._categoryWindow.height, this._category);		this._indexWindow.setHandler('cancel', this.popScene.bind(this));		this._indexWindow.setHandler('ok', this.onCraft.bind(this));		this.addWindow(this._indexWindow);		// Create Item Status Window		var swy = this._indexWindow.y+this._indexWindow.height;		this._statusWindow = new Window_CraftingItemStatus(320,this._categoryWindow.height, 640, 234);		this.addWindow(this._statusWindow);		this._indexWindow.setStatusWindow(this._statusWindow);		// Create Item Ingredients window		this._ingredientsWindow = new Window_CraftingIngredients(320,this._categoryWindow.height+234, 640, 234);		this.addWindow(this._ingredientsWindow);		this._indexWindow.setIngredientsWindow(this._ingredientsWindow);		//this._indexWindow.setHandler('pagedown', this.showStatus.bind(this)); // W				this._messageWindow = new Window_Message();		this.addWindow(this._messageWindow);	    this._messageWindow.subWindows().forEach(function(window) {	        this.addWindow(window);	    }, this);		this._activeWindow = 0;	};	Scene_CraftingMenu.prototype.onCraft = function(){		$gameParty.gainItem(this._indexWindow.item(), 1);		this.loseIngredients();		// Show gain item Message		$gameMessage.setBackground(0);        $gameMessage.setPositionType(1);		$gameMessage.add(itemCraftedText+'\n' + this._indexWindow.item().name);	};/*	Scene_CraftingMenu.prototype.showStatus = function(){		if (this._activeWindow !== 1){			var sw = this._statusWindow;			var iw = this._ingredientsWindow;			iw.move(Graphics.boxWidth,iw.y, iw.width, iw.height);			sw.move(0, sw.y, sw.width, sw.height);			this._activeWindow = 1;			this._indexWindow.setHandler('pageup', this.showIngredients.bind(this)); // Q			delete this._indexWindow._handlers['pagedown'];		}		this._indexWindow.activate();	};	Scene_CraftingMenu.prototype.showIngredients = function(){		if (this._activeWindow !== 0){			var sw = this._statusWindow;			var iw = this._ingredientsWindow;			sw.move(-Graphics.boxWidth, sw.y, sw.width, sw.height);			iw.move(0,iw.y, iw.width, iw.height);			this._activeWindow = 0;			this._indexWindow.setHandler('pagedown', this.showStatus.bind(this)); // W			delete this._indexWindow._handlers['pageup'];		}		this._indexWindow.activate();	};*/	Scene_CraftingMenu.prototype.loseIngredients = function(){		var item = this._indexWindow.item();       	var ing;       	var db;       	var needed;       	item._ingredients.forEach(function(ing){       		needed = ing['amount'];       		if (ing['item'] == currencyText){       			$gameParty.loseGold(needed);       		} else {       			$gameParty.loseItem(ing['item'], needed);       		}       	}, this);		this._ingredientsWindow.refresh();	};		/*----------------------------------------------	* Window_CraftingCategory	*---------------------------------------------*/	function Window_CraftingCategory(){		this.initialize.apply(this, arguments);	}	Window_CraftingCategory.prototype = Object.create(Window_Base.prototype);	Window_CraftingCategory.prototype.constructor = Window_CraftingCategory;	Window_CraftingCategory.prototype.initialize = function(category) {		this._category = category;		Window_Base.prototype.initialize.call(this, 0,0,Graphics.boxWidth, this.fittingHeight(1));		this.refresh();	};	Window_CraftingCategory.prototype.refresh = function(){		this.drawText(categories[this._category], 0,0,this.contents.width, this.lineHeight(), 'center');	};		/*----------------------------------------------	* Window_CraftingItems	*---------------------------------------------*/	function Window_CraftingItems(){		this.initialize.apply(this, arguments);	}		Window_CraftingItems.prototype = Object.create(Window_Selectable.prototype);	Window_CraftingItems.prototype.constructor = Window_CraftingItems;		Window_CraftingItems.lastTopRow = 0;    Window_CraftingItems.lastIndex  = 0;		Window_CraftingItems.prototype.initialize = function(x,y, category) {		var width = 320;		var height = 468; //this.fittingHeight(4);		this._category = parseInt(category);		Window_Selectable.prototype.initialize.call(this, x,y,width, height);		this.refresh();		this.setTopRow(Window_CraftingItems.lastTopRow);        this.select(Window_CraftingItems.lastIndex);        this.activate();	};		Window_CraftingItems.prototype.maxCols = function(){		return 1;	};		Window_CraftingItems.prototype.maxItems = function(){		return this._list ? this._list.length : 0;	};		Window_CraftingItems.prototype.setStatusWindow = function(statusWindow) {        this._statusWindow = statusWindow;        this.updateStatus();    };		Window_CraftingItems.prototype.setIngredientsWindow = function(ingredientsWindow) {        this._ingredientsWindow = ingredientsWindow;        this.updateIngredients();    };		Window_CraftingItems.prototype.update = function(){		if (!$gameMessage.isBusy()){			Window_Selectable.prototype.update.call(this);			this.updateStatus();			this.updateIngredients();		}	};	Window_CraftingItems.prototype.updateStatus = function() {        if (this._statusWindow) {            var item = this._list[this.index()];            this._statusWindow.setItem(item);        }    };    Window_CraftingItems.prototype.updateIngredients = function() {        if (this._ingredientsWindow) {            var item = this._list[this.index()];            this._ingredientsWindow.setItem(item);        }    };		Window_CraftingItems.prototype.refresh = function(){		var i, item;		var cat, c2;		this._list = [];		cat = parseInt(this._category);		$gameParty.allItems().filter(function(item){			return item._recipe_book != null && cat === parseInt(item._recipe_book['category']);		}).forEach(function(item){			item._recipe_book.recipes.forEach(function(rec_item){				this._list.push(rec_item);			},this);		}, this);;				this.createContents();		this.drawAllItems();	};		Window_CraftingItems.prototype.drawItem = function(index){		var item = this._list[index];		var rect = this.itemRect(index);		var width = rect.width - this.textPadding();		this.drawItemName(item, rect.x, rect.y, width);	};		Window_CraftingItems.prototype.processCancel = function(){		Window_Selectable.prototype.processCancel.call(this);		Window_CraftingItems.lastTopRow = this.topRow();        Window_CraftingItems.lastIndex = this.index();	};	Window_CraftingItems.prototype.processOk = function() {	    if (this.itemIngredientsMet()) {	        this.playOkSound();	        this.updateInputData();	        this.callOkHandler();	    } else {	        this.playBuzzerSound();	    }	};	Window_CraftingItems.prototype.item = function() {    	var index = this.index();    	return this._list && index >= 0 ? this._list[index] : null;     };		Window_CraftingItems.prototype.itemIngredientsMet = function(){		var item = this.item();		var met = true;		if (item == null) return false;		var existingCount = 0, needed = 0;		item._ingredients.forEach(function(ing){			needed = ing['amount'];			if (ing['item'] == currencyText){				existingCount = $gameParty.gold();			}			else{				existingCount = $gameParty.numItems(ing['item']);			}			//console.log('ex: ' + existingCount + '; needed: ' + needed + '; RESULT: ' + (existingCount < needed));			if (existingCount < needed){				met = false;			}		}, this);		return met;	};	/*----------------------------------------------	* Window_CraftingItemStatus	*---------------------------------------------*/	function Window_CraftingItemStatus() {        this.initialize.apply(this, arguments);    }    Window_CraftingItemStatus.prototype = Object.create(Window_Base.prototype);    Window_CraftingItemStatus.prototype.constructor = Window_CraftingItemStatus;    Window_CraftingItemStatus.prototype.initialize = function(x, y, width, height) {        Window_Base.prototype.initialize.call(this, x, y, width, height);    };    Window_CraftingItemStatus.prototype.setItem = function(item) {        if (this._item !== item) {            this._item = item;            this.refresh();        }    };    Window_CraftingItemStatus.prototype.refresh = function() {    	var item = this._item;        var x = 0;        var y = 0;        var lineHeight = this.lineHeight();        this.contents.clear();        this.drawItemName(item, x, y);        x = this.textPadding();        y = lineHeight + this.textPadding();        var price = item.price > 0 ? item.price : '-';        this.changeTextColor(this.systemColor());        this.drawText(priceText, x, y, 120);        this.resetTextColor();        this.drawText(price, x + 120, y, 120, 'right');        y += lineHeight;        if (DataManager.isWeapon(item) || DataManager.isArmor(item)) {            var etype = $dataSystem.equipTypes[item.etypeId];            this.changeTextColor(this.systemColor());            this.drawText(equipText, x, y, 120);            this.resetTextColor();            this.drawText(etype, x + 120, y, 120, 'right');            y += lineHeight;            var type;            if (DataManager.isWeapon(item)) {                type = $dataSystem.weaponTypes[item.wtypeId];            } else {                type = $dataSystem.armorTypes[item.atypeId];            }            this.changeTextColor(this.systemColor());            this.drawText(typeText, x, y, 120);            this.resetTextColor();            this.drawText(type, x + 120, y, 120, 'right');            x = this.textPadding() + 300;            y = lineHeight + this.textPadding();            for (var i = 2; i < 6; i++) {                this.changeTextColor(this.systemColor());                this.drawText(TextManager.param(i), x, y, 160);                this.resetTextColor();                this.drawText(item.params[i], x + 160, y, 60, 'right');                y += lineHeight;            }        }        /*x = 0;        y = this.textPadding() * 2 + lineHeight * 7;        this.drawTextEx(item.description, x, y);        /*var item = this._item;        var x = 0;        var y = 0;        var lineHeight = this.lineHeight();        this.contents.clear();        this.drawItemName(item, x, y);        x = this.textPadding();        y = lineHeight + this.textPadding();        var price = item.price > 0 ? item.price : '-';        this.changeTextColor(this.systemColor());        this.drawText(priceText, x, y, 120);        this.resetTextColor();        this.drawText(price, x + 120, y, 120, 'right');        y += lineHeight;        if (DataManager.isWeapon(item) || DataManager.isArmor(item)) {            var etype = $dataSystem.equipTypes[item.etypeId];            this.changeTextColor(this.systemColor());            this.drawText(equipText, x, y, 120);            this.resetTextColor();            this.drawText(etype, x + 120, y, 120, 'right');            y += lineHeight;            var type;            if (DataManager.isWeapon(item)) {                type = $dataSystem.weaponTypes[item.wtypeId];            } else {                type = $dataSystem.armorTypes[item.atypeId];            }            this.changeTextColor(this.systemColor());            this.drawText(typeText, x, y, 120);            this.resetTextColor();            this.drawText(type, x + 120, y, 120, 'right');            x = this.textPadding() + 300;            y = lineHeight + this.textPadding();            for (var i = 2; i < 8; i++) {                this.changeTextColor(this.systemColor());                this.drawText(TextManager.param(i), x, y, 160);                this.resetTextColor();                this.drawText(item.params[i], x + 160, y, 60, 'right');                y += lineHeight;            }        }        x = 0;        y = this.textPadding() * 2 + lineHeight * 7;        this.drawTextEx(item.description, x, y);*/    };    /*----------------------------------------------	* Window_CraftingIngredients	*---------------------------------------------*/	function Window_CraftingIngredients() {        this.initialize.apply(this, arguments);    }    Window_CraftingIngredients.prototype = Object.create(Window_Base.prototype);    Window_CraftingIngredients.prototype.constructor = Window_CraftingIngredients;    Window_CraftingIngredients.prototype.initialize = function(x,y,width, height){    	Window_Base.prototype.initialize.call(this, x,y,width, height);    }    Window_CraftingIngredients.prototype.setItem = function(item) {        if (this._item !== item) {            this._item = item;            this.refresh();        }    };    Window_CraftingIngredients.prototype.refresh = function(){    	this.contents.clear();    	var x=0;    	var y=0;    	var lineHeight = this.lineHeight();    	var width = this.contents.width - this.textPadding() * 2;    	var existingCount = 0, needed = 0;    	this.changeTextColor(this.systemColor());		this.drawText(ingredientsText, x, y, width);		this.resetTextColor();		this._item._ingredients.forEach(function(ing){			y += lineHeight;			needed = ing['amount'];			if (ing['item'] == currencyText){				existingCount = $gameParty.gold();				this.drawText(ing['item'], x, y, width);			}			else{				existingCount = $gameParty.numItems(ing['item']);				this.drawItemName(ing['item'], x, y, width);			}			this.drawText('/' + needed, x, y, width, 'right');			if (existingCount < needed) 				this.changeTextColor(this.crisisColor());			else 				this.changeTextColor(this.powerUpColor());			this.drawText(existingCount, x, y, width-this.textWidth('/' + needed), 'right');			this.resetTextColor();		}, this);    }})();
 

Addictator

Villager
Member
Joined
Oct 29, 2015
Messages
12
Reaction score
0
First Language
Français
Hi guys,

I made a few tests, I can reproduce your error sarugaki339. Nothing works if you don't start a new game with script ON (on a load game it won't works).

Try to give your main actor book and items needed for recipes on a new game common event and try crafting, it should works.

It works too if you give books later but crafting items disappear after disconnecting.

I'm actually trying to remove ALL scripts but Szyu's one but I think it's coding problem, probably Data recording problem.

I'll try to add new recipe books to see how the script reacts.

Have a nice rpg making ;)
 
Last edited by a moderator:

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

Latest Threads

Latest Posts

Latest Profile Posts

Moderators, you must have so much patience to be able to deal with everything. I mod in a server of sorts and today we just got a message, which, despite it's helpful constructive criticism, basically stated that all of the mods were jerks and that was the only reason our server was unlikeable. So, thank you, for having patience. You are appreciated! :kaoluv:
Haired slime? Trying some different styles of art. Maybe I can make some resources with this new kind of painting.......
i love my game very much
Uh, I'm probably overthinking this, but I think that some of my music sounds kinda...bad?
The melodies are just sort of awkward, and don't flow.
I'm really not sure what to do. Why am I even worrying about this? I don't even have a battle system yet!
And the Lord said, let there be lighting effects! And there were lighting effects! And it was good...ish? Might tweak this some more.

Forum statistics

Threads
105,726
Messages
1,015,928
Members
137,409
Latest member
SirKeksalot
Top