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

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,213

Old December 9th, 2013, 09:50 AM
This article is part of a collection of editor and scripting articles: http://forums.wolflair.com/showthread.php?t=21688

Bootstrap conditions are used when you want to add a certain thing to the hero, but not all the time - you want to add it only while certain circumstances apply.

When making a bootstrap conditional, first, test this ability without the condition - make sure you've got everything working, and make sure it's adding the bootstrap all the time, and that the bootstrapped thing or things are all showing up correctly.

In the editor, press the "Bootstraps" button at the top right - find the bootstrap you want to make conditional, and press the "Condition..." button.

Like scripts, bootstrap conditions have a phase and priority. So your first step is to look at the conditions that you want to have satisfied - what phase and priority will they be satisfied by? You need your bootstrap condition to come AFTER that. Next, you need to look at the thing you are bootstrapping, that you want to make conditional. Make sure you have "Enable Data File Debugging" turned on in the Develop menu, and then right-click the thing you're bootstrapping. Choose the "Show Debug Tasks for XXXXX" option from the right-click menu, and look at the list of scripts on that thing. Your bootstrap condition must come BEFORE all of those.

If you're not sure what phase & priority to choose, the default I use in Pathfinder & d20 is First/500, and in Shadowrun & Cortex, I default to Initialize/1000. Looking through the Savage Worlds files, a default hasn't really been established yet, so I'd recommend Initialize/1000.

Next, writing the "Tag Expression" for the bootstrap. First, be aware that this is not normal Hero Lab scripting - you're NOT using field[something].value or tagis[XXXX.YYYY], or the other tests you're used to. The place you're probably familiar with tag expressions from is foreaches - the 'where "something"' that's at the end of foreaches - the "something" part is a tag expression.

About the context of these tag expressions - a bootstrap condition is testing the tags and fields on the pick that is doing the bootstrapping. There's a way to test the tags on the hero (I'll get to that later), but those are the only things you can test using bootstrap conditions - the tags on the thing doing the bootstrapping, the fields on the thing doing the bootstrapping, or the tags on the hero.

Here's the wiki page about tag expressions, if you want to read about them in detail: http://hlkitwiki.wolflair.com/index....ag_Expressions

Here are some common examples - hopefully this will cover 85% of the cases:

Is a tag present?
Code:
Group.Tag
or
Code:
Group.Tag <> 0
(If you just use the simpler version, the <> 0 is implied).

Do we have a certain number of a tag:
Code:
count:Group.Tag >= #
In Pathfinder and d20, this is common - "When we reach level 3, we get this feat" - here's the example for a level 3 Ranger's bonus Endurance feat:
Code:
count:Classes.Ranger >= 3
Is a field's value at least a certain amount (you can also use <, <=, =, >=, >, or <>):
Code:
fieldval:Field >= #
This one is very common, since a lot of bootstrap conditions will be testing whether or not this ability has been turned on on the In-Play tab. Here's that specific example:
Code:
fieldval:abilActive <> 0
Is a certain tag present on the hero?
Code:
hero#Tag.Group
or
Code:
hero#Tag.Group <> 0
This one's also common - for example, for a d20/Pathfinder barbarian, "While we're raging" - here's that example:
Code:
hero#Hero.Raging
These can be combined - here's "This can only be used during a rage, and the user turns this particular ability on using the in-play tab":
Code:
hero#Hero.Raging & (fieldval:abilActive <> 0)
(If you only tested fieldval:abilActive <> 0, what could happen is that the user goes into a rage, and then turns on this ability - then, they turn off their rage, forgetting to also turn off this ability. If you were only testing fieldval:abilActive <> 0, then the conditional bootstrap would continue to be added, even though the character isn't raging anymore).
Mathias is offline   #1 Reply With Quote
 


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 04:43 AM.


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