Lone Wolf Development Forums

Lone Wolf Development Forums (http://forums.wolflair.com/index.php)
-   HL - Pathfinder Roleplaying Game (http://forums.wolflair.com/forumdisplay.php?f=62)
-   -   Knowledge (Forbidden) & Sanity (http://forums.wolflair.com/showthread.php?t=67666)

Mediator9292 February 28th, 2023 08:59 PM

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

Ualaa March 2nd, 2023 04:34 AM

Skeld has a recently bumped thread on modifying Sanity.
Not sure if it helps at all:

http://forums.wolflair.com/showthread.php?t=58268



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.

Mediator9292 March 2nd, 2023 11:38 AM

My questions about some of my Sanity projects are actually why that thread was bumped :)

Mediator9292 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:

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.

Dami 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]

Mediator9292 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).

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


All times are GMT -8. The time now is 01:53 AM.

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