• 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

Configurables and spellbooks

Nightfox

Well-known member
I'm sorry, after 4 hours I must accept that my search-fu has failed me.

I'm working on a project and the best solution I can come up with for one of the many problems is to use a configurable. The goal is to create a group of spells from the character's spellbooks. I tested an expression in an adjustment and a feat and was able to get a drop down of only the spells in the spellbooks for a specific class, but I can't seem to get the expression to translate to the configurable.

From the feat:
Code:
 ~pre-level 11000
      field[usrCandid1].text = "component.BaseSpell & Helper.InSpellbk & Spellbook.cHelpWiz"

I've tried entering the expression on the config in the field directly and using eval script to add it to the field[cfgAllow1].text, but it always comes back with:
Nothing to choose from!

The goal is to create multiple small lists of spells from those the character has available, and be able to reference those lists later.
Since there were going to be multiple lists, the plan was to use a configurable with separate lists under custom ability, secondary ability, tertiary ability, etc...
 
On these picks, what selection did you make in the "Restrict First List To" option? ("All Picks on Hero" is the selection that's correct for what you're trying to do).
 
I did not see a selection option for "Restrict First List To". I only see:
Allow Custom Abilities (with an Edit button)
Custom Ability Total [cfgMax1]
Primary Candidate Expression [cfgAllow1]
Custom Ability Name [cfgObject1]
Optional Ability (check box)

Did I miss an update, or is that supposed to be part of the candidate expression?
I'm not very familiar with the structure of the expressions. I went through your set on "math", "Location", and "Bootstraps" but could not find anything on the format for candidate expressions, and the references I found in other configurables were just aaaa.bbbb & cccc.dddd etc... with no reference to restricting where to look. I can see examples in "foreach" statements with restrictions of "pick on hero", but I don't think we want a "foreach" in the expression. <I could be wrong though>

If you know of a thread that goes over proper structure and syntax for expressions, can you point it out so I can save it to my editing reference folder.
 
Ok, the Ids you just listed are for a completely separate mechanism than for your first post.

In your first post, the Id was usrCandid1 - that is used for setting up a drop-down choice on a feat or ability - that field controls the list of what choices will be shown to the user.

In your third post, the Ids you're listing are all specific to the Configurable tab in the editor, and control which abilities and how many abilities may be added to the table shown on the tab created by the configurable.

So which editor tab are you working on? Since the code you posted seemed to be for a drop-down, I was asking questions about controls found on the "Classes/Custom Ability" tab.
 
EXPLANATION:
Sorry for the confusion. As mentioned, in the first post, I'm trying to get a configurable to work. The code posted in the first post is what I got to work "From the feat:"
Here is what I had in the expression on the configurable:
Code:
component.BaseSpell & Spellbook.cHelpWiz & Helper.InSpellbk
But it gives me a popup of "Nothing to choose from!"

WHAT WE WANT TO DO:
Here is what I am trying to accomplish. I want to create a ... psudo-spellbook. It has limited space, you can't memorize or share spells from it, and you can only put in spells that you already have in your regular spellbooks.

HOW WE HAVE BEEN TRYING TO DO IT:
The easiest solution I could think of was to create a configurable. I usually use feats to test code since it is easy to add them to a test character, check results, make modifications, and check again. However, I have little experience with expressions, and I haven't been able to find anything that would explain why it isn't working, or if it simply won't work because of some hard coding in the background.
 
I've never done anything with configurables, but looking at the editor they don't appear to have drop down menus, which is probably why your script isn't working. Instead, you might try:

Code:
field[cfgAllow1].text = "component.BaseSpell & Helper.InSpellbk & Spellbook.cHelpWiz"

Note: To find what the name of the candidate expression field for custom abilities is on a configurable, simply fill in some text in the editor on the appropriate line then click the "Fields" button to see what it says.

Edit: actually, you wouldn't even need to do this in a script. Just take the text above between the quotes and fill it into the primary canidate expression box in the editor.
 
Last edited:
For what it's worth, using a foreach loop could also work for the problem you're trying to solve. When you write:

Code:
foreach pick in hero from BaseSpell

for example, this searches through the character and finds all the things that are spells. This would allow you to generate a list of all spells. If you wanted to narrow it down, you could do:

Code:
foreach pick in hero from BaseSpell where "Helper.InSpellbk & Spellbook.cHelpWiz"

This looks for all spells with those specific tags. You should then be able to generate a list of spell names and add them to the description.
 
