• 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

Making a selection from a custom expression

AndrewD2

Well-known member
I've got this customer expression:
Code:
component.BaseClass & (thingid.cFighter|thingid.cBarbarian)

and this script (so far):
Code:
~ If we're not shown, just get out now
doneif (tagis[Helper.ShowSpec] = 0)

if (compare(field[usrChosen1].chosen.?????,*fighter*) = 0) then
   field[abValue].value += round(field[xAllLev].value-2,0,-1)

   ~add that many fighter-counts-as tags to the hero
var i as number
for i = 1 to field[abValue].value
  perform hero.assign[FtCountAs.Fighter]
  next
elseif (compare(field[usrChosen1].chosen.?????,*barbarian*) = 0) then
   #trkmax[cBbnRage] += (2 * round(field[xAllLev].value-2, 0, -1))
endif

I need to finish off those if statements (some something that works). I've had it working using an Array list, but I know there's gotta be something better than that. Aaron was trying to help me and I thought I had it, but I'm just not getting it to work.

Any help is always greatly appreciated.

Andrew
 
Try switching the candidate expression to the class Helpers instead

Code:
component.BaseClass & (thingid.cHelpFtr|thingid.cHelpBbn)

Code:
~ If we're not shown, just get out now
doneif (tagis[Helper.ShowSpec] = 0)

~ If we haven't chosen anything yet, just get out now
doneif (field[usrChosen1].ischosen = 0)

~ For barbarians, we get to count as a fighter for feats
if (field[usrChosen1].chosen.tagis[Classes.Barbarian] <> 0) then
  field[abValue].value += field[xAllLev].value - 2

  ~add that many fighter-counts-as tags to the hero
  var i as number
  for i = 1 to field[abValue].value
    perform hero.assign[FtCountAs.Fighter]
    next

~ For fighters, we get more rage rounds for out fighter levels
elseif (field[usrChosen1].chosen.tagis[Classes.Fighter] <> 0) then
  #trkmax[cBbnRage] += (2 * (field[xAllLev].value - 2))
  endif
 
When I change the expression to:
Code:
component.BaseClass & (thingid.cHelpFtr|thingid.cHelpBbn)

I get no selections
 
What do you have the "Restrict First List to..." to? If you leave it blank it defaults to hero. You may need to switch it to All Things.
 
I've done blank. All things and on hero. All show up blank. And I do have a level of fighter on the character.
 
Ah, my bad. I switched the latter part but not the earlier part.

component.BaseClass is a component on the Class Levels, but it isn't on the Class Helpers. Try

Code:
component.Class & (thingid.cHelpFtr|thingid.cHelpBbn)
 
Back
Top