• 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

Knowledge(Bombardier) d6+ or Piloting d6+ pre-reqs

Blinkey

Member
Hey all,
Doing a data set for Weird Wars II and have a question how best to code the Pickle Barrel Edge.

The requirements for the Edge are: Novice, Knowledge (Bombardier) d6+ or Piloting d6+

This is the code I put in the pre-reqs tab for the Edge and it seems to work well enough. Is there a cleaner way to select a specific Knowledge skill or to do this code block?


var total as number

~ look for the Knowledge(Bombardier) skill
foreach pick in hero where "thingid.skKnow"
~ check to see if it is at at least a d6
if (compare(lowercase(eachpick.field[domDomain].text),"bombardier") = 0) then
if (eachpick.field[trtFinal].value >= 3) then
total += 1
endif
endif
nexteach

~ look for the Piloting skill and see
~ if it is at least a d6
foreach pick in hero where "thingid.skPiloting"
if (eachpick.field[trtFinal].value >= 3) then
total +=1
endif
nexteach

~ if either skill is at a d6 then validate
validif (total >= 1)
if (@ispick <> 0) then
altpick.linkvalid = 0
endif
 
That looks like more than you would probably need at first, but I won't have a good chance to look at it until probably tomorrow. I just wanted to let you know at least somebody has read this and might be able to help (I should be able to, anyway, since I'm going to have to do that myself when I get to that point since I'm also working on this setting.)
 
Ok, I had to use some similar codiing for some of the factions in Necropolis and you are using more code than you need here.

All you'd need is something like this:
Code:
foreach pick in hero where "thingid.skKnow"
  if (compare(lowercase(eachpick.field[domDomain].text),"bombardier") = 0) then
    validif (eachpick.field[trtFinal].value >= 3)
  endif
nexteach
validif (hero.child[skPiloting].field[trtFinal].value >= 3)
if (@ispick <> 0) then
   altpick.linkvalid = 0
endif

There's no need to step through the skills to look for Piloting, there can only be one of them (unlike for Knowledge skill) so you should need to do the picks on it at all. So do a basic step-through to find a Knowledge (Bombardier) and we set this as valid if it finds it. Whether or not if find it it will then next check if Piloting d6 exists and if it does it will also set the flag for this as being valid. No need to double-check the validity with a running total or anything, we just mark the field valid if either or even both conditions exist and you're good to go.
 
Back
Top