Lone Wolf Development Forums  

Go Back   Lone Wolf Development Forums > Hero Lab Forums > HL - Pathfinder Roleplaying Game


Thread Tools Display Modes
Join Date: Apr 2018
Location: New York
Posts: 32

Old February 28th, 2023, 08:59 PM
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?
Mediator9292 is offline   #1 Reply With Quote
Senior Member
Join Date: Sep 2013
Location: Vancouver, Canada.
Posts: 804

Old March 2nd, 2023, 04:34 AM
Skeld has a recently bumped thread on modifying Sanity.
Not sure if it helps at all:


There is an adjustment in the Community Package (probably what they're referring to in that thread) for "Horror Adventures, Sanity".

I didn't see any feats or traits that directly change sanity.
Ualaa is offline   #2 Reply With Quote
Join Date: Apr 2018
Location: New York
Posts: 32

Old March 2nd, 2023, 11:38 AM
My questions about some of my Sanity projects are actually why that thread was bumped
Mediator9292 is offline   #3 Reply With Quote
Join Date: Apr 2018
Location: New York
Posts: 32

Old March 7th, 2023, 07:59 PM
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:

       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.
Mediator9292 is offline   #4 Reply With Quote
Senior Member
Join Date: Mar 2013
Location: Melbourne, Australia
Posts: 1,032

Old March 7th, 2023, 09:53 PM
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]

Current RPG's: Pathfinder (GM), Pathfinder (Player), Gamma World (GM, Pathfinder homebrew).
HeroLab: 3.5 & Pathfinder. HL User Files for PF: Greyhawk Setting, Gamma World (WIP).

DM and player of D&D since 1980.
Dami is offline   #5 Reply With Quote
Join Date: Apr 2018
Location: New York
Posts: 32

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.
 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
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
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,137

Old March 8th, 2023, 08:52 AM
round(The number, 0, -1)

will round something to 0 digits beyond the decimal, and the -1 in the third place means round down.
Mathias is offline   #7 Reply With Quote

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 06:24 PM.

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