Thank you Sendric. I've tried using an eval script in the configurable, the feat (that I used to test adding the configurable initially), and a class special (making a quick archetype to add the configurable to the class) to set the expression. All came back with either: [Nothing to choose from!] or a [Syntax error] notice and a list of EvErYtHiNg...

I've even tried using the eval script to add it to [cfgAllwSp1] with the same results.

There might be a timing issue, but I think the expressions run in the late final phase when everything else should already be in place so there would be things to choose from.

Right now my concern is that the spells are considered to be behind a gizmo (spellbook) and the expression can't see them.
 
The table that is set up by cfgAllow1 will not support spells being added to it. That is an ability table, and the user-set candidate expression won't override the base setup of what category of things can be in that table, because that base setup is necessary to setup which visual display is used for the items added to that table.


So, please give me the game rules you're trying to implement - that way, I can try to figure out a different approach that will let you accomplish your goal.
 
Thank Sendric
The "foreach" is giving me that frustrating "Syntax Error" but I'll try some more permutations and see if it plays out.

Mathis
it is a homebrew. The caster can "give" their familar/animal/eidolon the ability to cast a certain number of spells. The number of spells and spell levels will vary. The spells have to be ones in their book, but they don't necessarily have to have them prepared for the day. It is also possible to have this set up with multiple familiar/animal/eidolon with each having a different set. So I don't want to limit it to a one-and-done but something that can be added multiple times, either on the same config or as additional tabs.

So the [cfgAllow1] is a hard code block, but I have a similar issue with [sfgAllwSp1]. I can get all spells to show, but I can't get it to limit to just the spells in spellbooks.

Question, is it possible to set a spellbook to limit what can be added to only what is in your other spellbooks for that class?
 
As an additional note, the same "set" can be given to multiple companions, or none, and can be changed daily (as part of preparing your spells). Each companion can only have one "set" at a time. I therefore want the "sets" on the hero, and have a select-able script on the companions to choose which "set" (if any) they get that day.

at least that is the theory
 
So this needs to be operating on the familiar/animal/eidolon, and then looking up the spellbook list on that character's master. That vastly increases the complexity of this project.

You've seen in the code that we have separate tables for the spells for spellbook casters and other casters. The table setup needs to be different in each case. Yes, configurables have three spell tables, but none of them are set up to support spellbook spellcasting. Plus, even if this mechanism was available on configurables, it could not look up the spells on the master from within a minion - not in a way that would restrict the list of spells to show to those that are in the master's spellbooks - that could only work within a single character.

The cfgAllwSp1 field has a size limit of 5000 characters, so it won't work to just list all the tags of the spells the character knows - by around 10th level, the character count needed to list all the tags for every spell in a wizard's spellbook will exceed that space, and it'll start generating syntax errors.

So, what I would do here is to still use the configurable spellcasting tables, and set that up so that it gives you the proper list of spells to select from, but the overall list of what the master's class could possibly cast.

Then, once that's working, begin phase 2 and figure out how to report an error if the user selects a spell the master doesn't know. I just tried for 15m and couldn't come up with a solution for how to accomplish that. I'd need to study the project in more detail.
 
Sets of spells mirrored from the master to a minion are not an approach I would recommend trying to accomplish until you are an expert at HL's code. I'd start out implementing a simple version of all this that just adds the spellcasting capability directly to the minions, and trust the user to validate against their spellbooks for now, and users will have to just edit the list each day if they want to change it, the same way a normal spellcaster works.
 
the problem is i don't trust :D

I'd like the list on the PC with a validation check on the minion. That would seem to be the easiest way to avoid ... mistakes? ... accidents? ... yeah, we'll go with that, because I'm absolutely sure no one would deliberately switch abilities to something more advantageous or add to more creatures than they can link.

I don't think we'll need a full spellcasting tab on the creature, it could be handled entirely within the InPlay tab I think (it is very limited after all). But I want to make sure that they don't have more creatures linked than their limit, and they don't have more sets than their limit.

If I leave the table list to BaseSpell and class, is there a way to do a validation check to make sure that the selections are in their spellbooks, and throw up some red text if not?


note: one of the exploits I've already seen is someone who is going to be able to have 6 beasties in their link but only two sets. I kind of want to make sure they don't "accidentally" mix and match spells, or give a spell that isn't even on a set.
 
Last edited:
Do bootstraps get added at a specific time?
If tags are added to bootstraps, are they added the same time as the bootstrap, or do they have a later timing?
 
Do bootstraps get added at a specific time?
If tags are added to bootstraps, are they added the same time as the bootstrap, or do they have a later timing?

