Lone Wolf Development Forums

Lone Wolf Development Forums (http://forums.wolflair.com/index.php)
-   HL - Savage Worlds (http://forums.wolflair.com/forumdisplay.php?f=59)
-   -   2 knowledge skills, only one gets the bonus (http://forums.wolflair.com/showthread.php?t=61841)

Gumbytie December 18th, 2018 12:51 PM

2 knowledge skills, only one gets the bonus
 
So back into coding things for Beats & Barbarians to name a few.

Have an Edge that should apply a +2 bonus to 2 specific Knowledge Skills. So I have some code, but it only ever applies the bonus to ONE of them. I am a bit code rusty so I am probably just missing something obvious:

Set at Pre-Traits 5000, with Calc trtFinal in apparopriate spot.

Code:

if (field[abilActive].value <> 0) then
~go through all knowledge skills and find an "Arcana" one
foreach pick in hero where "thingid.skKnow"
  if (compare(lowercase(eachpick.field[domDomain].text),"arcana") = 0) then
      perform #traitprof[skKnow,+,2,"Demon Hunter"]
  endif
  if (compare(lowercase(eachpick.field[domDomain].text),"religion") = 0) then
      perform #traitprof[skKnow,+,2,"Demon Hunter"]
  endif
nexteach
endif

It boils down to whichever I happen to purchase first, it ends up with the bonus only.

Even when I separated these into 2 separate Eval scripts same results.

zarlor December 18th, 2018 02:20 PM

By separating you mean something like this?

Code:

if (field[abilActive].value <> 0) then
~go through all knowledge skills and find an "Arcana" one
  foreach pick in hero where "thingid.skKnow"
    if (compare(lowercase(eachpick.field[domDomain].text),"arcana") = 0) then
      perform #traitprof[skKnow,+,2,"Demon Hunter"]
  endif
  nexteach
  foreach pick in hero where "thingid.skKnow"
  if (compare(lowercase(eachpick.field[domDomain].text),"religion") = 0) then
      perform #traitprof[skKnow,+,2,"Demon Hunter"]
  endif
  nexteach
endif

That would be the other way I would think might work. I'm way, way rusty at coding things these days, though. Been a while since I've done a data file.

Gumbytie December 18th, 2018 05:50 PM

Zarlor,

I hear you, 2 years plus away from working in Hero Lab and zero gaming so I am way rusty as well.

Your version of the code is like mine, it only applies the bonus to one of the Knowledge skills, never both. It will apply it to whichever you choose first. Go figure.

I am just trying to finish up Beasts and Barbarians and move onto their Jalizar book and some others. I don't get to game anymore but still own the books and felt like working in Hero Lab again...

I will keep plugging away at this until someone with more recent experience than you and I has a better suggestion :)

CapedCrusader December 19th, 2018 10:42 AM

Ah...
It's the PERFORM. It's operating against the first skKnow it finds. It needs to address the eachpick. Not sure how to code that right off-hand (not at my home computer at the moment). I don't know if you can use the #traitprof, you may need to use:

Code:

eachpick.field[trtRoll].value += 2

TCArknight December 19th, 2018 01:45 PM

Try this to mimic the #traitprof:

Code:

perform eachpick.field[trtNoStack].modify[+,2,"Demon Hunter"]
I think that should work... :)

CapedCrusader December 19th, 2018 04:21 PM

Oops, right - that should be trtNoStack, not trtRoll.

Gumbytie December 21st, 2018 10:55 AM

For some closure for others who might encounter this problem. The solution posted by
TCArknight solved the problem. Thank you very much to all who chime in with solutions. Cheers!


All times are GMT -8. The time now is 02:18 AM.

Powered by vBulletin® - Copyright ©2000 - 2024, vBulletin Solutions, Inc.
wolflair.com copyright ©1998-2016 Lone Wolf Development, Inc. View our Privacy Policy here.