レシピデータを元にアイテムを作り出すことのできるプラグイン – MrTS_Crafting.js

タイトル
Allows crafting of items.
作者名
ヘルプ
--------------------------------------------------------------------------------
Terms of Use
--------------------------------------------------------------------------------
Don't remove the header or claim that you wrote this plugin.
Credit Mr. Trivel if using this plugin in your project.
Free for commercial and non-commercial projects.
--------------------------------------------------------------------------------
Version 1.0
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
Setting Everything Up
--------------------------------------------------------------------------------
First, you'll need 2 new files in data folder:
Recipes.json
Disciplines.json

Recipes file will hold all recipe data and Disciplines file will hold data about
disciplines. Ihighlyrecommend checking sample files that are located in the
demo of this plugin.
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
Disciplines.json
--------------------------------------------------------------------------------
Discipline object looks like this:
{
"ID": 999,
"Name": "NAME",
"IconID": 1337,
"ExpFormula": "10000level",
"MaxLevel": 2,
"Categories": ["1", "2", "3", ... , "n"],
"Background": "FileName"
}

And file structure looks like this:
[
null,
object,
object,
...,
object
]

"ID" - to identify which disciplice is which and for plugin calls. ID > 0
"Name" - how discipline is called
"IconID" - icon for discipline
"ExpFormula" - leveling formula for discipline, level stands for current
discipline level
"MaxLevel" - max possible discipline level
"Categories" - Categories to organize items when crafting
"Background" - Give a background to crafting. Leave it empty - "" to use default
- background. Images go into img\System
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
Recipes.json
--------------------------------------------------------------------------------
Recipe object looks like this:
{
"ID": 192312,
"Name": "Ultimate Sword of Ascension",
"IconIndex": 122,
"Result": [
{
"Type": "weapon",
"ID": 99999,
"Amount": 1
}
],
"Requires": [
{
"Type": "item",
"ID": 1337,
"Amount": 99
}
],
"Discipline": ID,
"Category": ["Swords", "Weapons"],
"XP": 999999999,
"LevelReq": 150,
"Learned": "command"

}

And file structure looks like this:
[
null,
object,
object,
...,
object
]

"ID" - To know which recipe is which. ID > 0
"Name" - How it appears in crafting window
"IconIndex" - Icon for recipe
"Result" - What items and how many of them result by crafting it, can be more
than one item.
"Requires" - What items and how many of them are required to craft it.
{
"Type" - item type - "weapon", "item", "armor"
"ID" - item ID
"Amount" - how much of the item
}
"Discipline" - which disicipline's recipe is this
"Category" - under which categories will item be shown, can be multiple
"XP" - XP given for the discipline
"LevelReq" - Discipline level requirement to craft it
"Learned" - how is the recipe learned - "start" - from the start, "command" -
- by plugin command - "levelhit" - unlocks automatically when hits -
- required level
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
Plugin Commands
--------------------------------------------------------------------------------
Crafting Start [DISCIPLINE_ID] - opens scene to craft with discipline
Crafting GainExp [DISCIPLINE_ID] [EXP] - give exp to certain discipline
Crafting Learn [RECIPE_ID] - learn a specific recipe

Examples:
Crafting Start 3
Crafting GainExp 1 100
Crafting Learn 5
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
Script Calls
--------------------------------------------------------------------------------
$gameSystem.getDisciplineExp(DISCIPLINE_ID) - returns EXP of a discipline
$gameSystem.getDisciplineLevel(DISCIPLINE_ID) - returns LEVEL of a discipline
$gameSystem.isRecipeKnown(RECIPE_ID) - returns if recipe is learned
$gameSystem.knownRecipesNumber(DISCIPLINE_ID) - returns amount of recipes known
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
Version History
--------------------------------------------------------------------------------
1.0 - Release
パラメータ
param Required Levels
desc Show recipe required levels to craft it? True/False
Default: True
default True

param Gauge Color 1
desc Color 1 of discipline exp gauge - in hex.
Default: #23b94d
default #23b94d

param Gauge Color 2
desc Color 2 of discipline exp gauge - in hex.
Default: #60e021
default #60e021

param Category Color
desc Color of Categories.
Default: #FFD700
default #FFD700

param Has Items Color
desc Color of item number when party has enough for recipe.
Default: #4CC417
default #4CC417

param Not Has Items Color
desc Color of item number when party doesn't have enough for recipe.
Default: #C24641
default #C24641

param Closed Category Symbol
desc Symbol to mark closed category.
Default: +
default +

param Open Category Symbol
desc Symbol to mark open category.
Default: -
default -

param Required Level Text
desc Required recipe level text.
Default: Required Lv.:
default Required Lv.:

param Result Text
desc Recipe result text.
Default: Product:
default Product:

param Required Items Text
desc Text for required items.
Default: Required Items:
default Required Items:

param Craft Text
desc Craft button text.
Default: Craft
default Craft

param Discipline Level Text
desc Discipline Level Text
Default: Level:
default Level:

param Possession Text
desc How many items party has text.
Default: Owned:
default Owned:

param Craft Sound
desc Which sound to play on successful craft?
Default: Parry
default Parry

param Show Buttons
desc Show quantity buttons for mouse? True/False
Default: True
default True

param Stretch
desc Stretch Windows if resolution is bigger than default? True/False
default False

ライセンス表記
Free for commercial and non-commercial projects.

紹介ページ https://github.com/Trivel/RMMV/blob/master/MrTS_Crafting.js