• 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

Custom Ability choices based of ranked Skills

Matt Droz

Well-known member
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?
 
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:
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
          [B][COLOR="Red"]field[candid1].text += foreach.tagids[thingid.?][/COLOR][/B]
          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
          [B][COLOR="Red"]field[candid1].text += foreach.tagids[thingid.?][/COLOR][/B]
          endif
        nexteach
 
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.
 
&=, 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"
so you can combine the two foreaches into one.

You'll also need an OR: " | " between each Id you place in there:

Code:
field[usrCandid1].text = splice(field[usrCandid1].text,eachpick.tagids[thingid.?]," | ")

Sorry about mis-typing the Id of the usrCandid1 field earlier - I was typing too fast and not thinking hard enough about what I was writing.

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.
 
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
 
Oh, I thought you were on a class special and were building the list for a drop-down.

How are you doing this?
 
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.
 
Back
Top