Lone Wolf Development Forums  

Go Back   Lone Wolf Development Forums > Hero Lab Forums > HL - d20 System
Register FAQ Community Today's Posts Search

Notices

Reply
 
Thread Tools Display Modes
Sevisin
Member
 
Join Date: Oct 2013
Posts: 79

Old December 18th, 2014, 07:54 PM
This is probably going to be the same problem as the issue I posted here but we'll see if there is a possible solution...

Versatile Spellcaster (Races of the Dragon pg.101)
you can use two lower-leve spell slots to cast a spell one level higher.

Here we go again - trying to access the spell list. Any thoughts?

-S
Sevisin is offline   #1 Reply With Quote
Sevisin
Member
 
Join Date: Oct 2013
Posts: 79

Old December 18th, 2014, 09:00 PM
I've been giving this scenario some more thought. I found a Variant Class Ability that adjusts the amount of spells you're able to learn with the following code...

Healing Pool
Code:
      ~ Adjustments via this variant class mechanism fail so hard coding 1 less 4th level cleric spell.
  if (hero.child[cHelpClr].field[cTotalLev].value >= 7) then
    hero.child[cHelpClr].field[cMemMax].arrayvalue[4] -= 1
      if (hero.child[cHelpClr].field[cMemMax].arrayvalue[4] = 0) then
        hero.child[cHelpClr].field[cSecMax].arrayvalue[4] = 0
      endif
  endif
Where you can adjust the level with the variable (as far as I can tell). I'm almost positive the amount and level can be adjusted as well via UI. Initial thought was from the adjustment, but that doesn't seem very feasible. What do you think?
Sevisin is offline   #2 Reply With Quote
TobyFox2002
Senior Member
 
Join Date: Nov 2013
Location: Andover, Ma
Posts: 632

Old December 18th, 2014, 10:07 PM
Yes, there should be a way to select what class and levels that this is attached to, I'm not exactly sure on how to go about doing that though.

This gets into crazy quilt code, that I quickly get lost with, however from what I can see you are on the right track with this. I've never been very good with manipulating the arrays for casting class and I was NOT looking forward to trying to code this. If you can get it working I'll add it to the Races of the Dragon file I am working on for the next release.

+1 Llama/Internetz/Cookie/Muffin Whatever particular fake currency you prefer. You are my savior with this.
TobyFox2002 is offline   #3 Reply With Quote
Sendric
Senior Member
 
Join Date: Jul 2010
Posts: 3,147

Old December 19th, 2014, 05:54 AM
You can put a chooser on the feat to find the class. I would use this custom expression:

Code:
component.BaseClHelp & CasterType.SpontKnow
And Restrict it to Picks on Hero

Then you can get the id of that class with this:

Code:
var class as string
class = field[fChosen].chosen.tagids[thingid.?]
Then you can use that string to change the appropriate field (I would use the CastCur array):

Code:
foreach pick in hero from BaseClHelp where class
 eachpick.field[cCastCur].arrayvalue[1] += 1
nexteach
Note that I am using a foreach loop because I don't know another way. If its possible to use a variable in hero.child then I would do that, but its not. Maybe shadow knows a better way.

I think it I were coding this, I would create a checkbox that lives in the In-Play tab. If checked, whenever you cast a spell, it would do the following:

1) determine level of spell
2) determine level of spell-1
3) subtract 1 from cCastCur array at spell level
4) add 2 to cCastCur array at spell level-1

Last edited by Sendric; December 19th, 2014 at 05:59 AM.
Sendric is online now   #4 Reply With Quote
ShadowChemosh
Senior Member
Volunteer Data File Contributor
 
Join Date: Jan 2010
Location: Chicago, IL (USA)
Posts: 10,729

Old December 20th, 2014, 09:41 AM
Quote:
Originally Posted by Sendric View Post
Code:
foreach pick in hero from BaseClHelp where class
  eachpick.field[cCastCur].arrayvalue[1] += 1
nexteach
Note that I am using a foreach loop because I don't know another way. If its possible to use a variable in hero.child then I would do that, but its not. Maybe shadow knows a better way.
Your answer lies in using "findchild" op code. It does exactly what your looking for here.

Code:
hero.findchild[BaseClHelp,class].field[cCastCur].value += 1
The context is hero.findchild[Component,"Search String"]. The "component" is component set that HL uses like your BaseClHelp or BaseWep. Then next comes the search string which is the same you can/would use in a foreach loop.

Also note that the "search" string is optional. So if you know you only have "one" pick of something you can just do like hero.findchild[BaseRace].xxxxx.

If you need to set "lots" of fields of the findchild[] what you then you do a "setfocus" that creates a permanent pointer to the Pick. Example:
Code:
~ set our focus to the currently equipped shield
perform hero.findchild[BaseArmor,"Helper.CurrShield"].setfocus

~ If we didn't find one get out now
doneif (state.isfocus = 0)
~ Set our bonus to our currently equipped shield bonus
field[abValue].value += focus.field[arAC].value
After you set "focus" you access those focus fields by placing "focus." in front.

That ends today tip and tricks.

Hero Lab Resources:
Pathfinder - d20pfsrd and Pathfinder Pack Setup
3.5 D&D (d20) - Community Server Setup
5E D&D - Community Server Setup
Hero Lab Help - Hero Lab FAQ, Editor Tutorials and Videos, Editor & Scripting Resources.
Created by the community for the community
- Realm Works kickstarter backer (Alpha Wolf) and Beta tester.
- d20 HL package volunteer editor.
ShadowChemosh is offline   #5 Reply With Quote
Sendric
Senior Member
 
Join Date: Jul 2010
Posts: 3,147

Old December 20th, 2014, 10:50 AM
That's extremely helpful. Thanks, Shadow.
Sendric is online now   #6 Reply With Quote
Reply


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 03:26 AM.


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