• Please note: In an effort to ensure that all of our users feel welcome on our forums, we’ve updated our forum rules. You can review the updated rules here: http://forums.wolflair.com/showthread.php?t=5528.

    If a fellow Community member is not following the forum rules, please report the post by clicking the Report button (the red yield sign on the left) located on every post. This will notify the moderators directly. If you have any questions about these new rules, please contact support@wolflair.com.

    - The Lone Wolf Development Team

Assigning a dynamic tag on an adjustment

I'm trying to add an adjustment that lets you select a slot and add more copies of it. My adjustment uses the custom menu expression ExtraSlot.Eqp? to get a list of all extra slot tags. I copied some code from the Weapon Focus feat and tried this:

Code:
doneif (tagis[Helper.FtDisable] <> 0)
doneif (field[pChosen].ischosen = 0)

var x as number
var slot as string

call fTargetId

for x = 1 to field[pAdjust].value
    perform field[pChosen].chosen.setfocus
    perform hero.assignstr["ExtraSlot." & slot]
next

Unfortunately it appears that fTargetId always looks for the usrChosen1 field, and the user menu field for adjustments is named pChosen instead. I could of course just write an if/elseif block to assign the right tag for every slot, but I'm sure there's a more elegant solution. Is there another way to assign a tag from the user menu?
 
Code:
doneif (field[pChosen].ischosen = 0)

perform field[pChosen].chosen.pulltags[ExtraSlot.?]

var i as number
for i = 1 to field[pAdjust].value
  perform hero.pushtags[ExtraSlot.?]
  next
 
Back
Top