View Single Post
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,215

Old February 15th, 2010, 11:24 PM
It is a matter of multiple if statements.

As a prereq, write a requirement for any one of the mindset ranks - just like you did for your other piece of cyberware. When you're still in the list, selecting the trait, you don't know what the trait's level will be, so you can't test that yet.

Once that's done, add an eval rule, as well. Eval rules have all of the functions of an eval script, but they also have the validation requirements that prereqs have. Timing: Validation / 5000 - Put Eval rules at that time unless you have a specific reason not to.

Code:
 
~first, if we're a d12 trait
if (field[trtFinal].value >= 6) then
  ~that requires mindset 3
  validif (hero.childlives[cybMndSet3] <> 0)
 
~if not that, check if we have a d6 - d10 trait
elseif (field[trtFinal].value >= 3) then
  ~that requires mindset 2 or 3
  validif (rank 2 or rank 3)
 
~if we have a lower trait value than that
else
  ~we need any level of the mindset
  validif (rank 1 or rank 2 or rank 3)
  endif
Note that I didn't write out the full code for the tests - don't forget to finish that up when you copy this to your trait.

BTW, validif ( ) is the same as:

if ( ) then
@valid = 1
done
endif

Saves a bit of typing when writing prereqs.
Mathias is offline   #10 Reply With Quote