Senior Member
Join Date: Jan 2007
Location: NW Arkansas
Posts: 1,321
|
I'm back again with something that doesn't seem to be working...
I have a Skill component, and this eval script on the component: Code:
<!-- Update description for each rank3+ with additional info -->
<eval index="5" phase="Traits" priority="10000"><![CDATA[
trustme
var myDesc as string
~if this skill is not added directly to the hero (i.e. an advance), skip it entirely
doneif (field[trtFinal].value <= 2)
if (field[trtFinal].value >= 3) then
myDesc = field[descript].text
myDesc &= "{br}{br}{b}Bonus: {/b}Reroll any single die when you take a Risk with this skill.{br}"
field[descript].text = myDesc
~perform amendthing[descript,myDesc]
endif
]]></eval>
Quote:
Quote:
Code:
<scriptmacro name="appenddesc" param1="thing" param2="append" result="perform state.thing[#thing].amendthing[description,#append & "{br}{br}" & state.thing[#thing].field[descript].text]"/> Code:
#appenddesc[this,myDesc] Code:
Hero Lab was forced to stop compilation after the following errors were detected: Syntax error in 'eval' script for Component 'Skill' (Eval Script '#5') on line 13 -> Non-existent thing 'this' used by script Am I missing something? |
||
#1 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,213
|
If a field is static, trustme will not override that - it only overrides the protections on user fields and persistent fields.
In your original script, you're still in a pick context - you haven't transitioned to state.thing[], and amendthing isn't valid on a pick. state.thing[] must be given an Id. "this" is not a legal option, because it's not the Id of a specific thing - it's a path that leads to a pick context. Amendthing is not just modifying the current pick - you need to modify the thing that this pick is based on. Code:
foreach thing in TheComponent where tagids[thing.?] perform eachthing.amendthing[description,"The Text"] nexteach |
#2 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,213
|
Actually, I'd add a new text field, and then in your mouseinfo procedures, write a standard bit just after where the procedure already adds field[descript].text, so that if that "Additional Information" field is not empty, it adds it to the text that's displayed. Skip the whole amendthing part.
|
#3 |
|
|