• 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

Bootstrap Weapon based on Choice?

TCArknight

Well-known member
Howdy!

I'm trying to bootstrap weapons to a hero based on choice on a Class Special.

I've bootstrapped all weapons chooseable, but I want only one to be visible. I'm trying to use a condiition on the Bootstrap, but I keep getting "Invalid tag template specified: 'tagcount[Custom.HasMBLt]' "
Code on Ability (right now just testing with one weapon):
Code:
(First/1000)
~ Add chosen choices as Tags
var myChoice as string

if (field[usrChosen1].ischosen <> 0) then
  myChoice = field[usrChosen1].chosen.idstring
  debug myChoice
  if (compare(myChoice,"wMndBldLt") = 0) then 
     perform hero.assign[Custom.HasMBLt]
  endif
endif
Code on bootstrap condition:
Code:
(First/2000)
count:hero#tagcount[Custom.HasMBLt] >= 1
What's missing?

Thanks!
TC
 
In a bootstrap condition, "tagcount" won't work - that's specifically for normal scripts, and not part of the language used in tag expressions (which are what go in a bootstrap condition).

Code:
hero#Custom.HasMBLt
should work, I think.

Here's the tag expressions page of the wiki: http://hlkitwiki.wolflair.com/index.php5/Leveraging_Tags_Via_Tag_Expressions

You can compress your main script with:

Code:
if (field[usrChosen1].ischosen <> 0) then
  if (field[usrChosen1].chosen.tagis[thingid.HasMBLt] <> 0) then
    perform hero.assign[Custom.HasMBLt]
    endif
  endif
That way, you're testing tags, instead of turning the tag into a text string, then testing the text of the string you've generated - all that string work is computationally much more expensive than tag testing.
 
Thanks Mathias!

I thought I'd seen somewhere in the wiki where val:hero#tagcount[] was used in a tag expression for a condition.

I appreciate too the condensing of the script. I thought there was a better way to do it, but wasn't at my thinking best last night. Had had a long day.... LOL

TC

PS: sent a PM with a couple of things, not sure if you got it or not. Just though would check. :)
 
Sorry, I admit I'm not good about following up on the PMs on this board - once you've read it, there's no reminder that it exists, so if the question isn't one I have time to answer at the time I see it, I often forget that it's still there. I'll take a look at my PM inbox.
 
Back
Top