Junior Member
Join Date: Nov 2013
Posts: 8
|
Using the Editor, I'm trying to create a feat that will allow the user to pick two skills that they are proficient in and modify them. The dropdowns to display the proficient skills always show all skills, not just the proficient ones.
My setup: Select From... Skills Custom Expression Helper.Proficient Restrict List To All Picks on Hero What am I doing wrong here? |
#1 |
Senior Member
Join Date: May 2016
Posts: 608
|
There's an issue with timing here that's not evident when you use the normal custom expression field to do the dirty work.
You'll want to look at the scripts hanging off of something like the Rogue Expertise to build the custom expression. Script #2 in the rogue expertise feature runs at Final 999999 timing and builds the candid expressions for picking two skills that you're proficient at. Code:
var tagexpr as string foreach pick in hero from BaseSkill where "Helper.Proficient" perform eachpick.pulltags[ProfSkill.?] nexteach if (tagis[ProfSkill.?] <> 0) then tagexpr = "(component.BaseSkill & (" & tagids[ProfSkill.?, " | "] & ")) | thingid.gTooThieve" else tagexpr = "thingid.gTooThieve" endif field[usrCandid1].text = tagexpr field[usrCandid2].text = tagexpr Script #1 on the same Expertise has the code that modifies the skills to be double proficiency, you can change the code all you want to just add bonuses or have it note advantage, ect. This runs at Post-Levels 10000 Code:
doneif (tagis[Helper.ShowSpec] = 0) doneif (tagis[Helper.Disable] <> 0) var tagexpr as string if (field[usrChosen1].ischosen <> 0) then tagexpr = field[usrChosen1].chosen.tagids[ProfSkill.?," | "] foreach pick in hero from BaseSkill where tagexpr perform eachpick.assign[Helper.ProfDouble] nexteach ~If we've got proficiency with our thieves' tools, we need to display ~ on the characer sheet/special tab if (field[usrChosen1].chosen.tagis[thingid.gTooThieve] <> 0) then perform delete[Helper.SpecUp] field[livename].text = field[thingname].text & " (Thieves's tools)" perform hero.assign[ProfTooDbl.gTooThieve] endif endif if (field[usrChosen2].ischosen <> 0) then tagexpr = field[usrChosen2].chosen.tagids[ProfSkill.?," | "] foreach pick in hero from BaseSkill where tagexpr perform eachpick.assign[Helper.ProfDouble] nexteach ~If we've got proficiency with our thieves' tools, we need to display ~ on the characer sheet/special tab if (field[usrChosen2].chosen.tagis[thingid.gTooThieve] <> 0) then perform delete[Helper.SpecUp] field[livename].text = field[thingname].text & " (Thieves's tools)" perform hero.assign[ProfTooDbl.gTooThieve] endif endif |
#2 |
Junior Member
Join Date: Nov 2013
Posts: 8
|
That's what I was looking for and it works exactly as I need. So, when is the custom expression used, or must we always override it in a script?
|
#3 |
Senior Member
Join Date: May 2016
Posts: 608
|
The "default" custom expression can be used for a lot of things, you can poke around the community files and see examples. Usually these have to do with simple things like energy resistance and such.
Since using those dropdown fields always require a script or a conditional statement to push tags or enable bootstraps, you'll see a lot of contributors will often build their expression in the script itself rather than rely on the basic field. It's something that you'll get a feel for after you've done it for a while. |
#4 |
|
|