Lone Wolf Development Forums  

Go Back   Lone Wolf Development Forums > Hero Lab Forums > HL - Pathfinder Roleplaying Game
Register FAQ Community Today's Posts Search

Notices

Reply
 
Thread Tools Display Modes
mbran01
Senior Member
 
Join Date: Jan 2011
Location: Flint, MI
Posts: 100

Old March 8th, 2013, 11:37 PM
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
mbran01 is offline   #1 Reply With Quote
Lord Magus
Senior Member
 
Join Date: Jan 2011
Location: Quebec, QC, Canada
Posts: 464

Old March 9th, 2013, 06:12 AM
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 offline   #2 Reply With Quote
mirtos
Senior Member
 
Join Date: Oct 2011
Posts: 865

Old March 9th, 2013, 06:36 AM
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.
mirtos is offline   #3 Reply With Quote
ShadowChemosh
Senior Member
Volunteer Data File Contributor
 
Join Date: Jan 2010
Location: Chicago, IL (USA)
Posts: 10,729

Old March 9th, 2013, 08:45 AM
Quote:
Originally Posted by mbran01 View Post
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

Hero Lab Resources:
Pathfinder - d20pfsrd and Pathfinder Pack Setup
3.5 D&D (d20) - Community Server Setup
5E D&D - Community Server Setup
Hero Lab Help - Hero Lab FAQ, Editor Tutorials and Videos, Editor & Scripting Resources.
Created by the community for the community
- Realm Works kickstarter backer (Alpha Wolf) and Beta tester.
- d20 HL package volunteer editor.

Last edited by ShadowChemosh; March 9th, 2013 at 08:50 AM.
ShadowChemosh is offline   #4 Reply With Quote
mbran01
Senior Member
 
Join Date: Jan 2011
Location: Flint, MI
Posts: 100

Old March 10th, 2013, 09:16 AM
Thank you, I had not seen that max limit before. Or, rather I had, but I had not paid attention to it.
mbran01 is offline   #5 Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 10:40 PM.


Powered by vBulletin® - Copyright ©2000 - 2024, vBulletin Solutions, Inc.
wolflair.com copyright ©1998-2016 Lone Wolf Development, Inc. View our Privacy Policy here.