Senior Member
Join Date: Jan 2011
Location: Quebec, QC, Canada
Posts: 464
|
Hello everyone
Can somebody point me to a good example of, or explain to me, how to define a custom menu for a spell adjustment? (I am trying to code the "Contingency" spell adjustment, and I want the user to select from a drop-down containing all of his known spells. This is not in the available menu options in the editor, so I have to define a new tag... and that's where I am stumped, as I can name a new tag but don't know how to "link" spells to it: hence the menu on the character adjustment tells me "nothing to select") Thanks! |
#1 |
Senior Member
Join Date: Oct 2011
Posts: 6,793
|
This is a little counter intuitive.
First, choose your tag you made, it won't actually affect the candidate expression, but the presence/abscence of it is what determines the existence of a selector. Hit the field button, and assign a value of 1 to the "pUsePicks" field. pUsePicks determines if the selector looks at things that are on the hero (Picks), or all things including those not on the hero (Things). Add this eval script at PreLevels 11000 field[pCandExpr].text = "component.BaseSpell & !Helper.MagBoot & !Helper.WizBoot & !Helper.WitBoot" That will set it up to select among all spells, except the 0 level ones that are repeatedly bootstrapped automatically in Magus, Wizard, and Witch spellbooks. |
#2 |
Senior Member
Volunteer Data File Contributor
Join Date: Jan 2010
Location: Chicago, IL (USA)
Posts: 10,729
|
Damn I didn't know this was possible. OMG that opens up allot fun stuff now!
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. |
#3 |
Senior Member
Join Date: Jan 2011
Location: Quebec, QC, Canada
Posts: 464
|
Works very well, thanks a lot!
3 more "little things" so it's "perfect": in the drop down list, many spells appears twice, even three times: is that because they are on the Magus list, the Witch list, and/or the Wizard List? If so, is there a way to limit the list to one listing of each spell? (after all, contingency being strictly a wizard/sorcerer spell, I don't think a multiclass character could use it to set up a witch or magus spell to be contingent) I would think I would have to delete the "!Helper.MagBoot" and "!Helper.WitBoot", while adding a "!Helper.SorcBoot" would include a Sorcerer's known spells, but they would be all listed twice? Then, the spell being used by contingency must be of a spell level no higher than 1/3 the character's caster level, rounded down. Pointers on this? Finally, I tried assigned the ShowSpec helper to the adjustment, so the Contingency shows in the Specials menu; it doesn't work, though at least the program doesn't throw an error for this. Is a workaround possible? Thanks again for all your help? |
#4 |
Senior Member
Join Date: Jan 2011
Location: Quebec, QC, Canada
Posts: 464
|
Removing !Helper.MagBoot and !Helper.WitBoot does not preclude double listings; adding !Helper.SorcBoot does not seem to change the listing...
|
#5 |
Senior Member
Join Date: Oct 2011
Posts: 6,793
|
Could you send me what you've got in the user file? Or anything else odd about the character you are adding this to?
I did test the instructions I gave, and I didn't see the duplicates, so I am unsure where things went wrong here. You could probably limit the level of the spell by adding an incrementer and looking at the value of that. If the chosen spell is higher than you'd allow, then have it throw an error. As far as I know, it's not possible to show an Adjustment on the Specials Tab, but you could make an ability that is bootstrapped by the adjustment to show there. |
#6 |
Senior Member
Join Date: Jan 2011
Location: Quebec, QC, Canada
Posts: 464
|
Quote:
In the supplied character portfolio, many spells are duplicated in the list; in a portfolio created from scratch, only the cantrips seem to be. It's functional enough for my personal use, of course, but as I'd like to give this to the community I look for it to be "just right" Thanks for your time! Last edited by Lord Magus; November 10th, 2012 at 01:15 PM. Reason: Forgot the files |
|
#7 |
Senior Member
Join Date: Jan 2011
Location: Quebec, QC, Canada
Posts: 464
|
Tried it for a sorcerer: lists available spells levels 1 and up just fine, but lists all cantrips as available, even those the sorcerer does not know, and lists some of those multiple times.
I work on HeroLab for the Mac, up to date. |
#8 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,213
|
Your script says:
field[pCandExpr].text = "component.BaseSpell&!Helper.WizBoot" That's not everything in Aaron's original suggestion. You need Helper.WitBoot and Helper.MagBoot, too. |
#9 |
Senior Member
Join Date: Jan 2011
Location: Quebec, QC, Canada
Posts: 464
|
Quote:
Hmm... now I get the point of those helpers. Thanks! Last edited by Lord Magus; November 10th, 2012 at 02:25 PM. |
|
#10 |
|
|