Difference between revisions of "GenRecipe"

From CoffeeMud Wiki
Jump to navigation Jump to search
(Created page with "{{CoffeeMUDWikiBuilderTOC}} A GenRecipe is a sub-type of GenReadable that contains one or more custom recipes from a single crafting skill. Players who have a GenRecipe in t...")
 
 
(9 intermediate revisions by the same user not shown)
Line 12: Line 12:
 
*Recipe data: From the command line, you may edit existing recipes or add a new one by selecting the appropriate number (1 for a new recipe on a blank GenRecipe, for example)
 
*Recipe data: From the command line, you may edit existing recipes or add a new one by selecting the appropriate number (1 for a new recipe on a blank GenRecipe, for example)
 
**After selecting the recipe number, you must enter a valid comma-delimited recipe code.  The number of fields varies by the crafting skill selected.  If you select "?", it will return a string valid for that crafting skill.
 
**After selecting the recipe number, you must enter a valid comma-delimited recipe code.  The number of fields varies by the crafting skill selected.  If you select "?", it will return a string valid for that crafting skill.
 +
**Each field in the comma-delimited recipe code has a specific purpose, and some fields have multiple purposes depending on other fields.  The fields with the or (||) operands are fields whose purpose is derived from another field, most likely the Item_Class_ID field.
 
<pre>
 
<pre>
 
:: For Example, at the time of this entry, the blacksmithing comma-delimited recipe code reads:  
 
:: For Example, at the time of this entry, the blacksmithing comma-delimited recipe code reads:  
Line 31: Line 32:
 
::
 
::
 
</pre>
 
</pre>
Each field in the comma-delimited recipe code has a specific purpose, and some fields have multiple purposes depending on other fields.  The fields with the or (||) operands are fields whose purpose is derived from another field, most likely the Item_Class_ID field.
+
* Using this Blacksmithing Skill as a sample
 +
** The entire recipe code will need to be entered in one continuous line of text, with a comma between each field:
 +
***ITEM_NAME - This field should be the simple name of the item. 
 +
****A % placed in the name may be added as a placeholder for the material name used in crafting the item. For blacksmithing, a % toy would display in the LIST as "a toy" and when created with the resource IRON, would have the name/display of "an iron toy".
 +
****Avoid adding color or other special text to item names, since this may confuse players on how to actually create the item.  For example, "a ^rred^? hat" is a poor name for a hat since the ^r is parsed as the color red in the LIST command for the crafting ability, but is REQUIRED in commands to get INFO or craft the item.  Color functionality in naming of crafted items is not supported because there are other abilities used to provide color to the item ([[Dyeing]] and [[Lacquerring]], for example).
 +
****Do not capitalize letters in the recipe name.  They system will determine how to capitalize words that are all lowercase.
 +
*****In the event of a unique recipe or product name, it is ok to use capital letters...but this should be the exception, not the rule.
 +
