Lone Wolf Development Forums

Lone Wolf Development Forums (http://forums.wolflair.com/index.php)
-   HL - D&D 5th Edition SRD (http://forums.wolflair.com/forumdisplay.php?f=89)
-   -   Removing Primary, Secondary, etc. abilities from a class (http://forums.wolflair.com/showthread.php?t=63959)

Fenris447 February 27th, 2020 11:56 AM

Removing Primary, Secondary, etc. abilities from a class
 
I'm making solid progress on the class feature variants.

The absolute biggest issue is the Ranger. The other classes replace one-off class abilities or simply add things, like extra ways to use Bardic Inspiration or swapping the Barbarian's Danger Sense for Survival Instinct.

The Ranger, on the other hand, replaces some of what Hero Lab calls Primary and Quaternary abilities. There is no single Thing called "Natural Explorer" in the files. Instead, there is a Thing for each possible terrain, all of which are labeled as part of the Natural Explorer quaternary ability. The Ranger class itself has a variable that states how many quaternary abilities it can pick from that pool.

So while we can just "turn off" something like Danger Sense, we cannot simply "turn off" Natural Explorer; there's nothing to turn off.

Instead, my idea is to have the new variant ability go and set that quaternary ability variable to 0. By default, the Ranger Class says "I can pick 1 favored terrain right now." The objective is to make it so that if you select the variant Deft Explorer ability, a script on Deft Explorer will go and tell the Ranger Class "no, you can't pick any favored terrain."

In the code for the Ranger, the quaternary abilities are controlled like this:
Code:

    <arrayval field="cCustQuTot" index="0" value="1"/>
    <arrayval field="cCustQuTot" index="5" value="2"/>
    <arrayval field="cCustQuTot" index="9" value="3"/>

The value is how many quaternary abilities can be selected and the index is at what level (0=1st level, 19=20th level). So at level 1, you get 1. Level 6, another, and a third at level 10.

How do we have the Deft Explorer variant ability set this value to zero? I basically just need to understand the script required for this. I've got everything else about it covered...I think.

ShadowChemosh February 27th, 2020 12:04 PM

Code:

~ Manual way
field[cCustQuTot].arrayvalue[0] = 0
field[cCustQuTot].arrayvalue[5] = 0

~ Automated loop way
var iX as number

for iX = 0 to field[tcCustQuTot].arrayrows - 1
  field[cCustQuTot].arrayvalue[iX] = 0
  next


Fenris447 February 27th, 2020 12:17 PM

I could kiss you, sir. So I'm looking at the full manual version being this?

Code:

hero.child[cHelpRgr].field[cCustQuTot].arrayvalue[0] = 0
hero.child[cHelpRgr].field[cCustQuTot].arrayvalue[5] = 0
hero.child[cHelpRgr].field[cCustQuTot].arrayvalue[9] = 0

I'm just getting my feet wet with container transitions in my scripts, so thanks for the assist!

ShadowChemosh February 27th, 2020 12:40 PM

Quote:

Originally Posted by Fenris447 (Post 286426)
I could kiss you, sir. So I'm looking at the full manual version being this?

Correct...

Fenris447 March 4th, 2020 09:01 AM

For posterity's sake, I can confirm this code worked beautifully. I had to play with the timings a bit for the script. I found it worked on the Post-Levels Phase with a timing between 500 and 5000. It might work outside that, but I'm going with what works. Neither Final nor First worked.


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

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