Lone Wolf Development Forums  

Go Back   Lone Wolf Development Forums > Hero Lab Forums > HL - Authoring Kit
Register FAQ Community Today's Posts Search

Notices

Reply
 
Thread Tools Display Modes
RayPrancer
Member
 
Join Date: Jun 2007
Location: United Kingdom
Posts: 80

Old March 7th, 2010, 09:50 AM
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 by RayPrancer; March 7th, 2010 at 09:54 AM. Reason: Tested code, didn't work.
RayPrancer is offline   #1 Reply With Quote
RayPrancer
Member
 
Join Date: Jun 2007
Location: United Kingdom
Posts: 80

Old March 7th, 2010, 10:17 AM
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.
RayPrancer is offline   #2 Reply With Quote
rob
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 8,232

Old March 7th, 2010, 12:48 PM
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!
rob is offline   #3 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 02:44 PM.


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