***ITEM_LEVEL - This is the base level of the item, before any material modifiers or expertises are applied.  See notes on [[GenRecipe#Balancing Recipes|Balancing Recipes]] below for the significance of item levels.
 +
***BUILD_TIME_TICKS - This is the bse time in Ticks (~4 seconds) required to build the item.  This is reduced by a number of factors, such as how many levels over the recipe level the crafter is, or certain expertises.
 +
***MATERIALS_REQUIRED - This field can be a number, in which case it will accept the type of materials the skill normally works with, or a Skill Recipe Ingredient code.
 +
****A number value in this field will result in the required weight of GenResource that the ability normally uses.  This must be a whole number.
 +
****An Ability code can be used to indicate that the only resources required to create this recipe are another ability.
 +
****A list of items required to craft this recipe may also be encoded using the formula Skill Recipe Ingredients, which can be ANDed together with a double-ampersand (&&) or ORed together with a double-pipe (||):
 +
*****This code has 5 colon-delimited fields, and is always encased in parenthesis
 +
******The first field determines where the ingredient should be located.  Options include:  onground, inventory, held, worn, and nearby.
 +
******The second field determines what happens to the ingredient when the recipe is created: consumed, kept.
 +
******The third field is the numerical quantity of that ingredientThis must be a whole number.
 +
******The fourth field is the item or resource name.
 +
*******It may be the material grouping name: CLOTH, ROCK, PRECIOUS, METAL, WOODEN, etc
 +
*******It may be a specific material name: WOOL, GRANITE, DIAMOND, COPPER, OAK, etc
 +
*******It may be a material subtype: WOOL(LLAMAWOOL), GRANITE(DARKSPECKLEDGRANITE), DIAMOND(BLACKDIAMOND), COPPER(BLUECOPPER), OAK(REDOAK), etc
 +
*******It may be part or all of the string of an item name
 +
******I don't know what the fifth field is.  I always leave it blank
 +
*****Putting it all together, your item may Skill Recipe Ingredient code may look like:
 +
******(onground:consumed:1:WOOL:)
 +
******(onground:consumed:1:WOOL:)||(onground:consumed:4:COTTON:)
 +
******(onground:consumed:1:WOOL:)&&(onground:consumed:1:WOOL:)&&(held:kept:1:RETROSPANNER:)
 +
***ITEM_BASE_VALUE - This is the base price of the item, before any material or expertise modifiers.
 +
***ITEM_CLASS_ID - This is the resultant item type, like GenArmor or GenItem.  It will likely determine what the next few columns require.  Not all crafting skills support all item types.  There are some work-arounds to this, but there is probably a good reason that you don't make shields from the wainwrighting skill.
 +
***STATUE||RIDE_BASIS||CONTAINER_TYPE_OR_LIDLOCK||CODED_WEAR_LOCATION - This field is specific to Blacksmithing.  This particular string shows 4 different options, each separated by an OR (||) operand.  Only one option is used, and that is based on the ITEM_CLASS_ID.
 +
****For GenItems, the STATUE parameter may be called out, in which case the item will accept a parameter when being made, and pass along that description to the item.  For example, if the item was called A BUST, and the crafter used BLACKSMITH BUST LOKI, it would create an item called A BUST OF LOKI and pass along the description of the user LOKI in the description of the item.
 +
****RIDE_BASIS, for GenRideables and GenFurniture and other derivatives, this further defines what type of rideable the item is (a table, a chair, etc)
 +
****CONTAINER_TYPE_OR_LIDLOCK - If the item is a GenContainer, this parameter will accept a numerical bit field for what type of items can go in it, or a LIDLOCK parameter (I need to research how this works).
 +
****CODED_WEAR_LOCATION - For GenArmor or other derivatives, this field determines where the armor can be worn, and can include optional special prefixes strung together with a colon(:) before the wear location:
 +
*****S means the item is see-through, and armor worn underneath it may be seen.
 +
*****M means the armor is multi-wear, and any number of that type of item may be worn (this is very dangerous to allow, especially if players can somehow modify the defensive value or magical ability of the items).
 +
*****[Number] means the layer number that the item is worn on, with 0 being where normal clothes are worn, and each non-adjacent whole number means the item may be worn over that layer.  (So a player could wear a -2,0,2 grouping of armor, or a -3,-1,1,3 or a -3,0,2).
 +
*****Putting it all together, you could make a (SM-4:WAIST) item, or a (2:TORSO) item, or simply a (HEAD) item.  Please do NOT include the parenthesis in your CODED_WEAR_LOCATION.
 +
***CONTAINER_CAPACITY||LIQUID_CAPACITY||MAX_WAND_USES||LIGHT_DURATION||DICE_SIDES - Similar to the previous field, this skill-specific field provides additional parameters based on the ITEM_CLASS_ID field.
 +
***CODED_SPELL_LIST - This field is the ultimate field for GenRecipes, since you may add behaviors, affects, or field keys in this field to complete your item.  More on this later.
 +
****The asterisk (*) in the Spell_Code field announces what the semicolon(;) means in the string.
 +
*****If the * is the first character, then the ; separates different ability ids.
 +
*****If there is no leading *, then the first ; separates an ability id from the parameters for that ability.
 +
 
 +
===Balancing Recipes===
 +
GenRecipes may be intentionally overbalanced due to scarcity, [[Prop_ItemBinder|prop_itembinders]] or how to obtain them (GenShopkeepers requiring a special faction rating, a specific tattoo, etc).  My recommendation is to keep the power level within a factor of 1.5 of the item level, except for very rare items.  If your MUD is a magic-starved mud, I would keep the power levels even closer to the item level, to ensure players are more reliant upon their abilities than their gear.
 +
 
 +
===Reverse Engineering===
 +
If you are having difficulties creating a genrecipe for a specific item, consider making the item by hand, copying the item, then creating a blank GenRecipe with the appropriate skill type of the item you want the recipe to make.  Then SkillName LEARN ItemName to create a recipe (have spares of the item you are trying to build in case something goes wrong).  Once you have "learned" the item, you can edit the GenRecipe and look at the resultant recipe code, and modify it to meet your needs.
 +
 
 +
It is also useful to review the recipe files for existing crafting skills using the MUDGrinder "Skill Recipes" editor.
  
 
=Notes=
 
=Notes=
.
+
*See the [[Crafting(Builder)]] section for additional considerations on recipes.

Latest revision as of 14:53, 4 July 2021

CoffeeMUD
Administrator                                                  Builder                                                              Player
=CoffeeMUD Builder Information=
Basics Praetor     Player Support     Commands     Zapper Masks Advanced Races     Classes     Abilities     Socials     Scripting    
Building Behaviors     Properties     Areas     Rooms     Exits     Items     Mobs Systems Achievements     Crafting     Help Info     Ships     Planes of Existence     Quests     Triumphs    

A GenRecipe is a sub-type of GenReadable that contains one or more custom recipes from a single crafting skill. Players who have a GenRecipe in their immediately accessible inventory (inventory, or a container with accessible contents flag) will be able to craft items from this GenRecipe if they meet the level requirements. The recipes will appear on their skill's LIST command, and will be subject to their skill's INFO command, as if the recipe was part of the skill. Dropping the recipe, or putting it in a non-accessible container, will result in all recipes from the GenRecipe no longer appearing on the skill's LIST.

Creating a GenRecipe

GenRecipes can be created from the Command Line with the command CREATE GENRECIPE or from the MUDGrinder in a room or mob's inventory.

Recipe Data

This field contains the information unique to recipes.

  • Skill ID : This should be the crafting skill name that the GenRecipe will add new recipes to the owner
  • Maximum Recipe Count : A GenRecipe may hold 1 or more recipes. Be conservative with this value, as players will use any remaining slot to create their own recipe books from your GenRecipe.
  • Recipe data: From the command line, you may edit existing recipes or add a new one by selecting the appropriate number (1 for a new recipe on a blank GenRecipe, for example)
    • After selecting the recipe number, you must enter a valid comma-delimited recipe code. The number of fields varies by the crafting skill selected. If you select "?", it will return a string valid for that crafting skill.
    • Each field in the comma-delimited recipe code has a specific purpose, and some fields have multiple purposes depending on other fields. The fields with the or (||) operands are fields whose purpose is derived from another field, most likely the Item_Class_ID field.
:: For Example, at the time of this entry, the blacksmithing comma-delimited recipe code reads: 

ITEM_NAME,ITEM_LEVEL,BUILD_TIME_TICKS,MATERIALS_REQUIRED,ITEM_BASE_VALUE,ITEM_CLASS_ID,STATUE||RIDE_BASIS||CONTAINER_TYPE_OR_LIDLOCK||CODED_WEAR_LOCATION,CONTAINER_CAPACITY||LIQUID_CAPACITY||MAX_WAND_USES||LIGHT_DURATION||DICE_SIDES,CODED_SPELL_LIST

Breaking that up into individual fields:

ITEM_NAME,
ITEM_LEVEL,
BUILD_TIME_TICKS,
MATERIALS_REQUIRED,
ITEM_BASE_VALUE,
ITEM_CLASS_ID,
STATUE||RIDE_BASIS||CONTAINER_TYPE_OR_LIDLOCK||CODED_WEAR_LOCATION,
CONTAINER_CAPACITY||LIQUID_CAPACITY||MAX_WAND_USES||LIGHT_DURATION||DICE_SIDES,
CODED_SPELL_LIST

::
  • Using this Blacksmithing Skill as a sample
    • The entire recipe code will need to be entered in one continuous line of text, with a comma between each field:
      • ITEM_NAME - This field should be the simple name of the item.
        • A % placed in the name may be added as a placeholder for the material name used in crafting the item. For blacksmithing, a % toy would display in the LIST as "a toy" and when created with the resource IRON, would have the name/display of "an iron toy".
        • Avoid adding color or other special text to item names, since this may confuse players on how to actually create the item. For example, "a ^rred^? hat" is a poor name for a hat since the ^r is parsed as the color red in the LIST command for the crafting ability, but is REQUIRED in commands to get INFO or craft the item. Color functionality in naming of crafted items is not supported because there are other abilities used to provide color to the item (Dyeing and Lacquerring, for example).
        • Do not capitalize letters in the recipe name. They system will determine how to capitalize words that are all lowercase.
          • In the event of a unique recipe or product name, it is ok to use capital letters...but this should be the exception, not the rule.
      • ITEM_LEVEL - This is the base level of the item, before any material modifiers or expertises are applied. See notes on Balancing Recipes below for the significance of item levels.
      • BUILD_TIME_TICKS - This is the bse time in Ticks (~4 seconds) required to build the item. This is reduced by a number of factors, such as how many levels over the recipe level the crafter is, or certain expertises.
      • MATERIALS_REQUIRED - This field can be a number, in which case it will accept the type of materials the skill normally works with, or a Skill Recipe Ingredient code.
        • A number value in this field will result in the required weight of GenResource that the ability normally uses. This must be a whole number.
        • An Ability code can be used to indicate that the only resources required to create this recipe are another ability.
        • A list of items required to craft this recipe may also be encoded using the formula Skill Recipe Ingredients, which can be ANDed together with a double-ampersand (&&) or ORed together with a double-pipe (||):
          • This code has 5 colon-delimited fields, and is always encased in parenthesis
            • The first field determines where the ingredient should be located. Options include: onground, inventory, held, worn, and nearby.
            • The second field determines what happens to the ingredient when the recipe is created: consumed, kept.
            • The third field is the numerical quantity of that ingredient. This must be a whole number.
            • The fourth field is the item or resource name.
              • It may be the material grouping name: CLOTH, ROCK, PRECIOUS, METAL, WOODEN, etc
              • It may be a specific material name: WOOL, GRANITE, DIAMOND, COPPER, OAK, etc
              • It may be a material subtype: WOOL(LLAMAWOOL), GRANITE(DARKSPECKLEDGRANITE), DIAMOND(BLACKDIAMOND), COPPER(BLUECOPPER), OAK(REDOAK), etc
              • It may be part or all of the string of an item name
            • I don't know what the fifth field is. I always leave it blank
          • Putting it all together, your item may Skill Recipe Ingredient code may look like:
            • (onground:consumed:1:WOOL:)
            • (onground:consumed:1:WOOL:)||(onground:consumed:4:COTTON:)
            • (onground:consumed:1:WOOL:)&&(onground:consumed:1:WOOL:)&&(held:kept:1:RETROSPANNER:)
      • ITEM_BASE_VALUE - This is the base price of the item, before any material or expertise modifiers.
      • ITEM_CLASS_ID - This is the resultant item type, like GenArmor or GenItem. It will likely determine what the next few columns require. Not all crafting skills support all item types. There are some work-arounds to this, but there is probably a good reason that you don't make shields from the wainwrighting skill.
      • STATUE||RIDE_BASIS||CONTAINER_TYPE_OR_LIDLOCK||CODED_WEAR_LOCATION - This field is specific to Blacksmithing. This particular string shows 4 different options, each separated by an OR (||) operand. Only one option is used, and that is based on the ITEM_CLASS_ID.
        • For GenItems, the STATUE parameter may be called out, in which case the item will accept a parameter when being made, and pass along that description to the item. For example, if the item was called A BUST, and the crafter used BLACKSMITH BUST LOKI, it would create an item called A BUST OF LOKI and pass along the description of the user LOKI in the description of the item.
        • RIDE_BASIS, for GenRideables and GenFurniture and other derivatives, this further defines what type of rideable the item is (a table, a chair, etc)
        • CONTAINER_TYPE_OR_LIDLOCK - If the item is a GenContainer, this parameter will accept a numerical bit field for what type of items can go in it, or a LIDLOCK parameter (I need to research how this works).
        • CODED_WEAR_LOCATION - For GenArmor or other derivatives, this field determines where the armor can be worn, and can include optional special prefixes strung together with a colon(:) before the wear location:
          • S means the item is see-through, and armor worn underneath it may be seen.
          • M means the armor is multi-wear, and any number of that type of item may be worn (this is very dangerous to allow, especially if players can somehow modify the defensive value or magical ability of the items).
          • [Number] means the layer number that the item is worn on, with 0 being where normal clothes are worn, and each non-adjacent whole number means the item may be worn over that layer. (So a player could wear a -2,0,2 grouping of armor, or a -3,-1,1,3 or a -3,0,2).
          • Putting it all together, you could make a (SM-4:WAIST) item, or a (2:TORSO) item, or simply a (HEAD) item. Please do NOT include the parenthesis in your CODED_WEAR_LOCATION.
      • CONTAINER_CAPACITY||LIQUID_CAPACITY||MAX_WAND_USES||LIGHT_DURATION||DICE_SIDES - Similar to the previous field, this skill-specific field provides additional parameters based on the ITEM_CLASS_ID field.
      • CODED_SPELL_LIST - This field is the ultimate field for GenRecipes, since you may add behaviors, affects, or field keys in this field to complete your item. More on this later.
        • The asterisk (*) in the Spell_Code field announces what the semicolon(;) means in the string.
          • If the * is the first character, then the ; separates different ability ids.
          • If there is no leading *, then the first ; separates an ability id from the parameters for that ability.

Balancing Recipes

GenRecipes may be intentionally overbalanced due to scarcity, prop_itembinders or how to obtain them (GenShopkeepers requiring a special faction rating, a specific tattoo, etc). My recommendation is to keep the power level within a factor of 1.5 of the item level, except for very rare items. If your MUD is a magic-starved mud, I would keep the power levels even closer to the item level, to ensure players are more reliant upon their abilities than their gear.

Reverse Engineering

If you are having difficulties creating a genrecipe for a specific item, consider making the item by hand, copying the item, then creating a blank GenRecipe with the appropriate skill type of the item you want the recipe to make. Then SkillName LEARN ItemName to create a recipe (have spares of the item you are trying to build in case something goes wrong). Once you have "learned" the item, you can edit the GenRecipe and look at the resultant recipe code, and modify it to meet your needs.

It is also useful to review the recipe files for existing crafting skills using the MUDGrinder "Skill Recipes" editor.

Notes