Lone Wolf Development Forums  

Go Back   Lone Wolf Development Forums > Hero Lab Forums > HL - Authoring Kit

Notices

Reply
 
Thread Tools Display Modes
royalfa
Member
 
Join Date: Feb 2011
Posts: 37

Old January 6th, 2012, 07:31 PM
I need to set a racial bonus for every race in the game, some are fixed some are chosen by the user.

I navigate in the 4e source files and find a "macro" to do this.

Here is my Race component in components.core

Code:
<!-- Race component
        Each race derives from this component
  -->
  <component
    id="Race"
    name="Race"
    autocompset="no">
	
    <field
      id="racStr"
      name="Strength Bonus"
      type="static">
      </field>
    <field
      id="racDex"
      name="Dexterity Bonus"
      type="static">
      </field>
    <field
      id="racCon"
      name="Constitution Bonus"
      type="static">
      </field>
    <field
      id="racInt"
      name="Intelligence Bonus"
      type="static">
      </field>
    <field
      id="racWis"
      name="Wisdom Bonus"
      type="static">
      </field>
    <field
      id="racCha"
      name="Charisma Bonus"
      type="static">
      </field>

    <!-- Each race needs its own identity tag to configure the hero appropriately -->
    <identity group="Race"/>
	
	<!-- Also a tag to use to note that certain things (e.g. feats) require
        certain races -->
    <identity group="ReqRace"/>

    <!-- Track the race on the actor by assigning the appropriate tag -->
    <eval index="1" phase="Setup" priority="5000"><![CDATA[
      perform forward[Race.?]
	  
	  ~ Add appropriate bonuses
      #traitmodify[attrStr,trtBonus,field[racStr].value,""]
      #traitmodify[attrDex,trtRacial,field[racDex].value,""]
      #traitmodify[attrCon,trtRacial,field[racCon].value,""]
      #traitmodify[attrInt,trtRacial,field[racInt].value,""]
      #traitmodify[attrWis,trtRacial,field[racWis].value,""]
      #traitmodify[attrCha,trtRacial,field[racCha].value,""]
	  
      ]]></eval>

    </component>
I add the six racXXX fields and the macros then I change the code in traits.str adding this field

Code:
<field
      id="trtRacial"
      name="Racial Bonus"
      type="derived"
      history="best"
      maxfinal="25">
      <finalize><![CDATA[
        if (@value = 0) then
          @text = "-"
          done
          endif
        @text = signed(@value)
        ]]></finalize>
      </field>
In the trait componet.

At the end I add this: + field[trtRacial].value

to the trtFinal and trtDerived fields evals.

When run the game this message pop up:

syntax error in "eval" script for component "Race" (Eval script '#1') on line 5
->unspecified error parsing script.

Don't know what I'm doing wrong.

PS: I modify the editor accordingly to capture the race bonus.
royalfa is offline   #1 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,207

Old January 6th, 2012, 08:19 PM
Add

Code:
perform
before each of your #traitmodify[] lines.

Code:
 
perform #traitmodify[attrStr,trtRacial,field[racStr].value,""]
(I also noticed that you're modifying a different field on Str than on any other attribute).
Mathias is offline   #2 Reply With Quote
royalfa
Member
 
Join Date: Feb 2011
Posts: 37

Old January 7th, 2012, 09:41 PM
I was doing the testing with perform and a new error was pop up.

(I was "testing" if the trtRacial was the trouble but it wasn't that's why Str has trtBonus instead)

Finally it works. The definition file in the game system don't have this macro defined
(I think this was by default of the program) moreover I kind of intuit that this was the problem but yesterday don't find where this macro is defined.

Thanks again Mathias.

I will test this feature and try to add movement (only for race) and saving throws now.
royalfa is offline   #3 Reply With Quote
Reply

Thread Tools
Display Modes

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 07:58 PM.


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