View Single Post
Daphne Pfister
Member
 
Join Date: Oct 2011
Posts: 66

Old November 18th, 2012, 07:31 PM
Quote:
Originally Posted by cryptoknight View Post
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]
Attached Images
File Type: png Screen Shot 2012-11-18 at 11.30.01 PM.png (191.4 KB, 3 views)
Daphne Pfister is offline   #47 Reply With Quote