Lone Wolf Development Forums  

Go Back   Lone Wolf Development Forums > Hero Lab Forums > HL - Authoring Kit
Register FAQ Community Today's Posts Search

Notices

Reply
 
Thread Tools Display Modes
TCArknight
Senior Member
 
Join Date: Jan 2007
Location: NW Arkansas
Posts: 1,321

Old June 5th, 2016, 04:20 PM
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>
That results in:
Quote:
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 11
-> Only derived fields can generally be modified via scripts (field 'descript')
If i try using the amendthing statement instead, I get this:
Quote:
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 12
-> Script reference is invalid under the circumstances
I created the appenddesc macro based on the posts elsewhere -
Code:
  <scriptmacro
    name="appenddesc"
    param1="thing"
    param2="append"
    result="perform state.thing[#thing].amendthing[description,#append &amp; &quot;{br}{br}&quot; &amp; state.thing[#thing].field[descript].text]"/>
If I try using:
Code:
 #appenddesc[this,myDesc]
it results in
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
I'm at a loss with this, because it seems like the trustme should at least allow me to modify the descript field directly.

Am I missing something?
TCArknight is offline   #1 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,213

Old June 5th, 2016, 07:31 PM
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
should work.
Mathias is offline   #2 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,213

Old June 5th, 2016, 07:32 PM
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.
Mathias is offline   #3 Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 12:14 PM.


Powered by vBulletin® - Copyright ©2000 - 2024, vBulletin Solutions, Inc.
wolflair.com copyright ©1998-2016 Lone Wolf Development, Inc. View our Privacy Policy here.