• 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

Eval Rules - count number of abilities

mbran01

Well-known member
I am trying to create an eval rule that will count the number of times the ability has been added and if it has been added more than 3 times throw an error. Here is what I have. Any help with why it is turning the ability red and displaying the error message on every copy of the ability added would be appreciated.

Code:
      ~These calculations should only happen for the first copy
      doneif (tagis[Helper.FirstCopy] = 0)

      if (field[xCount].value >= 3) then
        @valid = 1
      endif
 
I am no expert, but isn't your script telling the ability to be valid if xCount is 3 or more? That looks like the opposite of what you intend.
 
Lord Magus is correct. change the >= to to a < or make @valid=1 by default and make it = 0 if your >= condition is true.

depends on your coding style.
 
I am trying to create an eval rule that will count the number of times the ability has been added and if it has been added more than 3 times throw an error. Here is what I have. Any help with why it is turning the ability red and displaying the error message on every copy of the ability added would be appreciated.
On top of what the others have said their is a much easier way to do this then an Eval Script.

On the Right side under all the blue buttons is a "Max Limit" section. If you simply type in 3 then HL will take care of only letting three be added before it throws an error. Much easier. :)
Image1.jpg

P.S. - If this is a "Custom Ability" then their is no "xCount" field. To find and see fields make sure you go to "Develop->Enable Data File Debugging". Then add your "Custom Ability" to the character and right click the question mark and you have new choices. Select "Shadow Debug Fields for xxx". Then a new window appears where you can actually see the fields and their values and will look like this:
Noname.jpg
 
Last edited:
Thank you, I had not seen that max limit before. Or, rather I had, but I had not paid attention to it.
 
Back
Top