Mathias |
September 1st, 2017 08:35 AM |
Here's an example from Shadowrun that bootstraps a particular pick, instead of having the user select a pick. Looking at it, I'm pretty sure the eval script #1 isn't actually giving it information that will end up being used anywhere, and could be discarded.
Code:
<thing
id="advNKnSkil"
name="Gain a New Knowledge Skill"
compset="Advance"
description="Select a new knowledge skill of your choice at rating 1.">
<fieldval field="advAction" value="New Knowledge Skill"/>
<fieldval field="advDynamic" value="component.SkillKnow & !Hide.Skill & !SkPackKnow.?"/>
<tag group="Advance" tag="Notation"/>
<tag group="Advance" tag="KnowCat"/>
<tag group="AdvSort" tag="Skill"/>
<!-- Modify tagexpr to deny abilities that have already been added to the character -->
<eval index="1" phase="Render" priority="1000">
<before name="Assign Dynamic Tagexpr"/><![CDATA[
~get the list of all unique skills on the hero and assemble it as a list of precluded tags
var tagexpr as string
foreach pick in hero from SkillKnow where "!Hide.Skill & !Helper.Shadow"
if (eachpick.tagis[User.Unique] <> 0) then
tagexpr &= " & !UniqueSkl." & eachpick.idstring
endif
nexteach
~if there are any tags to exclude, append them to the tagexpr appropriately
if (empty(tagexpr) = 0) then
field[advDynamic].text &= tagexpr
endif
]]></eval>
<eval index="2" phase="Setup" priority="3000"><![CDATA[
field[advCost].value = #costKarma[mechNKnSKa]
]]></eval>
<child entity="Advance">
<bootstrap thing="skKnowledg">
<autotag group="Helper" tag="Displace"/>
<autotag group="Advance" tag="Gizmo"/>
</bootstrap>
</child>
</thing>
Here's the Spend Karma advance, that just lets the user set how much karma to pay for something arbititrary. The Advance.Notation triggers the display of a template that shows a text box, where the user can specify what they want, and Advance.VarCost triggers the display of an incrementer for the user to set the cost.
Code:
<thing
id="advOther"
name="Spend Karma"
compset="Advance"
description="Select this to spend Karma on something that doesn't fall into any of the other advancements, like karma paid to a free spirit.">
<fieldval field="advAction" value="Spend Karma"/>
<tag group="AdvSort" tag="Other"/>
<tag group="Advance" tag="Notation"/>
<tag group="Advance" tag="VarCost"/>
<tag group="Advance" tag="AllySpirit"/>
<child entity="Advance">
</child>
</thing>
|