TCArknight
Well-known member
I've got a feat that lets you choose two of 4 Craft skills.
How can I implement this? All I see is feats with one chooser....
How can I implement this? All I see is feats with one chooser....
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.
<thing id="fBuilder" name="Builder" description="{b}Benefit{/b}: +2 bonus for 2 of 4 Craft skills" compset="Feat" uniqueness="useronce">
<usesource source="srcD20Mod"/>
<tag group="fCategory" tag="General" name="General" abbrev="General"/>
<bootstrap thing="fChsBld1"></bootstrap>
<bootstrap thing="fChsBld2"></bootstrap>
<eval phase="PreLevel" priority="5000"><![CDATA[
~ If we're disabled, do nothing
doneif (tagis[Helper.FtDisable] <> 0)
~#skillbonus[choice 1] += 2
~#skillbonus[choice 2] += 2]]></eval>
</thing>
<thing id="fChsBld1" name="Builder - First Choice" compset="Feat">
<fieldval field="ftCandExpr" value="thingid.kCraftChem|thingid.kCraftElec|thingid.kCraftMech|thingid.kCraftStru"/>
<usesource source="srcD20Mod"/>
<tag group="fCategory" tag="featHelp" name="Helper Feat"/>
<tag group="Helper" tag="Helper"/>
</thing>
<thing id="fChsBld2" name="Builder - Second Choice" compset="Feat">
<fieldval field="ftCandExpr" value="thingid.kCraftChem|thingid.kCraftElec|thingid.kCraftMech|thingid.kCraftStru"/>
<usesource source="srcD20Mod"/>
<tag group="fCategory" tag="featHelp" name="Helper Feat"/>
<tag group="Helper" tag="Helper"/>
</thing>
if (state.isoutput <> 0) then
perform assign[Helper.FtHide]
endif
<eval phase="PreLevel" priority="5000"><![CDATA[
~ If we're disabled, do nothing
doneif (tagis[Helper.FtDisable] <> 0)
~if the user hasn't selected both classes to apply this feat to,
~there's nothing more we can do, so just get out
doneif (hero.child[fChsEdu1].field[fChosen].ischosen = 0)
doneif (hero.child[fChsEdu2].field[fChosen].ischosen = 0)
~get the chosen skill names and store it in a variable
var Choice1 as string
var C1Len as number
Choice1 = hero.child[fChsEdu1].field[fChosen].chosen.field[name].text
C1Len = length(Choice1) - 11
Choice1 = right(Choice1,C1Len)
var Choice2 as string
var C2Len as number
Choice2 = hero.child[fChsEdu2].field[fChosen].chosen.field[name].text
C2Len = length(Choice2) - 11
Choice2 = right(Choice2,C2Len)
~#skillbonus[hero.child[fChsEdu2].field[fChosen].chosen.thingid] += 2
~#skillbonus[] += 2
~ Set our name properly
field[livename].text = field[name].text & " - " & Choice1 & ", " & Choice2
var result as number
result = hero.child[fChsEdu1].delete[Helper.Helper]
result = hero.child[fChsEdu1].assign[Helper.FtHide]
result = hero.child[fChsEdu2].delete[Helper.Helper]
result = hero.child[fChsEdu2].assign[Helper.FtHide]
]]></eval>
<thing id="fEducated" name="Educated" description="{b}Benefit{/b}: +2 bonus for 2 Knowledge skills" compset="Feat" uniqueness="useronce">
<usesource source="srcD20Mod"/>
<tag group="fCategory" tag="General" name="General" abbrev="General"/>
<bootstrap thing="fChsEdu1"></bootstrap>
<bootstrap thing="fChsEdu2"></bootstrap>
<eval phase="PreLevel" priority="5000"><![CDATA[
~ If we're disabled, do nothing
doneif (tagis[Helper.FtDisable] <> 0)
~if the user hasn't selected both classes to apply this feat to,
~there's nothing more we can do, so just get out
doneif (hero.child[fChsEdu1].field[fChosen].ischosen = 0)
doneif (hero.child[fChsEdu2].field[fChosen].ischosen = 0)
~get the chosen skill names and store it in a variable
var Choice1 as string
var C1Len as number
var C1thing as string
Choice1 = hero.child[fChsEdu1].field[fChosen].chosen.field[name].text
C1Len = length(Choice1) - 11
Choice1 = right(Choice1,C1Len)
C1thing = hero.child[fChsEdu1].field[fChosen].chosen.idstring
var Choice2 as string
var C2Len as number
var C2thing as string
Choice2 = hero.child[fChsEdu2].field[fChosen].chosen.field[name].text
C2Len = length(Choice2) - 11
Choice2 = right(Choice2,C2Len)
C2thing = hero.child[fChsEdu2].field[fChosen].chosen.idstring
~notify C2thing
~ Loop through all skills
var result1 as number
var result2 as number
foreach pick in hero where "component.BaseSkill"
result1 = compare(eachpick.idstring,C1thing)
result2 = compare(eachpick.idstring,C2thing)
if (result1 = 0) then
eachpick.field[Bonus].value += 2
endif
if (result2 = 0) then
eachpick.field[Bonus].value += 2
endif
nexteach
~ Set our name properly
field[livename].text = field[name].text & " - " & Choice1 & ", " & Choice2
var result as number
result = hero.child[fChsEdu1].assign[Helper.FtHide]
result = hero.child[fChsEdu2].assign[Helper.FtHide]
]]></eval>
</thing>
<thing id="fChsEdu1" name="Educated - First Choice" compset="Feat">
<fieldval field="ftCandExpr" value="thingid.kKnow?"/>
<usesource source="srcD20Mod"/>
<tag group="Helper" tag="Helper"/>
</thing>
<thing id="fChsEdu2" name="Educated - Second Choice" compset="Feat">
<fieldval field="ftCandExpr" value="thingid.kKnow?"/>
<usesource source="srcD20Mod"/>
<tag group="Helper" tag="Helper"/>
</thing>
<eval phase="PreLevel" priority="4500"><![CDATA[
~ If we're disabled, do nothing
doneif (tagis[Helper.FtDisable] <> 0)
call fTargetFoc
doneif (state.isfocus = 0)
~ Add 2 to our chosen skill
focus.field[Bonus].value += 2
~ Set our 'short name'
field[fShortName].text = "Focus: " & focus.field[name].text
~Add our name to our livename
field[livename].text = field[name].text & " - " & focus.field[name].text ]]></eval>
<eval index="1" phase="PreLevel" priority="5500"><![CDATA[
~get our list of things to select from from our root
if (isroot <> 0) then
field[fCandExpr].text = root.field[fCandExpr].text
endif
]]></eval>
<eval index="2" phase="PreLevel" priority="5000"><![CDATA[
~ If we're disabled, do nothing
doneif (tagis[Helper.FtDisable] <> 0)
~construct our name from our parent's name
if (isroot <> 0) then
field[livename].text = root.field[name].text & " Helper"
endif
call fTargetFoc
doneif (state.isfocus = 0)
~ Add 2 to our chosen skill
focus.field[Bonus].value += 2
~ Set our 'short name'
field[fShortName].text = "Focus: " & focus.field[name].text
~Add our name to our root
if (isroot <> 0) then
root.field[livename].text &= ", " & focus.field[name].text
endif
~don't show us when printed
if (state.isoutput <> 0) then
perform assign[Helper.FtHide]
endif
]]></eval>
Attempt to access pick information or behaviors for read-only thing 'kCraftElec'
Location: Procedure 'fTargetFoc' near line 6