Senior Member
Join Date: Dec 2011
Posts: 100
|
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" 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... |
#1 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,243
|
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).
|
#2 |
Senior Member
Join Date: Dec 2011
Posts: 100
|
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. |
#3 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,243
|
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. |
#4 |
Senior Member
Join Date: Dec 2011
Posts: 100
|
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 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. |
#5 |
Senior Member
Join Date: Jul 2010
Posts: 3,151
|
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" 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 by Sendric; March 7th, 2024 at 03:12 PM. |
#6 |
Senior Member
Join Date: Jul 2010
Posts: 3,151
|
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 Code:
foreach pick in hero from BaseSpell where "Helper.InSpellbk & Spellbook.cHelpWiz" |
#7 |
Senior Member
Join Date: Dec 2011
Posts: 100
|
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. |
#8 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,243
|
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. |
#9 |
Senior Member
Join Date: Dec 2011
Posts: 100
|
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? |
#10 |
|
|