Lone Wolf Development Forums  

Go Back   Lone Wolf Development Forums > Hero Lab Forums > HL - Authoring Kit


Thread Tools Display Modes
Junior Member
Join Date: Aug 2020
Posts: 8

Old October 9th, 2020, 07:10 PM
I'm trying to resolve exactly how the timing of evaluated code is determined, as there appear to be multiple, potentially conflicting, definitions.

For example, if we have an <eval> tag within a <field>, then the timing of the execution of this code is determined by the "phase" and "priority" tags on the <eval> tag. So, within a given phase, all code fragments with the same priority are executed one after the other.

Now, I see that the tags <before> and <after> are also allowed, which define other code fragments that must be executed "before" or "after" this fragment.

My confusion comes from the fact that these two systems are potentially ambiguous, as the <before> and <after> tags do not consider the "phase" that the code is executing under. For example, I can't possibly execute a code fragment "before" this one if the code is defined to be executed in a phase after the current phase. Similarly, if the phase is the same, but the priority values are in conflict, what happens?

So what's the actually definition of these <before> and <after> tags. Do they only apply to code fragments within the same phase/priority group? Do the tags just get ignored otherwise?

Also, what happens for <eval> (and other tags) that don't have a "phase" and/or "priority" defined? Is there a default value for these fields?

Thanks for your help...
eastsydneyboy is offline   #1 Reply With Quote
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,056

Old October 14th, 2020, 09:26 AM
The before and after are tools to help you pick the right phase and priority for a script, and to keep track of which scripts depend on values generated by other scripts. If you've set a reminder that X must come before this, and then you change the phase and priority of X so that it's now after the script with the before, HL will notify you of that at compile time - helps you keep track of your dependencies when you've got hundreds of them, and really helps when you end up with a dependency chain that's 3 or 4 items long, and you find you need to modify the timing of the second one in the chain, because a new script needs to be inserted in the middle of the chain.

The default phase and priority varies by game (it's set in definition.def), but it's usually ultra-early, like it's First/100 in PF1 and d20 and First/1000 in Shadowrun. I consider it very bad practice to ever make use of those defaults, though - it causes so many problems with scripts depending on the results of other scripts to have a group of scripts bunched up at the same phase/priority - it makes it a real hassle to de-tangle timing dependencies once you end up adding something else that has to make use of the results of one of those scripts, and another thing that is needed by that same script.

Last edited by Mathias; October 14th, 2020 at 09:44 AM.
Mathias is offline   #2 Reply With Quote

Thread Tools
Display Modes

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 07:28 AM.

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