• 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

Combining Macros?

TCArknight

Well-known member
Hi all! I have a eval script using a couple of macros:
Code:
  <scriptmacro
    name="bkgdbonus"
    param1="skill"
    result="hero.child[#skill].field[trtBonus].value += 1"/>
  <scriptmacro
    name="bkgdskill"
    param1="skill"
    result="perform hero.childfound[#skill].assign[User.BgdRank]"/>

<eval phase="PreTraits" priority="500">
     ~Add Background Skills
      #bkgdbonus[skConvince]
      #bkgdskill[skConvince]
           
      </eval>

I came across the {macro name} encoded text entry on the wiki and thought it might be useful to combine both macros into one:
Code:
  <scriptmacro
    name="bkgdsetup"
    param1="skill"
    result="{macro bkgdskill}{br}{macro bkgdbonus}"/>

<eval phase="PreTraits" priority="500">
     ~Add Background Skills
      #bkgdsetup[skConvince]
          
      </eval>

However, when I do it that way, I get:
Code:
Hero Lab was forced to stop compilation after the following errors were detected:

Syntax error in 'eval' script for Thing 'bkDuelist' (Eval Script '#1') on line 2
  -> Unspecified error parsing script

Are there any suggestions or is this even possible? :)
Thanks!
TC
 
Pretty sure macros won't work that way. Also you're not actually using any parameter in your new macro, you have "skill" set but never use #skill anywhere.

Macros generally only do one command. If you want to do it with multiple you could make a procedure that takes some kind of input and then applies it to both statements.
 
Back
Top