• 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 (Forbidden) & Sanity

Mediator9292

Well-known member
In my playthrough of the Strange Aeons AP, we're using the Sanity system, and to make the knowledge the PCs are gaining feel more impactful and dangerous, I'm trying to make a Knowledge (Mythos) skill similar to that seen in the Call of Cthulhu/Delta Green systems, and also present in the variant d20 Sanity system.

Mechanically, I'm trying to make an eval script that codes so that every rank in Knowledge (Mythos) (id skKnoMyth) results in a -1 reduction/penalty to either the Sanity (tSanity) or the Displayed Sanity (tDispSan). The problem is that I have no clue to to do something like that.
Any advice on how to at least get started?
 
Here's what I've been able to piece together as an approximate (yet unstable) eval script, based primarily on the wonderful work of ShadowChemosh's Adjustments:

Code:
       var skRanks as number

       ~each rank in skKnoMyth reduces total Sanity by 1
       herofield[tSanity].value -= skRanks

However, even though the Test Now function says everything is fine, adding ranks into Knowledge (Mythos) does nothing to affect the Sanity. I've also tried changing tSanity to tSanDisp to try and affect the /# instead, to no avail. I thought maybe it should have been #skRanks or skRanks[KnoMyth] instead, but it just kept reporting an error on the right hand side of the assignment.
 
Where are you assigning a value to skRanks? The code above will be subtracting 0 (zero) from Sanity unless something else is giving a value to skRanks.
You need a line something like:
skRanks = #skillranks[skKnoMyth]

or try leaving out the var line entirely, and using:
herofield[tSanity].value -= #skillranks[skKnoMyth]
 
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).
 
round(The number, 0, -1)

will round something to 0 digits beyond the decimal, and the -1 in the third place means round down.
 
Back
Top