Junior Member
Join Date: Jul 2017
Posts: 26
|
So I am creating some new feats.
I plugged in this code to allow the feat to provide proficieny in Investigation, or double proficiency if already proficient. Interesting thing that happens is when i select the feat it applies double proficiency just fine, but the Investigation with double proficieny now appears twice both in the program and the print out. Why is that?? Code:
doneif (tagis[Helper.ShowSpec] = 0) doneif (tagis[Helper.Disable] <> 0) if (hero.tagis[ProfSkill.skInvestig] <> 0) then perform hero.assign[ProfDouble.skInvestig] else perform hero.childfound[skInvestig].assign[Helper.Proficient] endif |
#1 |
Senior Member
Join Date: May 2016
Posts: 608
|
It likely has to deal with timing, would have to see all the scripts being applied on the hero to be sure.
Have you looked at the UA article Feats for Skills code? The feat Acrobat has some code in there that does exactly what you want for Acrobatics, but doesn't leave a second copy on the sheet. Should be easily modified for whatever skill you want. The code runs Post-Level at 15500, which is after Helper.Proficient tags are assigned on most abilities (around 10000) but before the proficiency & double proficiency tags are pushed (around 16000 if I remember). Code:
doneif (tagis[Helper.ShowSpec] = 0) doneif (tagis[Helper.Disable] <> 0) foreach pick in hero from BaseSkill where "thingid.skAcrobat" if (eachpick.tagis[Helper.Proficient] = 0) then perform eachpick.assign[Helper.Proficient] elseif (eachpick.tagis[Helper.Proficient] <> 0) then perform eachpick.assign[Helper.ProfDouble] endif nexteach |
#2 |
Senior Member
Volunteer Data File Contributor
Join Date: Jan 2010
Location: Chicago, IL (USA)
Posts: 10,729
|
Quote:
The above could be done with almost no CPU usage by using a FOCUS instead. Code:
doneif (tagis[Helper.ShowSpec] = 0) doneif (tagis[Helper.Disable] <> 0) perform hero.childfound[skAcrobat].setfocus doneif (state.isfocus = 0) if (focus.tagis[Helper.Proficient] = 0) then perform focus.assign[Helper.Proficient] elseif (focus.tagis[Helper.Proficient] <> 0) then perform focus.assign[Helper.ProfDouble] endif Procedure Logic: Code:
<procedure id="5CSkProfDo" context="pick"><![CDATA[ var v_SkillID as string ~ Make a Target.? skill id to be used in the find chile v_SkillID = "Target." & v_SkillID ~ Set focus to the skill id passed in perform hero.findchild[BaseSkill,v_SkillID].setfocus doneif (state.isfocus = 0) ~ If not proficient then make skill proficient if (focus.tagis[Helper.Proficient] = 0) then perform focus.assign[Helper.Proficient] ~..Else if already proficient make double proficient elseif (focus.tagis[Helper.Proficient] <> 0) then perform focus.assign[Helper.ProfDouble] endif ]]></procedure> Code:
doneif (tagis[Helper.ShowSpec] = 0) doneif (tagis[Helper.Disable] <> 0) var v_SkillID as string v_SkillID = "skAcrobat" call 5CSkProfDo 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. Last edited by ShadowChemosh; January 14th, 2018 at 11:40 AM. Reason: fixed scripting typoes... |
|
#3 |
Senior Member
Join Date: May 2016
Posts: 608
|
ShadowChemosh,
I'm trying your procedure code out and getting a generic error on the line: "Invalid ID specified for component" on the line Code:
hero.findchild["BaseSkill",v_SkillID].setfocus Code:
hero.childfound[skAcrobat].setfocus Something with 5e maybe doesn't like focusing on skills? |
#4 |
Senior Member
Volunteer Data File Contributor
Join Date: Jan 2010
Location: Chicago, IL (USA)
Posts: 10,729
|
Quote:
This: Code:
hero.findchild["BaseSkill",v_SkillID].setfocus Code:
perform hero.findchild[BaseSkill,v_SkillID].setfocus Similiar this: Code:
hero.childfound[skAcrobat].setfocus Code:
perform hero.childfound[skAcrobat].setfocus 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. |
|
#5 |
Senior Member
Join Date: May 2016
Posts: 608
|
Quote:
Also, some clarification for Freewolf on timing on running double proficiency: At Post-Levels 15000, the script "Assign Helper.Proficient based on ProfSkill tags on Hero" kicks off, which translates the ProfSkill tags over to a proficiency. At Post-Levels 20000, the scrip "Calc skProfBon" looks at the Helper.Proficient and the proficiency bonus of the hero to calc out the final proficiency modifier. So technically, assigning the Helper.ProfDouble tag has to happen after you know that the Helper.Proficient is or is not present at post-levels 15000 and before the proficiency is calculated at 20000. Last edited by dungeonguru; January 14th, 2018 at 12:47 PM. Reason: Deleted a line that was confusing |
|
#6 |
Senior Member
Join Date: Oct 2011
Location: Portland
Posts: 313
|
I want to thank all three of you for this. Adding that procedure to my notes!
|
#7 |
Junior Member
Join Date: Jul 2017
Posts: 26
|
Thanks for the help gents.
Been out of pocket last week with trying to pack up and move. I do not understand the whole Procedure aspect yet. I did copy the code from the UA Feats originally. I tried the FOCUS code you offered Shadow, but investigation still shows up twice, however this time only one has the double proficiency to it. I have tried the post-levels at 15500 and 17000 with the same result. I am attaching an image of what I have. |
#8 |
|
|