• 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

Maximum Number of Picks

RayPrancer

Well-known member
How do I code so that, for example, an Ability that can only be picked three times presents an error message if more than three picks are made. I'm pretty sure I need to count the number of times it's picked, but not sure what the code to do so is or the correct syntax for the "iserror"

A more explicit example: I have an ability called Extra Elemental Reduction with the Unique ID abXElemRed - it's limited to seven picks, so an error needs to appear if the number of picks satisfies the conditions "abXElemRed > 7".

It's not simply a matter of saying
Code:
if abXElemRed < 8 then 
  @valid
endif
so where am I going wrong?

I'm trying to create the ability via the editor rather than the data files, as it is dependant on a source.
 
Last edited:
I think I've found a script that should work (adapted from the prerequisite script for one of the abilities in the sample ability) but can't work out where to add it.

Code:
if (#trait[abXElemRed] >= 7) then
          @valid = 0
          done
          endif
        altthing.linkvalid = 1

I'm trying to run this at validation index 1 priority 100 under it's own Eval Scripts, but am sure this is not that right place - especially as it's not working. I also tried setting up a new mechanic called Max Picks and having it be a prerequisite for that.
 
Your first clue for whether to put this test comes from your very own post. You adapted the script from a pre-requisite script on an ability, so you should probably set this up as a pre-requisite as well.

If you're using the Editor, you can add a pre-requisite test via the "Pre-reqs" button. Your script can be written as you have it above, except that I don't think you need the last line (with "linkvalid"). You can also simplify the script if you'd like, as shown below.

Code:
validif (#trait[abXElemRed] < 7)

Hope this helps!
 
Back
Top