Quote:
Originally Posted by cryptoknight
It's close but I ran into 1 problem.
attridstring is an invalid identifier, I think variables are capped at 8 characters for their names.... I renamed them to attidstr and that goes away.
|
I found the problem try I should have used eachpick.idstring instead of eachpick.field[name].idstring.
Seemed to work when I tried it.
Code:
var bonus as number
var attidstr as string
~ Use Int as default - this might not be necessary
bonus = #attrbonus[attrInt]
attidstr = "attrInt"
~ Find highest bonus
foreach pick in hero from Attribute
if (eachpick.field[attrBonus].value > bonus) then
bonus = eachpick.field[attrBonus].value
attidstr = eachpick.idstring
endif
nexteach
~ Use that as the damage and attack attributes
perform assignstr["DamageAttr." & attidstr]
perform assignstr["Attack." & attidstr]