View Single Post
Mediator9292
Member
 
Join Date: Apr 2018
Location: New York
Posts: 45

Old March 8th, 2023, 08:42 AM
That worked! Thank you! You're a genius!

As an aside, I've gotten a subsequent piece of code working now that also utilizes this, but it feels overly large and clunky. For every 5 ranks you have in Knowledge (Occult), you gain a +1 bonus to Knowledge (Mythos) and take a -1 penalty to your Sanity score.
Code:
 if (#skillranks[skKnowOcc] >= 20) then
        #skillbonus[skKnowMyt] += 4
        herofield[tSanity].value -= 4
  elseif (#skillranks[skKnowOcc] >= 15) then
         #skillbonus[skKnowMyt] += 3
         herofield[tSanity].value -= 3
  elseif (#skillranks[skKnowOcc] >= 10) then
         #skillbonus[skKnowMyt] += 2
         herofield[tSanity].value -= 2
  elseif (#skillranks[skKnowOcc] >= 5) then
         #skillbonus[skKnowMyt] += 1
         herofield[tSanity].value -= 1
        endif
Is there a way to streamline this? It seems to work just fine, which I'm very proud of as a newbie to all this, but I'm just wondering if it's sustainable to have this code run for several different skills (Arcana, Dungeoneering, Nature, Planes, and Religion).
Mediator9292 is offline   #6 Reply With Quote