Difference between revisions of "OLC Section 8"

From Immwiki
Jump to: navigation, search
(Created page with "= Recipe Data = == Overview == Recipes are stored on the crafted item, that is the [i]result[/i] of the crafting combo. == The Recipe Data Viewer == +---------------------...")
 
Line 3: Line 3:
 
== Overview ==
 
== Overview ==
  
Recipes are stored on the crafted item, that is the [i]result[/i] of the crafting combo.
+
Recipes are stored on the crafted item, that is the ''result'' of the crafting combo.
  
 
== The Recipe Data Viewer ==
 
== The Recipe Data Viewer ==
  
+----------------------------------------------------------------------------------+
+
  +----------------------------------------------------------------------------------+
| Recipe Settings (Slot 0)                                                        |
+
  | Recipe Settings (Slot 0)                                                        |
| Recipe type: 1                                    (Cooking)                    |
+
  | Recipe type: 1                                    (Cooking)                    |
| Flags:      [needs_fire cooking_kit use_keywords]                              |
+
  | Flags:      [needs_fire cooking_kit use_keywords]                              |
| Keyword 1:  cooking_barley                                                      |
+
  | Keyword 1:  cooking_barley                                                      |
| Keyword 2:  cooking_mushroom                                                    |
+
  | Keyword 2:  cooking_mushroom                                                    |
| Keyword 3:  (null)                                                              |
+
  | Keyword 3:  (null)                                                              |
| Keyword 4:  (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.
 
This will appear in Oedit after you've started a recipe.  To begin a recipe, you need to first declare its slot.
Line 70: Line 70:
  
 
Example: recipe key1 cooking_broccoli
 
Example: recipe key1 cooking_broccoli
 +
 +
''The recipe checks for anything with cooking_broccoli in its name.''
 +
 +
 +
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!!!
 +
 +
[https://docs.google.com/spreadsheets/d/1FL64xLgKnltRsJnw5NPrcADPmpJXUBVDIPxHIJKvxLQ/edit#gid=0]
 +
 +
== 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.

Revision as of 23:36, 16 April 2021

Recipe Data

Overview

Recipes are stored on the crafted item, that is the result of the crafting combo.

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 data_progs correspond to the recipe slot, allowing a great deal of flexibility. See [ 3588] sauteed broccoli in orange sauce for an example; 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.

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.

Key

Syntax: recipe key<value> <keyword>

Example: recipe key1 cooking_broccoli

The recipe checks for anything with cooking_broccoli in its name.


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!!!

[1]

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.