|
Senior Member
Join Date: Oct 2016
Posts: 621
|
Hoping someone can quickly point me at an example of an ability that changes the relevant ability score for a skill that could be ported over as a Trait, if it is not one already.
Specifically, I am trying to create a trait called Idiot Savant, which requires that you have an Intelligence of 9 or less. If you take this trait, you may choose one Intelligence skill, and perform it with your Wisdom bonus instead. This is to create an NPC who is really quite simple-minded, but BRILLIANT at making things (Craft) which is intelligence based. If this sort of code already exists, can someone please point me in the right direction? If it does not exist, can I get someone to help me write it? Thanks in advance Erin |
#1 |
Senior Member
Join Date: Oct 2011
Posts: 6,793
|
You just need to assign a SkillOver tag for whatever attribute you want to use instead of the base, to the skill in question.
Did you want to treat all craft skills as a single selection for the purposes of this trait, or would the user select a single craft skill to get the benefit? |
#2 |
Senior Member
Join Date: Oct 2016
Posts: 621
|
It would apply to all craft skills, how wold I go about that?
|
#3 |
Senior Member
Volunteer Data File Contributor
Join Date: Jan 2010
Location: Chicago, IL (USA)
Posts: 10,729
|
Code:
~ Find all Craft Skills foreach pick in hero from BaseSkill where "Helper.SkCatCraft" ~ Make the craft skill use Wisdom perform eachpick.assign[SkillOver.aWIS] nexteach Hero Lab Resources: Pathfinder - d20pfsrd and Pathfinder Pack Setup 3.5 D&D (d20) - Community Server Setup 5E D&D - Community Server Setup Hero Lab Help - Hero Lab FAQ, Editor Tutorials and Videos, Editor & Scripting Resources. Created by the community for the community - Realm Works kickstarter backer (Alpha Wolf) and Beta tester.- d20 HL package volunteer editor. |
#4 |
Senior Member
Join Date: Oct 2011
Posts: 6,793
|
Well, first you'd set up a selector on the trait to choose among all intelligence skills plus the "AllKnow" and "AllCraft" skill helpers. Go to "Develop -> Enable Data File Debugging". Use debug and look at, for example, the Appraise skill by right clicking on it and "Show Debug Tags". Do you see the tag in that list which indicates this skill is based off of INT? For the helpers, just use the thingid tags. When building a tag expression, like for this selector | means "or".
Once that is done, make sure you can choose among the correct skills, then move to the next step, which is the eval. I'll rough something out, with some notes on what you need to complete it. The ~ symbol means that line is a note/instruction, and is ignored for the purpose of code Code:
~ This line is to stop the code from executing if something disables this trait doneif (tagis[Helper.FtDisable] <> 0) ~ This line stops the code if our selector hasn't chosen anything yet doneif (field[usrChosen1].ischosen = 0) ~ The following section sees what we have selected, and depending on that applies a skillover tag to one or more skills. ~ First branch is if we picked Craft. XXX is the unique ID for the All Craft helper if (field[usrChosen1].chosen.tagis[thingid.XXX] <> 0) then ~ cycle all the skills with a tag saying they are craft skills. YYY is the tag ID of this tag foreach pick in hero from BaseSkill where "Helper.YYY" perform eachpick.assign[SkillOver.aWIS] nexteach ~ Second branch is if we picked Knowledge. ZZZ is the unique ID for the All Knowledge helper elseif (field[usrChosen1].chosen.tagis[thingid.ZZZ] <> 0) then ~ cycle all the skills with a tag saying they are craft skills. AAA is the tag ID of this tag foreach pick in hero from BaseSkill where "Helper.AAA" perform eachpick.assign[SkillOver.aWIS] nexteach ~ Third branch is not a group of skills, so just assign the SkillOver to what we selected else perform field[usrChosen1].chosen.assign[SkillOver.aWIS] endif |
#5 |
Senior Member
Join Date: Oct 2016
Posts: 621
|
Thanks to you both, I got it working, just great
|
#6 |
|
|