• 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

Need help creating a class ability

I'm working on making an activated class ability that applies concealment while active. I've managed to get it applied to the class, it appears correctly in the activated abilities, tracked resources, and everywhere it should appear, but I can't figure out how to get it to apply concealment when I turn it on. I've done everything so far using the basic checkboxes and other fields in the editor, but selecting concealment in the 'special abilities' tab of the 'abilities granted' section doesn't seem to do anything and I don't know how to code the abilities yet, so I could really use some help at this point.
 
What is it you are expecting to see?

As I understand concealment, it imposes a 20% miss chance on attacks. That's not something HeroLab can "apply" to anything, other than providing a text note that the modifier exists. It is then up the GM and players to act on it during play.
 
I'm looking for the ability to turn the concealment condition on while it's active. Obviously I could just go over to the conditions tab and turn it on manually, but I'd rather the ability apply it automatically.
 
It doesn't make much functional difference with concealment, but I feel like it'll be useful to know how to have an ability apply other conditions in the future.
 
You just need to apply a tag to the Hero in a script. Pre-Level/10000 should be fine for this condition.

Code:
~ Turn on Flanking Condition
perform hero.assign[Condition.pstFlankin]

The above turns on the Flanking condition. To find the correct Tag for Concealment you just need to look at the tags on the Concealment condition. Once you find the correct tag id you just replace pstFlankin with the correct tag for Concealment.

From inside of Hero Lab go to the menu "Develop->Enable Data File Debugging". If you are doing any editor work you want this option on.

Then RIGHT click on the "?" field of Concealment and select "Show Tags"....
 
The script on Concealment is at Final/20000, so I don't think this needs to run as early as ShadowChemosh says - this is a class special, so it should be fine to use the usual Post-Level/10000 timing for this script.
 
Hey shadow, thanks for the help.
I put this in with the id for concealment and the ability turns on concealment passively, how can I make it so that concealment only applies when I turn on the ability in the 'activated abilities' tab?
 
Why don't you post your script (with the phase & priority you're using for it), and we can help you figure out what the script is or is not doing.
 
I'm using exactly what ShadowChemosh posted, with Flanking replaced with Concealment.
Code:
~ Turn on Concealment Condition

perform hero.assign[Condition.pstConceal]
The phase and priority is pre-level/10000. It works in that having the ability turns on concealment, but concealment is always on as long as you have the ability rather than only when the ability is activated. I included the .user file if that'll help. The ability I'm working on is Void Haze (the only class ability so far).
 

Attachments

You need "Stop" script logic to prevent the script from running or it will execute always.

If this is on a Class Ability like Mathias said. I admit I missed that. Then you need to add standard Class Ability stop scripts to make sure the ability only runs when the class is the correct level.

Code:
      ~ If we're not shown, just get out now
      doneif (tagis[Helper.ShowSpec] <> 1)
      ~ if we've been disabled, get out now
      doneif (tagis[Helper.SpcDisable] <> 0)
The above scripts do that.

But now you have the ability turning on/off from the In-Play tab. So you need additional stop script logic to support that.
Code:
~ If not activated get out now!
doneif (field[abilActive].value = 0)

Then put this all together with the correct timing of Post-Level/10000 and you get this:

Code:
~ If we're not shown, just get out now
doneif (tagis[Helper.ShowSpec] <> 1)
~ if we've been disabled, get out now
doneif (tagis[Helper.SpcDisable] <> 0)
~ If not activated get out now!
doneif (field[abilActive].value = 0)

~ Turn on Concealment Condition
perform hero.assign[Condition.pstConceal]

To get this all to work you MUST be running at Post-Level/10000 or later timing. Very important. :)
 
Back
Top