View Single Post
RavenX
Senior Member
Volunteer Data File Contributor
 
Join Date: Jan 2011
Location: Nowhere, Virginia
Posts: 3,555

Old August 27th, 2017, 06:31 PM
Code:
if (tagis[SkillBonus.?] <> 0) then
expr = tagids[SkillBonus.?, " | "]
foreach pick in hero from Skill where expr
perform eachpick.field[trtBG].modify[+,2,""]
nexteach
endif
The line of code I've outlined in red is why your only seeing a +2 bonus applied. You're telling the software that for any SkillBonus tag it should apply a +2 bonus via the modify part of this script. If you are using the SkillBonus tag group to determine the value of the bonus, you need to rig it up to apply the proper bonus.

Also, the foreach loop might not even be necessary, you could rig this in an eval script on the skills component and cut the foreach loop out of the equation completely.

For example, using if () then statements to cycle through your tags...

If (tagis[SkillBonus.1] <> 0) then
perform eachpick.field[trtBG].modify[+,1,""]
elseif (tagis[SkillBonus.2] <> 0) then
perform eachpick.field[trtBG].modify[+,2,""]
endif

You can cycle through all your Skill Bonus tags, telling hero lab to apply the bonus based on the presence of a specific tag within your foreach statement. This should fix the issue of only applying a +2 bonus.

Also, the foreach loop is possibly completely unnecessary. If you rig hero lab to forward SkillBonus tags to the skills themselves you can have an eval script on your skill component that does all the trait modifications without needing that foreach loop.

You can do this by rigging a skill linkage and having your background traits establish the linkage. Then in an eval script use linkage[basis].setfocus and perform focus.assign[SkillBonus.X] to the skill directly...

RavenX

Please do not PM me to inquire about datafiles I coded "for personal use" such as Exalted, World of Darkness, AD&D, or Warhammer 40K Roleplaying. I appreciate your interest, but I do not own the Intellectual Property rights to these game systems. Nor do I have permission from any of the Publishers to distribute the data files. As such, I cannot distribute the work I have done with community on these files. They are "for personal use" only. Thank you.

Last edited by RavenX; August 27th, 2017 at 06:37 PM.
RavenX is offline   #2 Reply With Quote