View Single Post
Aaron
Senior Member
 
Join Date: Oct 2011
Posts: 6,793

Old February 21st, 2016, 08:04 AM
1 - Not well. You could use a findchild to find one weapon which met the criteria of "in the off hand" if that Hero tag was present, but that runs the risk of not altering other off hand weapons in the case that the race has many arms. I think a foreach is still your best bet here.

2 - Instead of two different conditional statements, you could combine them into one statement with two branches, like so:

Code:
  if (eachpick.field[gIsEquip].value <> 0) then
    field[abValue].value += 1
  elseif (eachpick.field[wIs2nd].value <> 0)then
    field[abValue].value += 1
    endif
But, how I would prefer to handle it would be to add the field checks to the tag expression for the foreach, like so:

Code:
  foreach pick in hero from BaseWep where "(wCategory.Melee) & (fieldval:gIsEquip <> 0 | fieldval:wIs2nd <> 0)"
    field[abValue].value += 1
    nexteach
3 - What's the validation error?
Aaron is offline   #4 Reply With Quote