Dynamic Lore Generation refers to generating lore with mythic automatically, parsing placeholders and using templates.
Here is an example item using these features. The details to make something like this yourself is explained in the following documentation.
Lore Templates
The base Mythic folder or individual pack folder can contain a lore-templates.yml
file where lore templates are defined.
Here are two examples of what a lore-templates.yml
file may look like, each with one of the different valid syntaxes.
BasicWeaponTest:
Lines:
- '<white><lore.stats>'
- ''
- '<placeholder.TestLine>' # Custom placeholders found in placeholders.yml
- '<gold><placeholder.TestConditionalPlaceholder>'
- ''
- '<lore.Description{wrap=10}>'
LoreTemplateTest:
- Line: '<item.group>'
- Line:
- '{stats}'
- '{stats}<yellow>Stats:'
- '{stats-each}<white><stat.display>'
- Filler: '----'
- Line:
- '{augments:GEM}Gems:'
- '{augments-each:GEM}<augment.display>'
- Filler: '----'
- Conditions:
- notEmpty <item.lore.Description>
Line: '<item.lore.Description>'
- Filler: '----'
If a line starts with {stats} or {augments} it will only render if stat/augment exist
{stats-each} and {augments-each:TYPE} lines will repeat for every stat/augment
An item could utilize this template by using Lore.Template: BasicWeaponTest
instead of providing a list of lore:
TestLoreTemplates1:
Id: BLAZE_ROD
Display: 'Test'
Lore:
Template: BasicWeaponTest
Description: Lorem ipsum dolor sit amet
Stats:
- CRITICAL_STRIKE_CHANCE 0.5 ADDITIVE
- CRITICAL_STRIKE_DAMAGE 2.0 ADDITIVE
- HEALTH 20to30 ADDITIVE
Note that Description
is used as a placeholder in the BasicWeaponTest
's <lore.Description{wrap=10}>
placeholder. You can define arbitrary lore placeholders and use them the same way as this.
Lore Placeholders
Placeholder | Description |
---|---|
<lore.*> | Fetches the value from the * key under the item's Lore field (see below) |
{stats} | If a line starts with this, it will only render if the item has stats |
{stats-each} | If a line starts with this, it will repeat for each stat the item has, and each line can fetch stats-specific values for each of those stats, like <stat.display> |
{augments:GEM} | If a line starts with this, it will only render if the item has the augment of the specified type |
{augments-each:GEM} | If a line starts with this, it will repeat for each augment of the specified type the item has, and each line can fetch augemnt-specific values for each of those augments, like <augment.display> |
{equipment-set} | If the Equipment is part of a Set, this will be replaced by its lore |
Custom Placeholders
The <placeholder.*>
placeholders in the above example are referencing the examples provided from the new placeholders.yml
, which can also be used:
TestPlaceholder: '&6TeSt PlAceHolDer'
TestConditionalPlaceholder:
Day:
Conditions:
- day
Value: "it is day"
Night:
Conditions:
- night
Value: "it is night"
Default: "it is nothing apparently"
TestRandomPlaceholder:
- red
- green
- blue
Other Information about Lore Templates
- Every node under Lore other than
Template
will be passed to the template as a<lore.*>
placeholder (where*
is the node you specify). Example:
Lore:
Template: BasicWeaponTest
Rarity: "<gray>Common"
# <lore.Rarity> would return Common in this case
-
Templates can use any other applicable placeholders supported by drop tables.
-
A line with
<lore.stats>
will be iterated and replicated for each stat using the tooltip formats configured instats.yml
.
Lore Attributes
Attributes are formatted similarly to how skills are. In our previous example, wrap
is considered an Attribute.
<lore.node{attribute=value}>
Attribute | Aliases | Description | Default |
---|---|---|---|
wrap | How many characters are displayed before wrapping text to the next line | N/A |