• Please note: In an effort to ensure that all of our users feel welcome on our forums, we’ve updated our forum rules. You can review the updated rules here: http://forums.wolflair.com/showthread.php?t=5528.

    If a fellow Community member is not following the forum rules, please report the post by clicking the Report button (the red yield sign on the left) located on every post. This will notify the moderators directly. If you have any questions about these new rules, please contact support@wolflair.com.

    - The Lone Wolf Development Team

Adding variable in text string (evalscript)

peterphonic

Active member
Hello,

In the following script :

#situational[hero.childfound[ArmorClass],"+ wisdom modifier in deflection bonus",field[thingname].text]

I would like to see the exact bonus, instead of "+ wisdom modifier"

Is is possible to add the value of the wisdom modifier directly into my string?

I tried something like :
#situational[hero.childfound[ArmorClass], "+ hero.child[aWIS].field[aBonus].value in deflection bonus", field[thingname].text]

But this does not work indeed!

Thank you
 
First, you appear to just be adding your wisdom mod to a deflection bonus in which case you would do something like

Code:
field[abValue].value += #attrbonus[aWIS]
#applybonus[tACDeflect, hero.child[ArmorClass], field[abValue].value

but to apply it as a situational you would do

Code:
field[abValue].value += #attrbonus[aWIS]

#situational[hero.child[ArmorClass], signed(field[abValue].value) & " in deflection bonus", field[thingname].text]

note how you use the & to combine the value with the string that's in quotes.

timing also needs to be Post-Attributes
 
Last edited:
Back
Top