RayPrancer
Well-known member
One of the trickest bits of the setting I've been working on is the Learning trait - it's defined as the lower of Memory (attrMem) or Concentration (attrCon). To make matters worse it can be altered from this base up for 1CP or down giving back 1CP.
Ideally I'd also like it to display indented under the Concentration attribute on the Attributes tab, but appreciate that might be a bit beyond my current level of ability.
I also have two traits that default to Concentration and can be raised and lowered in the same way - Focus and Perception, as well as six other traits of this nature relating to other Attributes.
Perhaps it's best if we start with Focus as the example and expand to cover the more difficult Learning trait later. I think I need to add the code to thing_traits.dat - is this right?
If so will the following code work? It's a non-combat ability. Do I need to add any code elsewhere (apart from the eventual code for displaying it as intended on the Abilities tab)?
Although after typing that out it seems like it's simply a matter of nesting the two different calculations that could be used for Learning inside if statements (one if Memory is less than Concentration, the other if it's equal to or greater than because Concentration should be used if tied).
Ideally I'd also like it to display indented under the Concentration attribute on the Attributes tab, but appreciate that might be a bit beyond my current level of ability.
I also have two traits that default to Concentration and can be raised and lowered in the same way - Focus and Perception, as well as six other traits of this nature relating to other Attributes.
Perhaps it's best if we start with Focus as the example and expand to cover the more difficult Learning trait later. I think I need to add the code to thing_traits.dat - is this right?
If so will the following code work? It's a non-combat ability. Do I need to add any code elsewhere (apart from the eventual code for displaying it as intended on the Abilities tab)?
Code:
<thing
id=trFocus
name="Focus"
compset="trait"
isunique="yes"
description="Your ability to concentrate on a single task for an extended period. Defaults to Concentration.">
<eval value="1" phase="Traits" priority="4000">
<before name="Derived trtFinal"/>
<after name="Calc trtFinal"/><![CDATA[
field[trtBonus].value += #trait[attrCon]
]]></eval>
Although after typing that out it seems like it's simply a matter of nesting the two different calculations that could be used for Learning inside if statements (one if Memory is less than Concentration, the other if it's equal to or greater than because Concentration should be used if tied).