Lone Wolf Development Forums  

Go Back   Lone Wolf Development Forums > Hero Lab Forums > HL - Savage Worlds

Notices

Reply
 
Thread Tools Display Modes
Gumbytie
Senior Member
 
Join Date: Jun 2010
Location: Florida
Posts: 169

Old December 18th, 2018, 12:51 PM
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.
Gumbytie is offline   #1 Reply With Quote
zarlor
Senior Member
 
Join Date: Nov 2010
Location: Metairie, LA, USA
Posts: 1,781

Old 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.

Lenny Zimmermann
Metairie, LA, USA

Data files authored (please let me know if you see any issues with any of these if you have/use them):
Official (In the downloader)
50 Fathoms, Deadlands: Hell On Earth, Deadlands: Noir, East Texas University, Necessary Evil (requires Super Powers Companion), Pirates of the Spanish Main, Space 1889 (original file by Erich), Tour of Darkness, Weird War II, Weird Wars: Rome
Coming Eventually
Evernight (LWD has completed their review but I have some fixes to make first... although Pinnacle mentioned this might get an overhaul to SWADE so I may just wait for that first. If you just HAVE to have this now, though, just PM me)
zarlor is offline   #2 Reply With Quote
Gumbytie
Senior Member
 
Join Date: Jun 2010
Location: Florida
Posts: 169

Old 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
Gumbytie is offline   #3 Reply With Quote
CapedCrusader
Senior Member
Volunteer Data File Contributor
 
Join Date: Aug 2009
Posts: 1,276

Old 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

_
Currently Running: Savage Grimnoir, Savage Galaxy Rangers
Currently Playing: Pathfinder 2 Test, Savage Wearing the Cape
Setting Files: Deadlands: Reloaded, Flash Gordon, Gaslight, Interface Zero 2.0, Slipstream, Solomon Kane
CapedCrusader is offline   #4 Reply With Quote
TCArknight
Senior Member
 
Join Date: Jan 2007
Location: NW Arkansas
Posts: 1,088

Old 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...

Working on -
TCArknight is offline   #5 Reply With Quote
CapedCrusader
Senior Member
Volunteer Data File Contributor
 
Join Date: Aug 2009
Posts: 1,276

Old December 19th, 2018, 04:21 PM
Oops, right - that should be trtNoStack, not trtRoll.

_
Currently Running: Savage Grimnoir, Savage Galaxy Rangers
Currently Playing: Pathfinder 2 Test, Savage Wearing the Cape
Setting Files: Deadlands: Reloaded, Flash Gordon, Gaslight, Interface Zero 2.0, Slipstream, Solomon Kane
CapedCrusader is offline   #6 Reply With Quote
Gumbytie
Senior Member
 
Join Date: Jun 2010
Location: Florida
Posts: 169

Old 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!
Gumbytie is offline   #7 Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 04:25 AM.


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