• 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

Expression Match

AndrewD2

Well-known member
OK I'm trying to save some computing power by not using a foreach.

I just need the statement to match once, the current foreach is:

Code:
     ~if we're using a shield bash, we get Two-Weapon Fighting
      foreach pick in hero from BaseWep where "wCategory.ShieldBash & ((fieldval:wIs2nd <> 0) | (fieldval:gIsEquip <> 0))"
        perform hero.assign[Hero.TwoWep]
        done
        nexteach

I figure I could use something like:

Code:
    doneif (hero.findchild[BaseWep, "wCategory.ShieldBash & (Hero.MainHand|Hero.OffHand)"].??? = 0)

But I'm not sure what to check just to see if that match happened. Any ideas?

FYI I have used "valid" and it works, but from reading the description I'm not sure if that is the proper use. I've also just done a tagis[thingid.?] check which obviously will come up 0 if nothing is there. But I was hoping for something that merely says "I exist"
 
What I have done in the past is:

Code:
      ~ Try and find the equipped Shield Bash Weapon
      perform hero.findchild[BaseWep,"wCategory.ShieldBash & ((fieldval:wIs2nd <> 0) | (fieldval:gIsEquip <> 0))"].setfocus
      ~ if can't find then get out now!
      doneif (state.isfocus = 0)

So the setfocus takes care of the "existence" check for me which is what I think you are trying to do...
 
Yeah, thought about that too, was just trying to get it down to 1 line of code ...
Hmmm I am not seeing real benefit over 1 or 2 lines of code. If this is for the vigilante class I would double check what LW wants. They like things to stick to existing standards.

For one line then pretty much you need to do the "tagis[]" trick you mentioned.

The funny part is you are getting to that point Andrew where its not that you don't know what script command to use. Its that you want more "advanced" commands now. This is a fun level to be at as you start seeing areas in the scripts and stuff that could be 'improved' upon. :)
 
Oh I've wanted more advanced stuff for a while ... do you have any idea how many requests I've sent in for 3PP to add various tags to different things. In fact for the Vigilante I've requested Target.? tags for each of the various Improved/Greater etc maneuver feats to identify the maneuver they're affecting without having to if/then/else through each one.
 
Oh I've wanted more advanced stuff for a while ... do you have any idea how many requests I've sent in for 3PP to add various tags to different things. In fact for the Vigilante I've requested Target.? tags for each of the various Improved/Greater etc maneuver feats to identify the maneuver they're affecting without having to if/then/else through each one.
Nice! Other than some functionality into the binary HL I actually stopped asking. It just became easier to build what I needed.

But happy to see the requests going in as more features in HL keep showing up. Now if we could just get better documentation for all these new features. :) :eek:
 
I Just request ... I have no idea if they'll actually do it ;-)
Yep. I also understand the other side from LW that they have SO much stuff to input per month from Paizo that adding "new" features is hard. They are forced to do what works "now" because they have so little time.

So all of these "requests" come down to "nice" to have but not required to keep the money coming in. Part of the reason I stopped asking as I felt bad laying additional "work" on top of there busy schedules.

Even rule issues. I mention something (ie bug report) and if they disagree I just make a mechanic/custom script to fix it. Its just not worth the effort to have a long drawn out discussion....
 
So bumping this back up as I just found out about "haschild[]".

so you could do:
Code:
doneif (hero.haschild[BaseWep, "wCategory.ShieldBash & (Hero.MainHand|Hero.OffHand)"] = 0)
 
Back
Top