|
Member
Join Date: Oct 2012
Posts: 37
|
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! |
#1 |
Senior Member
Join Date: Nov 2007
Location: Des Moines, IA
Posts: 349
|
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> 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> edg |
#2 |
Member
Join Date: Oct 2012
Posts: 37
|
I knew you'd probably be the one to reply. Thanks so much for helping me to get going!
|
#3 |
Senior Member
Join Date: Nov 2007
Location: Des Moines, IA
Posts: 349
|
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 |
#4 |
Member
Join Date: Oct 2012
Posts: 37
|
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 I cannot figure out how to enforce the min/max values, though. |
#5 |
Senior Member
Join Date: Nov 2007
Location: Des Moines, IA
Posts: 349
|
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 |
#6 |
Member
Join Date: Oct 2012
Posts: 37
|
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.
|
#7 |
Senior Member
Join Date: Nov 2007
Location: Des Moines, IA
Posts: 349
|
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> |
#8 |
Member
Join Date: Oct 2012
Posts: 37
|
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> 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 by Kevlyn; February 23rd, 2013 at 07:40 AM. Reason: Adding the bootstrap |
#9 |
Senior Member
Join Date: Nov 2007
Location: Des Moines, IA
Posts: 349
|
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. |
#10 |
|
|