• 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

Need some help with a script

ashuramarsh

Well-known member
Hi all,

I am trying to add a class special from the old Conan RPG, working on a dataset for a pathfinder game here, so converting it over more or less. The special ability is called Seductive Art. What it does is at level 2 it adds a +1 to several skills. It does this every 4 levels thereafter as well.

Now I seem to have the bonuses working fine, except that when it adds the bonus it is adding a +2 each time instead of just a +1. What am I doing wrong or not doing?

This is the code i am using:

Code:
var levels as number
levels = #levelcount[temptress]

if (levels >= 2) then
      hero.child[skDiplo].field[BonComp].value += 1
      hero.child[skIntim].field[BonComp].value += 1
      hero.child[AllPerform].field[BonComp].value += 1
      hero.child[skSenseMot].field[BonComp].value += 1
endif

if (levels >= 6) then
      hero.child[skDiplo].field[BonComp].value += 1
      hero.child[skIntim].field[BonComp].value += 1
      hero.child[AllPerform].field[BonComp].value += 1
      hero.child[skSenseMot].field[BonComp].value += 1
endif

if (levels >= 10) then
      hero.child[skDiplo].field[BonComp].value += 1
      hero.child[skIntim].field[BonComp].value += 1
      hero.child[AllPerform].field[BonComp].value += 1
      hero.child[skSenseMot].field[BonComp].value += 1
endif

if (levels >= 14) then
      hero.child[skDiplo].field[BonComp].value += 1
      hero.child[skIntim].field[BonComp].value += 1
      hero.child[AllPerform].field[BonComp].value += 1
      hero.child[skSenseMot].field[BonComp].value += 1
endif

if (levels >= 18) then
      hero.child[skDiplo].field[BonComp].value += 1
      hero.child[skIntim].field[BonComp].value += 1
      hero.child[AllPerform].field[BonComp].value += 1
      hero.child[skSenseMot].field[BonComp].value += 1
endif
 
That script is sort of the "brunt" force approach to doing class abilities.

Use this script which is the same script you will use for 80% of class abilities. It runs at Post-Level/10000. Then you just bootstrap the ability to the class multiple times at the correct levels and each time it increases its bonus by 1.

Way easier to use generic scripts than ones with hard-coded class ids and stuf as it prevents you from ever re-using the class ability with a different class, PrC, or Archetype.

Code:
      ~ Set the list name
      field[listname].text = field[thingname].text & " " & signed(field[xIndex].value)

      ~ If we're not shown, just get out now
      doneif (tagis[Helper.ShowSpec] <> 1)
      ~ if we've been disabled, get out now
      doneif (tagis[Helper.SpcDisable] <> 0)

      ~ Calculate our "plus" here based on level and how many times
      ~ we are bootstrapped to the class.
      field[abValue].value += field[xCount].value
      field[livename].text = field[thingname].text & " " & signed(field[abValue].value)

      ~ The following should only happen once on the first copy
      doneif (tagis[Helper.FirstCopy] = 0)

      hero.child[skDiplo].field[BonComp].value += field[abValue].value
      hero.child[skIntim].field[BonComp].value += field[abValue].value
      hero.child[AllPerform].field[BonComp].value += field[abValue].value
      hero.child[skSenseMot].field[BonComp].value += field[abValue].value
 
OK, thanks. I'm not a programmer so i just take from what i can find and modify as much as I can. I'm not really past brute forcing something to work :D
 
OK, thanks. I'm not a programmer so i just take from what i can find and modify as much as I can. I'm not really past brute forcing something to work :D
Figured why I would share as you can pretty much re-use the top part of that script over and over again.

You just need to change the logic to your specific class ability after this:
Code:
      ~ The following should only happen once on the first copy
      doneif (tagis[Helper.FirstCopy] = 0)

I like script logic that lets me copy/paste 90% of the work. I am lazy. :D
 
Back
Top