Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
In your foreach, exclude any tactics skills added as advancements.
<!-- Validate our skill picks -->
<thing
id="valSkill"
name="Skills"
compset="Simple">
<tag group="Helper" tag="Bootstrap"/>
<!-- Make sure that we have a Tactics skill choice selected -->
<evalrule index="1" phase="Validate" priority="8000" message="Tactics skill must be selected"><![CDATA[
~if we're not a player character (hero type), we're valid
validif (hero.tagis[CharType.typHero] = 0)
~if we have a skill selected, verify that it is a tactics choice
var tactcount as number
foreach pick in hero from Skill where "thing.user_added & !Helper.Displace"
if (eachpick.tagcount[SkillCat.Tactics] <> 0) then
tactcount += 1
endif
nexteach
~if only one tactics skill pick is chosen, we're valid
validif (tactcount = 1)
~otherwise mark our tab as invalid
~mark associated tabs as invalid
container.panelvalid[skills] = 0
]]></evalrule>
<!-- Make sure that we have all skills selected -->
<evalrule index="2" phase="Validate" priority="8500" message="Not enough selected"><![CDATA[
~we have a negative or zero quantity left, we're good
validif (hero.tagis[CharType.typHero] = 0)
validif (hero.child[resSkill].field[resLeft].value <= 0)
~mark associated tabs as invalid
container.panelvalid[skills] = 0
]]></evalrule>
</thing>
While I'm thinking about this, do the skeleton files come with a "Weapon/Armor" proficiency system already built into them?
I highly recommend that you take the differences in advancements between the various 40k games into account before writing an advancement system - don't lock yourself into a deathwatch-only system that references chapters and other things that are specific to this game and won't function for the more free-form advancement in dark heresy or rogue trader where there are so many alternate advancement paths available.
<thing
id="advNewPsy"
name="Gain a New Psychic Power"
compset="Advance"
description="Select a new Psychic Power of your choice.">
<fieldval field="advAction" value="New Psychic Power"/>
<fieldval field="advDynamic" value="component.PsyPower"/>
<tag group="Advance" tag="AddNew"/>
<!-- Modify tagexpr to deny psychic powers 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 psychic powers on the hero and assemble it as a list of precluded tags
var tagexpr as string
tagexpr = hero.tagids[PsyPower.?," & !"]
~if there are any tags to exclude, append them to the tagexpr appropriately
field[advDynamic].text = splice(field[advDynamic].text,tagexpr," & !")
]]></eval>
<!-- Attach the child entity for tracking the advance -->
<child entity="Advance">
<tag group="Advance" tag="MustChoose"/>
</child>
</thing>