• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

Script: [v20\v21] Item Crafter UI Plus

  • 1,682
    • Seen today
    An updated version of Simple item crafting system + interface (v20.1) by ThatWelshOne_ for both ease of use and added functionality.
    [v20\v21] Item Crafter UI Plus
    [v20\v21] Item Crafter UI Plus
    What's New:
    • A new PBS file, recipes.txt, allowing for the definition of new recipes in one place.
    • Recipes that yield more than 1 units of the crafted item.
    • Recipes that can take ingredients with a specific flag, instead of hardcoded items.
      • Generic ingredients now have icons based off their flag.
    • Recipes sorted by flags.
    • Locking and Unlocking recipes.
    Just drag and drop in all the folders in the downloaded zip into your root folder so they merge with the folders already there.

    Defining a Recipe
    A recipes.txt entry consists of several components
    A recipe consists of its internal name (BreakMaxRevive), the Item that is produced (REVIVE), the number of items produced from 1 set of ingredients (defaults to 1 if not included), the ingredients (Item ID or flag and quantity), and a set of flags.
    If the Ingredient is a valid Item ID, then it is treated as an item, otherwise it is considered an item flag (from items.txt)
    A generic ingredient is consumed in order of cheapest price, and if two potential items share the same price, it is consumed in the order defined in items.txt (with ones defined earlier consumed first).

    Unlocking & Locking Recipes
    Recipes can be unlocked with pbUnlockRecipe(recipe_id), where recipe_id is the internal name from recipes.txt. pbUnlockRecipe(:BerryJuice) unlocks the BerryJuice recipe.
    Recipes can be locked using pbLockRecipe(recipe_id). pbLockRecipe(:BerryJuice) locks the BerryJuice Recipe.

    Using the Item Crafter
    The easiest form of calling the item crafter is pbItemCrafter(pbGetRecipes). pbGetRecipes returns an array of all the unlocked Recipe IDs. It can also be called with a flag string pbGetRecipes("Cooking"), to filter for only Recipes with the Cooking flag.

    Generic Ingredients
    Generic ingredients use an item flag instead of a regular item. To faciliate this, a new self.flag_icon_filename method is added to GameData::Item, which pulls an image named the respective flag (in lowercase) from Graphics\Items\Category. So the generic Berry ingredient will use the filename Graphics\Items\Category\berry.

    Generic ingredients by default use the flag as the name of the ingredient. If this isn't fitting, you can add the flag (in lowercase) to FLAG_TO_TEXT in 001_UI_ItemCrafting.rb, to define a different user facing name, like "Any Berry" for Berry.

    ThatWelshOne_ for the original script