View Single Post
Bob G
Senior Member
 
Join Date: Nov 2017
Location: Trafford, PA, USA
Posts: 226

Old December 6th, 2017, 12:03 PM
Quote:
Originally Posted by Minous View Post
the sudo code for apply a bonus to damage equal to the character's Intelligence bonus with all firearms is something like:

find intelligence modifier and store in variable.

find all fire arms, and iterate over those (a for each loop)
apply damage modifier to said weapon.
end the for each loop

and you would need to set the timing of that command correctly, Somewhere after post attributes probably.
So, if I'm thinking this through correctly, and following your steps, I would first get the INT attribute bonus:
field.[abValue]=hero.child[aINT].field[aBonus].value

Then, I would do a foreach command that locates all picks with the BaseWep component and the tag wCategory.Firearm:
foreach pick in hero from Component.BaseWep where wCategory.Firearm

Then, I apply the bonus to the results that the foreach command found:
eachpick.field[dmrBonus].value += hero.child[aINT].field[abValue].value

Lastly, I end the foreach command:
nexteach

I haven't tried it yet, just wanted to get my thoughts written down so that it sticks in my mind. Let me know if my script was right, and thank you so much for your help.

Last edited by Bob G; December 6th, 2017 at 01:58 PM.
Bob G is offline   #4 Reply With Quote