[{"data":1,"prerenderedAt":6},["ShallowReactive",2],{"docs:wiki\u002FSkills\u002FPlaceholder-Parsing":3},{"html":4,"title":-1,"frontmatter":5},"\u003Ch2>Introduction\u003C\u002Fh2>\n\u003Cp>The value of certain attributes can be not only a static value, but also a value containing placeholders.\u003C\u002Fp>\n\u003Cblockquote>\n\u003Cp>While this piece of information is not contained in the documentation, you can check it by using the \u003Ca href=\"https:\u002F\u002Fmarketplace.visualstudio.com\u002Fitems?itemName=Lxlp.mythicscribe\">MythicScribe\u003C\u002Fa> extension and hovering over an attribute or a mechanic\u003C\u002Fp>\n\u003C\u002Fblockquote>\n\u003Cp>Those attributes that can have placeholders in their values are always parsed when the associated mechanic is executed, so that their value can always better reflect the current state of the mob, the target, the \u003Ca href=\"\u002Fdocs\u002Fwiki\u002FSkills\u002FSkillTrees\">SkillTree\u003C\u002Fa> and the likes\u003C\u002Fp>\n\u003Ch2>Mythic Placeholder Recognition\u003C\u002Fh2>\n\u003Cp>A Mythic placeholder has the generic syntax of \u003Ccode>&lt;placeholder.segment1{attribute=value;attribute2=value2}.segment2.segment3{}&gt;\u003C\u002Fcode>\u003C\u002Fp>\n\u003Cp>In a text, as soon as a \u003Ccode>&lt;\u003C\u002Fcode> character is spotted If\u003C\u002Fp>\n\u003Cul>\n\u003Cli>The found \u003Ccode>&lt;\u003C\u002Fcode> would start a new placeholder\u003C\u002Fli>\n\u003Cli>The character following \u003Ccode>&lt;\u003C\u002Fcode> is \u003Cstrong>NOT\u003C\u002Fstrong>\n\u003Cul>\n\u003Cli>another \u003Ccode>&lt;\u003C\u002Fcode>\u003C\u002Fli>\n\u003Cli>a space \u003Ccode> \u003C\u002Fcode>\u003C\u002Fli>\n\u003Cli>an equal sign \u003Ccode>=\u003C\u002Fcode>\u003C\u002Fli>\n\u003C\u002Ful>\n\u003C\u002Fli>\n\u003C\u002Ful>\n\u003Cp>from that point forward and as long as a matching number of \u003Ccode>&gt;\u003C\u002Fcode> has not been found, that portion of text will be evaluated as a (possible!) Mythic placeholder. If no matching Mythic placeholder is found, the literal value of the placeholder is returned\u003C\u002Fp>\n\u003Ch3>Examples\u003C\u002Fh3>\n\u003Cul>\n\u003Cli>\u003Ccode>&lt;skill.var.example&gt;\u003C\u002Fcode>: Will return the value of the variable\u003C\u002Fli>\n\u003Cli>\u003Ccode>&lt;red&gt;\u003C\u002Fcode>: \u003Cred> is not a Mythic placeholder, so a \u003Ccode>&lt;red&gt;\u003C\u002Fcode>string will be returned\u003C\u002Fli>\n\u003Cli>\u003Ccode>&lt;&lt;skill.var.amount&gt;\u003C\u002Fcode>: The first \u003Ccode>&lt;\u003C\u002Fcode> is followed by another \u003Ccode>&lt;\u003C\u002Fcode>, which is a “blacklisted” character, so the first \u003Ccode>&lt;\u003C\u002Fcode> will be treated as a simple string. On the other hand, the second \u003Ccode>&lt;\u003C\u002Fcode> is a valid character to be starting a placeholder, so \u003Ccode>&lt;skill.var.amount&gt;\u003C\u002Fcode> gets correctly recognized as a placeholder. As a result, if we say that the value of the skill scoped variable is \u003Ccode>N\u003C\u002Fcode>, the result of this parsing will be \u003Ccode>&lt;N\u003C\u002Fcode>\u003C\u002Fli>\n\u003C\u002Ful>\n\u003Ch2>Parsing Order\u003C\u002Fh2>\n\u003Cp>When a Placeholder is parsed, the operation \u003Cem>always\u003C\u002Fem> has certain steps that are executed in order\u003C\u002Fp>\n\u003Cul>\n\u003Cli>Mythic placeholders are replaced with their value\u003C\u002Fli>\n\u003Cli>Papi placeholders are replaced with their value\n\u003Cul>\n\u003Cli>If the targeted entity is a player, the Papi placeholders will be parsed against said player\u003C\u002Fli>\n\u003C\u002Ful>\n\u003C\u002Fli>\n\u003Cli>Math operations are parsed.\n\u003Cul>\n\u003Cli>At this exact step, functions and operators in the \u003Ca href=\"https:\u002F\u002Fgit.lumine.io\u002Fmythiccraft\u002FMythicMobs\u002F-\u002Fwikis\u002FSkills\u002FMath\">Math’s\u003C\u002Fa> wiki page are also interpreted and used\u003C\u002Fli>\n\u003Cli>This happens only if the attribute’s specific placeholder type (PlaceholderInteger, PlaceholderFloat etc.) has support for such, and some specific character (\u003Ccode>*\u003C\u002Fcode>, \u003Ccode>-\u003C\u002Fcode>, \u003Ccode>+\u003C\u002Fcode> etc.) appears in the string\n\u003Cul>\n\u003Cli>A PlaceholderString placeholder will not parse math\u003C\u002Fli>\n\u003Cli>A PlaceholderInt placeholder will parse math\u003C\u002Fli>\n\u003C\u002Ful>\n\u003C\u002Fli>\n\u003C\u002Ful>\n\u003C\u002Fli>\n\u003C\u002Ful>\n\u003Ch2>Compound parsing\u003C\u002Fh2>\n\u003Cp>Please \u003Cstrong>take note\u003C\u002Fstrong> of the fact that each step in this process happens against whatever was already parsed in previous steps. So, for instance, you can have something like this\u003C\u002Fp>\n\u003Cpre class=\"language-yaml\">\u003Ccode class=\"language-yaml\">  \u003Cspan class=\"yaml-plain\">-\u003C\u002Fspan> \u003Ca class=\"mythic-ref\" data-mythic-ref=\"m:setvariable\">setvariable\u003C\u002Fa>\u003Cspan class=\"yaml-punc\">{\u003C\u002Fspan>\u003Cspan class=\"yaml-plain\">var\u003C\u002Fspan>=\u003Cspan class=\"yaml-plain\">skill.somevar\u003C\u002Fspan>;\u003Cspan class=\"yaml-plain\">val\u003C\u002Fspan>=\u003Cspan class=\"yaml-number\">1\u003C\u002Fspan>\u003Cspan class=\"yaml-punc\">}\u003C\u002Fspan>\n  \u003Cspan class=\"yaml-plain\">-\u003C\u002Fspan> \u003Ca class=\"mythic-ref\" data-mythic-ref=\"m:setvariable\">setvariable\u003C\u002Fa>\u003Cspan class=\"yaml-punc\">{\u003C\u002Fspan>\u003Cspan class=\"yaml-plain\">var\u003C\u002Fspan>=\u003Cspan class=\"yaml-plain\">skill.example\u003C\u002Fspan>;\u003Cspan class=\"yaml-plain\">type\u003C\u002Fspan>=\u003Cspan class=\"yaml-plain\">STRING\u003C\u002Fspan>;\u003Cspan class=\"yaml-plain\">val\u003C\u002Fspan>=%\u003Cspan class=\"yaml-plain\">some_papi_placeholder_\u003C\u002Fspan>&lt;\u003Cspan class=\"yaml-plain\">skill.var.somevar\u003C\u002Fspan>&gt;%\u003Cspan class=\"yaml-punc\">}\u003C\u002Fspan>\n\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Cp>Where, in order\u003C\u002Fp>\n\u003Cul>\n\u003Cli>\u003Ccode>&lt;skill.var.somevar&gt;\u003C\u002Fcode> will be replaced with its value, which is the literal \u003Ccode>1\u003C\u002Fcode>\u003C\u002Fli>\n\u003Cli>The papi placeholder \u003Ccode>%some_papi_placeholder_{string}%\u003C\u002Fcode> will be parsed NOT against the literal string \u003Ccode>&lt;skill.var.somevar&gt;\u003C\u002Fcode>, but the already parsed value, which is \u003Ccode>1\u003C\u002Fcode>\u003C\u002Fli>\n\u003C\u002Ful>\n\u003Cp>So that the value stored in \u003Ccode>&lt;skill.var.somevar&gt;\u003C\u002Fcode> can be used inside of the papi placeholder.\u003C\u002Fp>\n\u003Cblockquote>\n\u003Cp>At the same time, please do take abundant note that, given the parsing order, while it is possible to make a papi placeholder returns some mythic-parseable placeholder (for instance, by making \u003Ccode>%some_other_papi_placeholder%\u003C\u002Fcode> return stuff like \u003Ccode>&lt;skill.var.test&gt;\u003C\u002Fcode>), those will NOT be parsed, since their “turn” has already passed\u003C\u002Fp>\n\u003C\u002Fblockquote>\n\u003Cp>If we were to apply this to math operations too, we could also obtain something like the following\u003C\u002Fp>\n\u003Cpre class=\"language-yaml\">\u003Ccode class=\"language-yaml\">  \u003Cspan class=\"yaml-plain\">-\u003C\u002Fspan> \u003Ca class=\"mythic-ref\" data-mythic-ref=\"m:setvariable\">setvariable\u003C\u002Fa>\u003Cspan class=\"yaml-punc\">{\u003C\u002Fspan>\u003Cspan class=\"yaml-plain\">var\u003C\u002Fspan>=\u003Cspan class=\"yaml-plain\">skill.example\u003C\u002Fspan>;\u003Cspan class=\"yaml-plain\">val\u003C\u002Fspan>=(\u003Cspan class=\"yaml-number\">1\u003C\u002Fspan>&lt;\u003Cspan class=\"yaml-plain\">skill.var.operation\u003C\u002Fspan>&gt;\u003Cspan class=\"yaml-number\">3\u003C\u002Fspan>) + \u003Cspan class=\"yaml-number\">4\u003C\u002Fspan>\u003Cspan class=\"yaml-punc\">}\u003C\u002Fspan>\n\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Cp>where the value of \u003Ccode>&lt;skill.var.operation&gt;\u003C\u002Fcode> will be inserted in the middle of 1 and 2. So\u003C\u002Fp>\n\u003Cul>\n\u003Cli>If \u003Ccode>&lt;skill.var.operation&gt;\u003C\u002Fcode> is +, the value will be the result of the (1+3)+4 math operation\u003C\u002Fli>\n\u003Cli>If \u003Ccode>&lt;skill.var.operation&gt;\u003C\u002Fcode> is -, the value will be the result of the (1-3)+4 math operation\u003C\u002Fli>\n\u003Cli>If \u003Ccode>&lt;skill.var.operation&gt;\u003C\u002Fcode> is 2, the value will be the result of the (123)+4 math operation\u003C\u002Fli>\n\u003Cli>if \u003Ccode>&lt;skill.var.operation&gt;\u003C\u002Fcode> is -2, the value will be the result of the (1-23)+4 math operation\u003C\u002Fli>\n\u003C\u002Ful>\n",{},1779063037995]