• 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

Request: Inner workings of LycanAttr and LycanForm

frumple

Well-known member
Could one of the developers chime in on how the calls LycanAttr and LycanForm work?

I am trying to understand how the attributes for Hybrid and Animal forms are calculated so I can write some scripts that effect them through adjustments.

Thanks!
 
When you "call" something, it brings up a bit of code called a procedure and inserts it where the call is. Here is the content of the two procedures you asked about.

LycanAttr
Code:
    var v_strbonus as number
    var v_dexbonus as number
    var v_conbonus as number
    var v_intbonus as number
    var v_wisbonus as number
    var v_chabonus as number

   ~all lycanthropes have WIS + 2 and CHA - 2, so modify the animal stats
   ~that have been set to incorpoorate these
   v_wisbonus += 2
   v_chabonus -= 2

    ~ Get what form we're in from our bootstrapped charge
    var isanimal as number
    var ishybrid as number
    if (hero.tagis[Hero.LyHybrid] <> 0) then
      isanimal = 1
    elseif (hero.tagis[Hero.LyAnimal] <> 0) then
      ishybrid = 1
      endif

    ~ In either form:
    if (isanimal + ishybrid <> 0) then

      ~ Apply ability bonuses
      ~each bonus is the difference between our modified value and the current value,
      ~not allowing this to go negative (since we get the better of the two values)

      ~str and con get an additional +2 after this is figured

      v_strbonus = maximum(v_strbonus + 10 - hero.child[aSTR].field[aUser].value, 0) + 2
      v_dexbonus = maximum(v_dexbonus + 10 - hero.child[aDEX].field[aUser].value, 0)
      v_conbonus = maximum(v_conbonus + 10 - hero.child[aCON].field[aUser].value, 0) + 2
      v_intbonus = maximum(v_intbonus + 10 - hero.child[aINT].field[aUser].value, 0)
      v_wisbonus = maximum(v_wisbonus + 10 - hero.child[aWIS].field[aUser].value, 0)
      v_chabonus = maximum(v_chabonus + 10 - hero.child[aCHA].field[aUser].value, 0)

      ~add the calculated bonuses
      hero.child[aSTR].field[aPostMod].value += v_strbonus
      hero.child[aDEX].field[aPostMod].value += v_dexbonus
      hero.child[aCON].field[aPostMod].value += v_conbonus
      hero.child[aINT].field[aPostMod].value += v_intbonus
      hero.child[aWIS].field[aPostMod].value += v_wisbonus
      hero.child[aCHA].field[aPostMod].value += v_chabonus

      ~ We don't get extra hit points from our increased constitution, so
      ~ decrease our hit points appropriately
      ~var bonushp as number
      ~bonushp = v_conbonus / 2
      ~bonushp = round(bonushp, 0, -1) * (hero.tagcount[Hero.HitDice] - field[tmHitDice].value)
      ~herofield[tHP].value -= bonushp
      endif

LycanForm
Code:
    var v_animsize as number
    var v_animnat as number
    var v_animspd as number

    ~ Get what form we're in from our bootstrapped charge
    var isanimal as number
    var ishybrid as number
    if (hero.tagis[Hero.LyHybrid] <> 0) then
      ishybrid = 1
    elseif (hero.tagis[Hero.LyAnimal] <> 0) then
      isanimal = 1
      endif

    ~ In either form:
    if (isanimal + ishybrid <> 0) then
      ~ We get DR5/silver (10/silver if a natural lycanthrope)
      var dr as number
      if (tagis[TemplHelp.Inherited] <> 0) then
        dr = 10
      else
        dr = 5
        endif
      #applydr[xDamRdSil,dr]
      endif

    ~ In hybrid form:
    if (ishybrid <> 0) then

      ~ If our natural armor bonus is better than the current, use it
      hero.child[mNatural].field[arAC].value = maximum(hero.child[mNatural].field[arAC].value, v_animnat + 2)

      ~ Our size changes to that of the animal, if it's larger
      if (herofield[tSize].value < v_animsize) then
        herofield[tSize].value = v_animsize
        endif

    ~ In animal form:
    elseif (isanimal <> 0) then

      ~ Use our animal' natural AC bonus
      hero.child[mNatural].field[arAC].value = v_animnat + 2

      ~ Use our animal's speed
      hero.child[Speed].field[tSpeed].value = v_animspd

      ~ Our size changes to that of the animal
      herofield[tSize].value = v_animsize

      ~animals don't have hands
      herofield[tNumHands].value = 0
      endif

