Member
Join Date: Apr 2018
Location: New York
Posts: 45
|
I'm trying to build an intelligent magic item that utilizes Influence similar to the Medium to unlock stronger abilities (tempting the user to give up more and more control). Most everything is going well, but I can't quite figure out how the syntax is supposed to work in the Condition's Tag Expression (where it says, "Edit Container Requirement Expression").
I'm utilizing First Phase and Priority 400, in case it matters, but the timing is on par with similar triggers like in Scaling Items. Here is what I have drafted for the Tag Expressions. Ideally, different weapon properties and item spells will unlock at higher Influence levels, but for some reason, (field[actUser].value >= # doesn't cut it. Code:
(fieldval:gIsEquip <> 0) & (field[actUser].value >= 9) |
#1 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,217
|
That looks fine. I have a thought on this - is this a common property, like a DR, an energy resistance, a speed, SR, something like one of those? Or is this something new - a unique ability you've created? The bootstrapping method probably isn't best if this is one of the common properties - for those, since all of those picks are already on the hero, regardless of whether this item is turned on or not, just use a script to check actUser, and apply a value to that property if actUser is high enough.
|
#2 |
Member
Join Date: Apr 2018
Location: New York
Posts: 45
|
Quote:
I also have several effects running in various eval scripts that do things like reducing caster level or adding enhancement bonuses to the weapon and even unlocking an Inspired Rage effect that can be activated, but if there's a simple way to just 'unlock' these weapon properties and item spells at different Influence levels without resorting to several more eval scripts, I'd much prefer that if possible. I just can't figure out how to fix the syntax error that keeps popping up whenever I try to use field[actUser].value >= # specifically in the Tag Expression. Last edited by Mediator9292; October 31st, 2023 at 08:19 PM. Reason: just emphasizing the location of the error |
|
#3 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,217
|
No, item powers and spells are all non-unique things.
If there's a syntax error, then please copy and paste it - in Hero Lab, you can right-click pop-up messages to copy the text. I thought I was debugging a thing where everything compiled and ran, but didn't work - if there's an error message, then the source is most likely a typo, so hopefully the error message includes exactly what you wrote for your condition. |
#4 |
Senior Member
Join Date: Jul 2010
Posts: 3,147
|
|
#5 |
Member
Join Date: Apr 2018
Location: New York
Posts: 45
|
Quote:
Now the difficulty is getting it to work for the weapon powers. I tried using it for iBane, iHoly, iKeen, and got the following error: Quote:
|
||
#6 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,217
|
Ignore the timing report line - once the other failure happened, the timing report failed to generate.
Hero Lab reports errors as it encounters them, so always start from the top when fixing things, because later errors may be cascades from the initial failure. |
#7 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,217
|
So, let's see the full info on this bootstrap of iGoldnsong. So far, there's not enough information to know what's going wrong. I'd recommend opening the .user file in a text editor, and copying this particular item's code.
|
#8 |
Member
Join Date: Apr 2018
Location: New York
Posts: 45
|
Quote:
Code:
<thing id="iGoldnsong" name="Goldensong" description="{b}Alignment{/b} CG; {b}Ego{/b} 20\n{b}Senses{/b} 30 ft.\n{b}Int{/b} 16, {b}Wis{/b} 12, {b}Cha{/b} 18 \n{b}Communication{/b} empathy, telepathy (with wielder)\n\nGoldensong is a {i}+1 greatsword{/i} that ostensibly carries the soul of the lost Linnorm Prince, Sven Goldensong. Due to the mysterious circumstances surrounding his binding, Goldensong is able to utilize some of his former abilities despite lacking a true body, and can aid its wielder even more - assuming they are willing to give up more and more control over their body. The wielder gains the {i}Possessed{i} Corruption, but can withstand up to 10 points of Influence instead of the normal 5 - though the amount of Influence decreases by 1 after a night’s rest instead of resetting completely. Each point of Influence adds +1 to Goldensong’s Ego, effectively increasing the Will save DC that the wielder must resist each morning to prevent losing temporary control to Goldensong.\n\n{i}Goldensong{/i} can cast {i}Mage Hand{i} at will, and {i}Unseen Servant{/i} three times per day. \nAt Influence level 1, Goldensong can cast {i}Mirror Strike{i} on the wielder on command 3/day. \nAt Influence Level 3, the same can be done with {i}Mirror Image{/i} 1/day, though half of the images generated this way tend to take on the former appearance of the Linnorm Prince himself. \nAt Influence Level 5, …\nAt Influence 7, Goldensong can expend 1 use of its daily Legendary Power to be able to speak or sing out loud for 1 minute. If it so desires, it can grant the wielder and all allies within earshot the benefits of the Skald's Inspired Rage ability, with an effective skald level of 9.\nAt Influence 9, …\n\nFor every 2 points of Influence the wielder yields to Goldensong, the weapon gains an additional +1 enhancement bonus (up to +5 at Influence 8). At Influence 10, …\n\nWhile made of spiresteel, {i}Goldensong{/i} is treated as if it was also made of cold iron for the purpose of penetrating damage reduction. While {i}Goldensong{/i} was forged as a greatsword and reverts to this shape when no one wields it, when held in the hand, the sword immediately transforms into the type of blade its owner is most proficient with (choosing from dagger, short sword, longsword, scimitar, falchion, greatsword, rapier, or katana).\n\nAlthough {i}Goldensong{/i} is chaotic good, as long as its wielder is dedicated to the defeat, however temporary, of Those Who Remain and those under their sway, the sword does not attempt to seize control of its wielder. If its wielder does go against its wishes, {i}Goldensong{/i} tries to force him to relinquish the blade to a more appropriate wielder. As with all holy weapons, {i}Goldensong{/i} imposes 1 negative level on any evil creature attempting to wield it. The negative level remains as long as the creature holds the weapon in its hand and disappears when the weapon is no longer wielded. A worshiper of any Outer God or Great Old One who wields {i}Goldensong{/i} takes 4 negative levels and is nauseated as long as these negative levels persist. The negative levels and any additional side effects cannot be overcome in any way (including by {i}restoration{/i} spells) while the weapon is wielded.\n\n{b}Destruction{/b}\n{i}Goldensong{/i} can be destroyed only if used to directly facilitate the destructive emergence or alignment of an Outer God." compset="MagicWep" summary="A powerful weapon against Those Who Remain."> <fieldval field="gWeight" value="5"/> <fieldval field="sbName" value="{i}Goldensong{/b}"/> <fieldval field="iCL" value="20"/> <fieldval field="actIncrNam" value="Influence"/> <fieldval field="actUserMin" value="0"/> <fieldval field="actUserMax" value="10"/> <fieldval field="actName" value="Inspired Rage (1 Legendary Power, 8 rds)"/> <fieldval field="BonEnhance" value="1"/> <arrayval field="usrArray" index="6" value="Scimitar"/> <arrayval field="usrArray" index="7" value="Short sword"/> <arrayval field="usrArray" index="0" value="Bastard sword"/> <arrayval field="usrArray" index="1" value="Dagger"/> <arrayval field="usrArray" index="2" value="Flachion"/> <arrayval field="usrArray" index="3" value="Greatsword"/> <arrayval field="usrArray" index="4" value="Longsword"/> <arrayval field="usrArray" index="5" value="Rapier"/> <usesource source="Alastair2018"/> <usesource source="PathCurse" parent="PathAdvent" name="Curse of the Crimson Throne"/> <usesource source="CSArtifLeg" parent="CSHeader" name="Artifacts & Legends"/> <tag group="iSchool" tag="Universal" name="Universal" abbrev="Universal"/> <tag group="Helper" tag="LegendItem" name="Legendary Item" abbrev="Legendary Item"/> <tag group="User" tag="Activation" name="Activation" abbrev="Activation"/> <tag group="Helper" tag="ActivMenu" name="ActivMenu" abbrev="ActivMenu"/> <tag group="Helper" tag="NoPathSoc" name="Not Allowed for Pathfinder Society Characters" abbrev="Not Allowed for Pathfinder Society Characters"/> <tag group="Helper" tag="Proficient" name="Proficient" abbrev="Proficient"/> <tag group="User" tag="NoAutoName" name="NoAutoName" abbrev="NoAutoName"/> <tag group="Helper" tag="UserAdjust"/> <tag group="Helper" tag="ArtiMajor" name="Artifact (Major)" abbrev="Artifact"/> <tag group="Helper" tag="NoOutGear" name="NoOutGear" abbrev="NoOutGear"/> <bootstrap thing="spMageHan0"> <autotag group="Helper" tag="ItemSpell"/> <autotag group="Usage" tag="AtWill"/> </bootstrap> <bootstrap thing="spUnseSer1"> <autotag group="Helper" tag="ItemSpell"/> <autotag group="Usage" tag="Day"/> <autotag group="Activated" tag="iGoldnsong"/> <autotag group="Helper" tag="StaffSpell"/> <assignval field="trkMax" value="3"/> </bootstrap> <bootstrap thing="spMirrStr1"> <containerreq phase="First" priority="400"><![CDATA[(fieldval:gIsEquip <> 0) & (fieldval:actUser >= 1)]]></containerreq> <autotag group="Usage" tag="Day"/> <autotag group="Helper" tag="ItemSpell"/> <autotag group="Activated" tag="iGoldnsong"/> <autotag group="Helper" tag="StaffSpell"/> <assignval field="trkMax" value="3"/> </bootstrap> <bootstrap thing="spMirrIma2"> <containerreq phase="First" priority="400"><![CDATA[(fieldval:gIsEquip <> 0) & (fieldval:actUser >= 3)]]></containerreq> <autotag group="Usage" tag="Day"/> <autotag group="Activated" tag="iGoldnsong"/> <autotag group="Helper" tag="StaffSpell"/> <autotag group="Helper" tag="ItemSpell"/> <assignval field="trkMax" value="1"/> </bootstrap> <bootstrap thing="corPossess"></bootstrap> <eval phase="First" priority="700" index="5"><![CDATA[~If Influence is not 7, disable Inspired Rage ability if (field[actUser].value < 7) then perform assign[Helper.ChgDisab1] endif ~Inspired Rage bonuses if (field[abilActive].value <> 0) then #applybonus[BonMorale, hero.child[aSTR], 4] #applybonus[BonMorale, hero.child[aCON], 4] #applybonus[BonMorale, hero.child[svWill], 3] endif]]></eval> <eval phase="PostAttr" priority="25000" index="2"><![CDATA[ var searchexpr as string ~ Create our Activated tag with our Unique ID searchexpr = tagids[Activated.?,"|"] ~ Loop through all the spells with this weapons activated ~ identity tag. foreach pick in hero from BaseSpell where searchexpr eachpick.field[sDCAttr].value += #attrmod[aCHA] nexteach]]></eval> <eval phase="PostAttr" priority="5000" index="6" name="Influence Bonuses"><![CDATA[~Enhancement bonus increase at every even Influence Level if (field[actUser].value >= 8) then field[BonEnhance].value += 4 elseif (field[actUser].value >= 6) then field[BonEnhance].value += 3 elseif (field[actUser].value >= 4) then field[BonEnhance].value += 2 elseif (field[actUser].value >= 2) then field[BonEnhance].value += 1 endif ~Weapon Properties at every odd Influence Level ~Flying property ipFlying ~Holy iHoly ~Bane ~Keen iKeen]]></eval> <eval phase="PostLevel" priority="10000" index="3">~ Our first field stores the Influence bonus. field[abValue].value -= field[actUser].value var influence as number influence = field[actUser].value - 1 field[abValue2].value -= round(influence/2, 0, 1) <after name="Influence Bonus sets abValue"/> </eval> <eval phase="PostAttr" priority="10000" index="4" name="Influence Helper Applies Influence Penalties">doneif (tagis[Helper.SpcDisable] <> 0) doneif (field[actUser].value < 1) perform hero.childfound[abHelpInPe].assign[Helper.ShowStatbl] ~ When Goldensong gains at least 1 points of influence over the wielder, the dual impulses housed within the same body cause the wielder to meld with Goldensong’s consciousness. The resulting muddled sense of self and struggle for control causes the wielder to take a –2 penalty on initiative checks as well as a specific additional penalty listed in each spirit’s entry. However, Goldensong’s mental presence grants the wielder a +4 bonus against possession effects and a +2 bonus on saving throws against mind-affecting effects that are not related to possession. hero.childfound[Initiative].field[Penalty].value -= 2 #situational[hero.childfound[svAll],"+2 bonus vs. mind-affecting or +4 if possession","Influence Effects"] ~ You take a penalty equal to your Influence bonus on Intelligence checks and Intelligence-based skill checks, and to your caster level (to a minimum of caster level 0); as usual, a reduced caster level may render you unable to cast spells. You can’t benefit from effects that increase your caster level. #situational[hero.childfound[aINT], signed(field[abValue].value) & " penalty on ability checks", "Fated Champion Influence Penalty"] ~ If initiative has been changed to be a Int check then we add a penalty to that as well. if (hero.childfound[Initiative].tagis[UseAttr.aINT] <> 0) then hero.childfound[Initiative].field[Penalty].value += field[abValue].value endif foreach pick in hero from BaseSkill where "SkillAbil.aINT" eachpick.field[Penalty].value += field[abValue].value nexteach foreach pick in hero from BaseClHelp eachpick.field[cMagicLev].value += field[abValue].value nexteach</eval> <child entity="wSpecMagic"> <bootstrap thing="wKatana"> <containerreq phase="First" priority="450">fieldval:usrIndex = 0</containerreq> </bootstrap> <bootstrap thing="iHoly"></bootstrap> <bootstrap thing="mSpiresteel"></bootstrap> <bootstrap thing="eColdIron"></bootstrap> <bootstrap thing="wDagger"> <containerreq phase="First" priority="450">fieldval:usrIndex = 1</containerreq> </bootstrap> <bootstrap thing="wFalchion"> <containerreq phase="First" priority="450">fieldval:usrIndex = 2</containerreq> </bootstrap> <bootstrap thing="wGreatswd"> <containerreq phase="First" priority="450">fieldval:usrIndex = 3</containerreq> </bootstrap> <bootstrap thing="wLongsword"> <containerreq phase="First" priority="450">fieldval:usrIndex = 4</containerreq> </bootstrap> <bootstrap thing="wRapier"> <containerreq phase="First" priority="450">fieldval:usrIndex = 5</containerreq> </bootstrap> <bootstrap thing="wScimitar"> <containerreq phase="First" priority="450">fieldval:usrIndex = 6</containerreq> </bootstrap> <bootstrap thing="wShortswd"> <containerreq phase="First" priority="450">fieldval:usrIndex = 7</containerreq> </bootstrap> <bootstrap thing="iKeen"></bootstrap> <bootstrap thing="laIntellig"></bootstrap> <bootstrap thing="iBane"> <assignval field="iCustSpec" value="Those Who Remain"/> </bootstrap> <bootstrap thing="LegItemHlp"></bootstrap> </child> </thing> |
|
#9 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,217
|
<assignval field="iCustSpec" value="Those Who Remain"/>
This is the offending line (I think - I suspect this is a compiling version of your code, not the bugged version with a condition added) - iCustSpec is a user field. You may not set those in a bootstrap if your bootstrap has a condition, so you'll need to add a trusted script to set that text on the pick, under the same conditions that let the power be live. However, that's not really safe - what if your user starts touching that field's text? Making scripts trusted should always be a last resort. I'd make a special, non-purchasable version of the Bane power that is "Bane (Those Who Remain)", where that text is just a permanent addition, and the power doesn't ask the user to customize it, and add that instead. |
#10 |
|
|