Crafting

● ARCHIVED · READ-ONLY
Started by Mr. Trivel 12 posts View original ↗
  1. Author: Mr. Trivel


    Name: Crafting


    Created: 2016-03-27


    Version: 1.0




     


    What does it do?


    Allows players to craft items.


     


    Video:










     


    How to use?


    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. I *highly* recommend checking sample files that are located in the demo of this plugin.


     


    Discipline object looks like this:


    Spoiler
    Code:
    {
       "ID": 999,
       "Name": "NAME",
       "IconID": 1337,
       "ExpFormula": "10000*level",
       "MaxLevel": 2,
       "Categories": ["1", "2", "3", ... , "n"],
       "Background": "FileName"
    }
     



    And file structure looks like this:

    Code:
    [
    null,
    object,
    object,
    ...,
    object
    ]

    "ID" - to identify which disciiplice 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


     


    Recipe object looks like this:


    Spoiler
    Code:
    {
       "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


     


    Plugin: <Link: Github>


    How to download the Plugin: Click the link above, there will be a button named Raw, press Right Click -> Save As.


    Demo: <Link: Mediafire>


     


    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 non-commercial projects.


    For commercial use contact Mr. Trivel.
  2. Ah, Trivel. You will never cease to amaze me x)


    Thanks a lot for this amazing plugin !
  3. Agreed, love crafting in game :) thanks for the contribution. 
  4. This is an excellent crafting mechanic!


    I especially like the discipline setup with separate categories. It helps keep very large recipe catalogues from becoming unwieldy.


    It also allows for some Foreshadowing. Empty categories hint at future discovery.


    Would you consider the possibility of a scrolling Recipe Requirement window?


    - If the recipe has more than 4 required ingredients, it gets cut off.
     

    Spoiler
    16_0430_trivel_crafting_1.JPG


    (Note: I added the ability to require party gold... If curious)



    Also. Would you be willing to allow for the window size, and its divisions (Left/Right) to be defined as plugin parameters?


    Thanks again!


    edit:


    There are a few other things I've started to add for myself that you may wish to add for everyone to use. Such as 'chance' for each result, as well as displaying it, in the Product: section.
  5. @Roguedeus,


    Params for window sizes are no problem.


    As for scrolling, what would be a nice way to scroll it since? Since right now input just goes from list window to buy window and up/down are reserved for quantity.
  6. Mr. Trivel said:
    @Roguedeus,


    Params for window sizes are no problem.


    As for scrolling, what would be a nice way to scroll it since? Since right now input just goes from list window to buy window and up/down are reserved for quantity.



    The first thing that pops into my head would be allowing for the player to input (RIGHT) when the recipe is selected, to move from the recipe list to the ingredients list, and scroll it accordingly. Currently, you must select the recipe to input the quality desired so a (RIGHT) input shouldn't cause a conflict. Also, imputing (ENTER) while in the requirement window can select it as normal.


    But that is just a quick suggestion. Any solution that will allow for more than 4 ingredients to be shown would be great (including resizing the window or its elements). Whichever takes the least effort for you. :)


    I would add it myself, and share it here if I was familiar with windows.


    Speaking of which. Once you get around to adjusting the window (as mentioned) I will share my edits here if you don't object.


    If they are acceptable (code wise), maybe I will have saved you some time. :)
  7. Thank you for this awesome plugin.


    Your works have helped me tremendously.


    However, I seemed to be having an issue with this plugin.


    As for its basic functionality, it works well in my environment, but when I try to write the names of the disciplines or recipe objects in Japanese, the characters do not display correctly doing gameplay. However, when I enter them in the European alphabets, it works correctly.


    Do you have any solutions for this problem or any future plans to fix it?


    Is it possible to display names normally in Japanese characters?
  8. Good day and thank you for this nice mod, I've been playing around with it a bit and seem to have found an issue.


    I have attached the error log (F8) with this post.


    It happens in conjunction with the YEP_ItemCore plugin.  I make about 200 Copper Ingot, then make a bunch of copper sword blades, then hold down enter while crafting 1 each copper swords and I get a TypeError: Cannot read property 'length' of undefined.

    View attachment error_log.txt
  9. I have a rather annoying issue. Having edited the included .JSON files, following the proper format as best as I could, I came across this bug:
    Image
    Error.png
    This doesn't provide much context for what to do, or how to proceed. This only occurs with your plugin.
    To note, this didn't occur before I edited the .JSON files. I will include them here:
    https://www.dropbox.com/s/bxy261i0y0f4m00/Disciplines.json?dl=0
    https://www.dropbox.com/s/tknzzpw2g74yzqq/Recipes.json?dl=0
  10. is there a way to forget a recipe?

    can there be more subcategories? f.e. i want to craft up to 2000 different runes in 2-3 different ways, and would like one tab for 1 way of crafting them (4x rune of 1 lvl lower) and another for the second way ( craft them from x amount of Rune Dust (gained by desynth)
  11. For anyone still interested in using this plugin, but are having issues with it, I would recommend using the crafting plugin here instead.
    (Rather than asking for the edits I mentioned above)

    YR Plugins
    https://forums.rpgmakerweb.com/index.php?threads/yr-plugins.69148/

    It is essentially, the best parts of this, and a few other crafting plugins. It also happens to be what I am using now, FYI.
  12. Anyone that uses this plugin and love it, there are a few bugs in it that
    is discovered, specially in the demo of it.

    when you craft the item to max, it still gain exp and it bypass the max
    experience required, this is fixed in this version.

    also checking for the current level will crash the game or output of "undefined"
    which is a typo in the plugin.

    So what is fixed and changed.
    once max level is reach, it no longer gain experience
    fix scriptcalls that are in the helpfile that was undefined (now working correctly.
    I added a new text when level is reach "Smelting" Level is maxed.
    "Smelting" is the Discipline name, so if you have BlackSmithing than the text
    BlackSmithing Level is Maxed will be outputted.

    I didn't discover any other issues, but the issues that where there are fixed.

    Enjoy the plugin if you do so.