Bootstraps are added immediately unless there's a condition. For various timing reasons, conditions usually have to be early (First/500ish). Any tags added to bootstraps are immediately applied. If you need a tag added later, you'll need to do that as a script.
 
New approach.
Creating an empty "ability" for each of the spells that could be utilized (limited list) that could be selected from the configurable tab that wouldn't necessarily apply anything to the PC but give a list list and tag that we can reference later.

I've tried creating an ability with a custom tag and using an expression on the configurable to show items with that tag.
~ worked great... popped right up without even having to add the ability to hero beforehand... but we want to limit it to only after it is "on the hero"

Ok, so try removing the tag and using an eval script to re-add the tag to the ability.
~ doesn't work. (suspect the eval script doesn't run if the pick isn't actually on the hero)

Next try setting up a dummy spell with with ability bootstrapped.
~ (1) with tag already on the ability, it shows ... but it showed without the bootstrap, so no good.
~ (2) with tag applied by eval scrip, the tag shows on the floating window, but the ability does not show on the configurable table.

Next try adding the tag to ability during bootstrap.
~ as above, the tag shows on the floating window, but the ability does not show on the configurable table.

I was really hoping there was a timing issue, but based on what you've said, that does not appear to be the case.
 
It would help if you could supply the script you're using. It's very difficult to debug something without seeing it.
 
Right now I have one solution that ... works?... which is to show everything and use Expr-reqs to grey out selections that aren't valid, but I really want to see if it is possible to actually adjust the tables to show only valid.

There is a lot going on and many different approaches being tried, so here are the different bits of code. This is mostly being tested with fake "things" until I find something that works. I really don't want to make a bunch of entries until I figure out what will and will not work.

on the configurable:
Code:
Post-levels 11000
field[cfgAllow1].text = "Custom.LinkSrg"
field[cfgAllow2].text = "SpecGroup.LnkSrg"
note: was going to add "& !Helper.Helper" but I can't even get the list items to appear correctly.

Created "abilities" (first tab under General in editor. Tried using simple but those apparently are not valid selections). If I give it the "Custom.LinkSrg" or "SpecGroup.LnkSrg" on the items already they always show, but as mentioned above, I would like to limit it so only certain selections are shown based on if they are in the character's book.

Tried removing the tags from the ability:
Result: ability does not show in either table on configurable

Created a fake spell and bootstrapped the ability to the fake spell with the tags "Custom.LinkSrg" and "SpecGroup.LnkSrg".
Result: The ability shows as something on the hero (floating window) and shows the tags, but the ability still did not show in either configurable tables.


Created Eval scrip on fake spell
Code:
Pre-levels 1000
perform hero.childfound[abSrgBlend].assign[Custom.LinkSrg]
perform hero.childfound[abSrgBlend].assign[SpecGroup.LnkSrg]
perform hero.childfound[abSrgBlend].delete[Helper.Helper]
Result: Again, the ability can be found in the floating window and the tags show, but it still is not showing on the configurable tables.

Also tried the script on the ability
Code:
Post-levels 100
If (hero.childfound[spFakeBlend].tagis[Spellbook.cHelpWiz] <> 0) then
perform assign[Custom.LinkSrg]
perform assign[SpecGroup.LnkSrg]
perform delete[Helper.Helper]
endif
Result: as above, the ability can be found in the floating window and the tags show appropriately, but it still is not showing on the configurable tables.

Right now, my only guess is that the configurable table is looking only at initial tags and not at any tags added or removed by eval scrips.
 
Last edited:
on the configurable:
Code:
Post-levels 11000
field[cfgAllow1].text = "Custom.LinkSrg"
field[cfgAllow2].text = "SpecGroup.LnkSrg"
note: was going to add "& !Helper.Helper" but I can't even get the list items to appear correctly.

The full line for this should look something like:

Code:
component.Ability & Custom.LinkSrg & !Helper.Helper & !Helper.Obsolete

Not that that solves your problem. Question: Why are you setting this field through a script? Why not set the field directly? I'm wondering if the script is setting this too late for the system to properly run it.


I did the following as a test:

1) Created configurable which I bootstrapped to a homebrew adjustment to get it on a character. I set the fields as follows (no script, just directly assigned):

Code:
cfgAllow1: component.Ability & Custom.LinkSrg & !Helper.Helper & !Helper.Obsolete
cfgMax1: 1

2) Created Ability with tag Custom.LinkSrg directly assigned.

Result: Ability appears in the configurable selection menu.
 
Last edited:
Back
Top