Difference between revisions of "OLC Section 8"
Line 79: | Line 79: | ||
Keywords are more flexible than comp, allowing you to specify a broad category of ingredient rather than an exact vnum. This lets you make apple pie from any apple, including apples added to the game ''after'' you built the pie. | Keywords are more flexible than comp, allowing you to specify a broad category of ingredient rather than an exact vnum. This lets you make apple pie from any apple, including apples added to the game ''after'' you built the pie. | ||
− | See the '''Meow for Snack''' spreadsheet for a list of known ingredients and their keywords. If you add an ingredient to the game, add it here!!! | + | See the '''Meow for Snack'''[https://docs.google.com/spreadsheets/d/1FL64xLgKnltRsJnw5NPrcADPmpJXUBVDIPxHIJKvxLQ/edit#gid=0] spreadsheet for a list of known ingredients and their keywords. If you add an ingredient to the game, add it here!!! |
+ | |||
− | |||
== Craft_script == | == Craft_script == |
Revision as of 23:50, 16 April 2021
Contents
Recipe Data
Overview
Recipes are stored on the crafted item--that is the result of the crafting combo. Ingredients are listed in the recipe, along with various other details.
The Recipe Data Viewer
+----------------------------------------------------------------------------------+ | Recipe Settings (Slot 0) | | Recipe type: 1 (Cooking) | | Flags: [needs_fire cooking_kit use_keywords] | | Keyword 1: cooking_barley | | Keyword 2: cooking_mushroom | | Keyword 3: (null) | | Keyword 4: (null) | +----------------------------------------------------------------------------------+
This will appear in Oedit after you've started a recipe. To begin a recipe, you need to first declare its slot.
Recipe commands use the following format:
recipe <command> <value>
Available Commands
Slot
Syntax: recipe slot <value>
This specifies which slot you are using. An item can have multiple recipes with different ingredient combinations that result in the same item. In prog, the craft_script correspond to the recipe slot, allowing a great deal of flexibility.
There is presumably a limit to the number of recipe slots an item may have. NINJA FILL IN HERE.
Type
Syntax: recipe type <value>
Specifies what skill the crafter will be using to craft the item. The types are (NOTE: these types are preliminary):
1: Cooking. For edible and drinkable items. 2: Alchemy. Potions and pills probably. 3: Smithing. Armor and weapons. 4: Tailoring. Clothes. 5. Scribing. ????
Flags
Syntax: recipe flags <flag>
Recipe flags can alter the requirements or format for the recipe.
needs_fire: A fire must be present in the room, or the recipe will fail. cooking_kit: Crafter must have a cooking kit in their inventory, or the recipe will fail. use_keywords: By default, recipes want specific ingredient vnums. Use_Keywords swaps to using keywords (words in the item's name string, such as cooking_broccoli). You can only use one of these modes at a time.
Comp
Syntax: recipe comp<value> <vnum>
Example: recipe comp1 17134
The recipe adds [17134] some broccoli to the ingredient list.
Short for component, comp uses an exact vnum to specify an ingredient. Use this when you want EXACTLY Nika's bacon and EXACTLY a griffin egg and EXACTLY an Uzith-Hazi mushroom. Comp accepts no substitutes. Comp can, however, hold multiple vnums on each comp slot.
Example: recipe comp2 7189 11396
The recipe adds [ 7189] a pink and green apple and [11396] a ripe red apple as interchangeable ingredients
Key
Syntax: recipe key<value> <keyword>
Example: recipe key1 cooking_broccoli
The recipe checks for anything with cooking_broccoli in its name.
Keywords are more flexible than comp, allowing you to specify a broad category of ingredient rather than an exact vnum. This lets you make apple pie from any apple, including apples added to the game after you built the pie.
See the Meow for Snack[1] spreadsheet for a list of known ingredients and their keywords. If you add an ingredient to the game, add it here!!!
Craft_script
A data_prog that corresponds to a recipe slot, the craft_script can do whatever an item prog can do, making it a nigh limitless way to add functionality to your recipes. Triggered when the corresponding recipe slot is completed, the craft_script will go through its lines and act on them like any other prog. Keep in mind the craft_script will override the normal success echo, so be sure to include an echo to indicate success (or failure as the case may be--yes, you can force a fail due to whatever arcane specificities your dark heart desires).
craft_script0: Corresponds to recipe slot 0. craft_script1: Corresponds to recipe slot 1. etc.
See [ 3588] sauteed broccoli in orange sauce for an example of a craft_script. Recipe slot 0 requires broccoli, and recipe slot 1 requires asparagus. The prog, craft_prog1, is triggered when someone crafts recipe 1, and it restrings the broccoli to asparagus in the final crafted item.