Keep in mind that these are subject to future change, if we need to adjust them, so it'd be best if you stuck with the calls rather than designing your own.
 
Last edited:
Thanks! I am going to stick with the calls, but I want to code up and adjustment that allows the user to change a lycanthrope's ability scores when in hybrid or animal form. Right now they are hard coded into the template and there looks to be no way to adjust them.
 
Thank you! This is something that has had me stumped since I started trying to input alternate lycanthrope templates!

Many thanks!
 
(Arise dead thread)

Okay, I'm confused with two things.

One:

I am trying to make my own lycanthrope, a werefalcon. As a base, they get -2 STR, but +2 DEX and WIS. That works. The problem is the code below that is in an eval script.

I am using this code at various timing points. (I did notice that if I do this post-attributes, that it doesn't seem to do anything except add asterisks to the attributes.)

What I'm trying to do is give them more boosts to DEX and WIS at higher levels due to being a Werefalcon. However, the code doesn't work as I think it should work. It applies the WIS bonus (again, at Attribute timing or earlier) but not the DEX bonus? I don't know why?

Code:
~ Set up our changing statistics
      var v_strbonus as number
      var v_dexbonus as number
      var v_conbonus as number
      var v_intbonus as number
      var v_wisbonus as number
      var v_chabonus as number
if (#totallevelcount[] > 18) then
      ~ Ability bonuses
      v_strbonus = 0
      v_dexbonus = 6
      v_conbonus = 0
      v_intbonus = 0
      v_wisbonus = 4
      v_chabonus = 0
elseif (#totallevelcount[] > 12) then
~ Ability bonuses
      v_strbonus = 0
      v_dexbonus = 4
      v_conbonus = 0
      v_intbonus = 0
      v_wisbonus = 4
      v_chabonus = 0
elseif (#totallevelcount[] > 8) then
~ Ability bonuses
      v_strbonus = 0
      v_dexbonus = 4
      v_conbonus = 0
      v_intbonus = 0
      v_wisbonus = 2
      v_chabonus = 0
elseif (#totallevelcount[] > 4) then
~ Ability bonuses
      v_strbonus = 0
      v_dexbonus = 4
      v_conbonus = 0
      v_intbonus = 0
      v_wisbonus = 2
      v_chabonus = 0
else
~ Ability bonuses
      v_strbonus = 0
      v_dexbonus = 0
      v_conbonus = 0
      v_intbonus = 0
      v_wisbonus = 0
      v_chabonus = 0
endif
      ~ Make all changes appropriately
      call LycanAttr

Two:

I don't like the default bonuses that Paizo has assigned to lycanthrope, namely the WIS and CHA stuff. How do I remove those changes from the template?

Do I just need to copy the LycanAttr code from below into it and adjust it all here on my own?

Thanks.

edg
 
Instead of calling the procedure, why don't you just use it's code as the basis for your own eval script which works differently, as you like?
 
Instead of calling the procedure, why don't you just use it's code as the basis for your own eval script which works differently, as you like?

Yeah, that's what I figured I should do. It just took me thinking about it after posting. Sorry.

Thanks for the reply!

edg
 
Have there been any changes to the base call code? And, what file is it contained in. I would like to create my own version of a call code.
 
Have there been any changes to the base call code? And, what file is it contained in. I would like to create my own version of a call code.
If talking about LycanAttr this is a procedure which allows for code to be written once and used in many places.

To see what this looks like open the editor and go to the General->*Procedure tab and press "New (Copy)". Then search for LycanAttr and you can open it up and even make a new version called something else.

Just one thing I am not 100% sure "Test Now!" works with procedures. You are better off doing a CTRL-R to reload the whole game system.
 
If you do a "Test Now" on a procedure it tells you it's going to reload the system.

Found that out when doing the caster procedures.
 
If you do a "Test Now" on a procedure it tells you it's going to reload the system.

Found that out when doing the caster procedures.
Ahh good to know. I honestly never did a procedure in the editor so I always just reload. Plus procedures are usually allot more code then a normal script and my old eyes can't take the small font same color editor text box for too long.... ;)
 
Small font same color ... and to think I'm thinking about getting a Surface Pro just for portable Hero Lab coding because my laptop is just too big.
 
Back
Top