Senior Member
Join Date: Apr 2010
Posts: 152
|
Here's what I'm looking to do (based on the Zhentarim Spy in Player's Guide to Faerūn).
The character can have a cover identity for each Craft or Profession skill that has two or more ranks. I've got it so that I can do a count of the skills and get how many Cover Identities they can choose for a Custom Ability. What I would like is if there is a quick and dirty way to create the list it pulls from instead of my adding a list item for each Craft and Profession skill and setting a prerequisite to display it based on its ranks. Any ideas/suggestions? |
#1 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,213
|
a foreach through all the craft and profession skills - for each one with 2+ ranks, add its tagids[thingid.?] to field[usrCandid1].text. That way, you're building up a selection list that includes only the valid skills at that time.
Last edited by Mathias; June 14th, 2012 at 12:35 PM. |
#2 |
Senior Member
Join Date: Apr 2010
Posts: 152
|
Okay, do you have that in code form? I've tried a couple of different things, but it's giving me a error on the "candid1" item. Here's what I've got, in the Eval Scripts on the Class tab:
Phase: First Priority: 100 Index: 1 Code:
~search through all the craft skills we have and count how many we have 2+ ranks in foreach pick in hero from BaseSkill where "Helper.SkCatCraft" if (eachpick.field[skUser].value >= 2) then field[candid1].text += foreach.tagids[thingid.?] endif nexteach ~search through all the profession skills we have and count how many we have 2+ ranks in foreach pick in hero from BaseSkill where "Helper.SkCatProf" if (eachpick.field[skUser].value >= 2) then field[candid1].text += foreach.tagids[thingid.?] endif nexteach |
#3 |
Senior Member
Join Date: Apr 2010
Posts: 152
|
The red text is just something I put in to show how I'm thinking. I've tried a couple other bits of code and can't seem to get the right one.
|
#4 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,213
|
&=, not += when adding text to an existing text string. += is for adding numbers to each other.
Also, Code:
foreach pick in hero from BaseSkill where "Helper.SkCatProf | Helper.SkCatCraft" You'll also need an OR: " | " between each Id you place in there: Code:
field[usrCandid1].text = splice(field[usrCandid1].text,eachpick.tagids[thingid.?]," | ") Phase & Priority: never use First unless there's a specific reason to, and don't use priorities of less than 1000 unless there's a specific reason to. I'd say Final/10000 for this. You may also want to use skRanks, instead of skUser, so that it also finds those skills whose ranks have come from racial skill ranks or from a headband of vast intelligence. |
#5 |
Senior Member
Join Date: Apr 2010
Posts: 152
|
Thanks!
It's compiling fine now, but when it completes, I get a list of the following error multiple times: Attempt to access field 'usrCandid1' that does not exist for thing 'cHelpZht' I tried putting it in as a User Tag, but still get the error. Code:
~search through all the craft skills we have and count how many we have 2+ ranks in var bonus as number foreach pick in hero from BaseSkill where "Helper.SkCatProf | Helper.SkCatCraft" if (eachpick.field[skRanks].value >= 2) then field[usrCandid1].text = splice(field[usrCandid1].text,eachpick.tagids[thingid.?]," | ") endif nexteach |
#6 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,213
|
Oh, I thought you were on a class special and were building the list for a drop-down.
How are you doing this? |
#7 |
Senior Member
Join Date: Apr 2010
Posts: 152
|
On the Class tab, trying to build it as a Custom Ability list.
|
#8 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,213
|
Suggestion: Have only one (not unique) "Cover Id" ability that can be selected - each Id you add then uses a drop-down to select which skill it applies to. The user adds a new copy for each cover Id they want.
|
#9 |
Senior Member
Join Date: Apr 2010
Posts: 152
|
Okay, I'll take a look and see if I can make it work that way.
|
#10 |
|
|