• 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

Setting a minimum and maximum

Erich

Well-known member
I have created a stat for the Space 1889 files called Social Standing (thanks for the assist zalor), it is supposed to range from 1 to 5.
The upper end is easy enough. There is no combination of Edges (currently) that add more than 3 to the stat.
However at the lower end it is currently possible to take edges that would lower the stat to 0.
Can anyone tell me how to hard code a floor of 1?
I guess a ceiling of 5 would be a good thing to, in case something comes along that could add more than 3 to the base stat of 2.

Thanks
-Erich
 
I wonder if you would have to trap for that in the Eval Scripts that modify it to begin with.So instead of something like:

Code:
perform #traitadjust[trSPSocial,+,2,"I'm Noble!"]

You might need to set up and if statement of check if trSPSocial is already at 4 or 5 and then add 1, none or 2 as appropriate. Same on the bottom end. Maybe I should look at that for the Dominion Trait on HoER, too... hmmm....
 
I'm not sure how to use it, but I also just noticed a couple of Tags that presumably would be of use for this:

Helper.Maximum - When assigned to a trait, this indicates the trait is at its maximum and can no longer be advanced.

Helper.Minimum - When assigned to a trait, this indicates the traits is at its minimum and can no longer be decreased.

I'm still trying to figure out when, how and where to use tags, but that at least give some indication to me that maybe those could be used for setting minimums and maximums on a Derived Trait.
 
I haven't found a way to force a cap yet (outside of the idea that in every item that would modify it you preform the check to make sure you are within the expected value range), but you CAN set a Pre-Requisite Error up so it will at least notify you if you've exceeded the range.

To do that, on your Derived Trait add an Expr-Req. I'll use Dominon from the HoER file for this example. Set a message like "Dominion may not be higher than 4." then for your expression use:
Code:
#trait[trHEDomini] <= 4

Then for the bottom end do the same in reverse, so a message like "Dominion may not be lower than -4." with an expression of:
Code:
#trait[trHEDomini] >= -4
 
Zarlor, you are right about those tags.

You could set up a mechanic, and load it with an eval script that ran at Pre-Traits/5000 or so. In it you could test if the trait were high enough (or low enough) and assign that tag.

Code:
if (#trait[trHEDomini] = 4) then
        perform assign[Helper.Maximum]
        endif

You could solve the floor problem by adding another eval script that ran at Validation/100 or so and if the trait was below a certain value, reset it to the floor value.

Code:
if (#trait[trHEDomini] <= 0) then
        #trait[trHEDomini] = 1
        endif
 
Last edited:
Thanks Cape, I will give them a try, I have found mechanic a great too; for somethings I have been doing - This one was driving me batty.
 
Ok, so for my purposes on the Derived Trait for Dominion I used the #trait[trHEDomini] = -4 (or 4, as the case may be) to set a floor and ceiling value for Dominion now, which means I no longer really even need the error message I mentioned above, so that works well. Since there are no Edges or Hindrances that modify Dominion I didn't use the Helper.Maximum or Minimum tags since, if I read that correctly, that seems to just be a nice holder for what the minimums and maximums on a value should be if I wanted to trap against it? So I could presumably set it with your first example and then use it in the second example by replacing the first line with, say:

Code:
if (#trait[trHEDomini] > hero.tag[Helper.Maximum]
   #trait[trHEDomain] = hero.tag[Helper.Maximum]
endif

Would that be correct or am I just misunderstanding how the tag is used? I don't really need it for Dominion because I'm only ever using the check twice, but it may be useful if I were checking in other places as well (like if I had a bunch of Edges/Hindrances that modified it, which I might use for the Minimum on Fame in Pirates.)
 
The tag just indicates that it's at its maximum. It doesn't contain a value of any kind. If the tag is assigned it isn't allowed to go any higher.

If you want to set floor and ceiling values, you have to use the actual numbers involved.
 
The tag just indicates that it's at its maximum. It doesn't contain a value of any kind. If the tag is assigned it isn't allowed to go any higher.

Ok, then what exactly does that mean it's supposed to do? For example, I put the following into a Mechanic Eval Script (I've also tried this on the Derived Trait) in my HoER file at Validation/100:

Code:
if (#trait[trHEDomini] >= 4) then
   perform assign[Helper.Maximum]
endif

Then I create a portfolio, go to the Personal tab, click on Permanent Adjustment at the bottom, add a Derived Trait, select Dominion then start incrementing it up. But nothing happens. It lets me increment Dominion until the cows come home. No warnings, no capping of the value.

Now if I use the code for the floor that you mentioned (although as a ceiling, in this case) then it stops at 4.

So what is Helper.Maximum supposed to be doing?
 
Nope. Doesn't work there either. It's not a big deal since I can hard cap it with the code already mentioned, but just curious how to get it to work.
 
Back
Top