• 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

Set Min-Max by Race

Kevlyn

Active member
I'm trying to learn how to build a game system and I've been following along in the Savage Worlds, but the game I'm trying to model has minimum/maximum attributes that are racial dependent.

I may be missing the boat, but I'm not exactly sure of how to do this. I know I would want to store the modifiers to the attributes in the race data, and I can add them as variables in the script section. But how do I modify the min/max per attribute, instead of the default behavior that stops all attributes at the min/max values set in traits.str?

Any help getting me started would be awesome!
 
In my thing_races.dat, I defined a race:

Code:
<thing
	  id="racFraal"
	  name="Fraal"
	  compset="Race"
	  isunique="yes"
	  description="Fraal race from core book">
	  <bootstrap thing="skResolve"/>
	  <bootstrap thing="skVehicle"/>
	  <bootstrap thing="skBKnow"/>
	  <bootstrap thing="skAware"/>
	  <bootstrap thing="skInteract"/>
	  <bootstrap thing="abASF"/>
	</thing>

Then, I defined abASF (ability Ability Scores Fraal) as :

Code:
<thing
	  id="abASF"
	  name="Ability Scores Fraal"
	  compset="Ability"
	  isunique="yes"
	  description="Description">
	  <tag group="Hide" tag="Ability"/>
	  <eval index="1" phase="PreTraits" priority="5000">
	    <before name="Calc trtFinal"/><![CDATA[
		hero.child[attrStr].field[trtMinimum].value = 4
		hero.child[attrStr].field[trtMaximum].value = 11
		hero.child[attrDex].field[trtMinimum].value = 4
		hero.child[attrDex].field[trtMaximum].value = 11
		hero.child[attrCon].field[trtMinimum].value = 4
		hero.child[attrCon].field[trtMaximum].value = 10
		hero.child[attrInt].field[trtMinimum].value = 9
		hero.child[attrInt].field[trtMaximum].value = 15
		hero.child[attrWil].field[trtMinimum].value = 9
		hero.child[attrWil].field[trtMaximum].value = 16
		hero.child[attrPer].field[trtMinimum].value = 4
		hero.child[attrPer].field[trtMaximum].value = 15		
		]]></eval>
	</thing>

So, that's how I did it.

edg
 
Glad to help! And I'm glad it did help. I was worried it was too specific to my own project to help you out.

edg
 
Now I'm just not getting anywhere on using the minimums. I've set them as suggested, I've created the bootstrap items for each one. I then commented out the following.

Code:
~field[trtMinimum].value = 1

And changed trtMaximum defvalue to 25, which should be sufficient for now to encompass all the races.

I cannot figure out how to enforce the min/max values, though.
 
If you are using the skeletal files, it will do so automatically, as long as you have set the minimum and maximum.

When the min or max is reached, the thing will get the tag Helper.Minimum or Helper.Maximum. If they have those tags, they can't be improved or advanced.

edg
 
I'm using the skeleton files, and its definitely not stopping me from exceeding racial maximum, I can scale all the way up through the defvalue of 25 and down to 0 again because I commented out the minimum of 1.
 
Do you have this:

Code:
    <!-- If the trait is at its minimum/maximum, assign a tag to preclude further advancements -->
    <eval index="2" phase="Final" priority="5000"><![CDATA[
      ~base our test on the adjusted trait value, sans any in-play adjustments
      var trait as number
      trait = field[trtUser].value + field[trtBonus].value
      if (trait <= field[trtMinimum].value) then
        perform assign[Helper.Minimum]
      elseif (trait >= field[trtMaximum].value) then
        perform assign[Helper.Maximum]
        endif
      ]]></eval>

on your trait?
 
Yeah, its still there. I even went so far, since most of my changes were to a couple of other files (skills, mostly), that I started a new set of data files because I thought maybe I mucked something up. But there's no enforcement of the min/max values I try to bootstrap by race. I'm baffled at this stage, so I'm trying various things to see what I can do.

It's almost like the minimums aren't getting applied.

So, to that end I have the following items:

Code:
  <thing
    id="racHuman"
    name="Human"
    compset="Race"
    isunique="yes"
    description="Be a human.  It's fun.">

    <bootstrap thing="abHuman"/>

    </thing>

And the bootstrap
Code:
  <thing
    id="abHuman"
    name="Human Abilitiy Scores"
    compset="Ability"
    isunique="yes"
    description="Be a human.  It's fun.">
    <tag group="Hide" tag="Ability"/>
    <!-- If the race confers any special abilities, bootstrap them here
    <eval index="1" phase="PreTraits" priority="5000">
      <before name="Calc trtFinal"/><![CDATA[
      	hero.child[attrStr].field[trtMinimum].value = 3
	hero.child[attrStr].field[trtMaximum].value = 18
	hero.child[attrCon].field[trtMinimum].value = 3
	hero.child[attrSiz].field[trtMinimum].value = 8
	hero.child[attrDex].field[trtMinimum].value = 3
	hero.child[attrInt].field[trtMinimum].value = 8
	hero.child[attrPow].field[trtMinimum].value = 3
	hero.child[attrCha].field[trtMinimum].value = 3
      ]]></eval>
    -->

    </thing>
 
Last edited:
aha! I think I might see it.

<!-- and --> are comment delimiters. So, move the --> to after the "bootstrap them here" and see how that works.
 
Yeah, I just figured that out myself. I was reading the comment and that light bulb went off over my head.

Don't I feel sheepish! And works like a charm.
 
I've got all the races in and I've modified the point costs per attribute point and it works well except when changing the race. I can't seem to figure out what to trigger to make the creation points recalculate.

Any guidance here would be welcome, if I can work out where to stick the code, then I'll work out the code that I need.
 
More than likely, it's a timing issue. Those always got me!

When do you calculate the race item? When do you calculate the points per attribute?

I would start by checking those.
 
Okay, I figured out what's going. The minimums are changing and the CPs are being calculated correctly, but when I change races it's not resetting to the minimum so nothing is being recalculated.

So, it's all good it just didn't look that way to me.

Thanks for the input, I learned a lot about timing as a result of this.
 
I have a derived trait that really needs to be displayed as text. I went back through the Savage Worlds files and looked at how they did it for Attributes, but I'm really having a difficult time trying to sort out the text label.
 
I don't because derived traits all use values, not text. I'm trying to figure out how to force a derived trait to use a text field instead of a value field when its displayed.

I've done the initial formula to set the derived trait. But the end result is a bonus die type to damage mod. The range of die types is -1d8 to +2d10+1d4.

I'm setting the trtBonus value to a number, then I'll use if statements to make the conversion to text. I just need to figure out how to output the text instead of the number.
 
I think Hero Lab will do that for you.

For example, I have:

Code:
<portal
      id="ranks"
      style="lblNormal">
      <label>
      <labeltext><![CDATA[
        @text = "[" & field[sklRollO].value & " / " & field[sklRollG].value & " / " & field[sklRollA].value & "]"
        ]]></labeltext>
        
        </label>
    </portal>
I'm just using the value field and it's being set as text.

Is that what you need to do?
 
Last edited:
The output looks like:

Damage Modifier: 1

but I want to render it instead as:

Damage Modifier: -1D8

And I tried adding the <label></label> to the basics tab, under the baTrait portal and it did not like the label at all.
 
Back
Top