Lone Wolf Development Forums  

Go Back   Lone Wolf Development Forums > Hero Lab Forums > HL - Pathfinder Roleplaying Game


Thread Tools Display Modes
Join Date: Jul 2019
Posts: 77

Old July 15th, 2020, 09:01 PM
What is the difference between Phase and Priority?

I'm trying to get an ability to work, and it's just not working, despite the fact that I *think* the code is right.

I started thinking that because I'm trying to add an ability that scales with level, it needs to be in a Phase that takes place *after* levels are calculated.

So I switched it to "Post-Levels".

But I'm not sure what the *Priority* should be. Does Priority even make a difference?
Aril is offline   #1 Reply With Quote
Senior Member
Join Date: May 2015
Posts: 789

Old July 16th, 2020, 03:47 AM
Imagine the compile process as a line, each phase is a segment, anything in that segment gets completed before the start of the next. Timing gives a location within a segment. Finally Priority is used when multiple things happen at the same phase/timing and order matters. Lets say your thing creates a variable in an eval-script at Post-level/10000/1 now you need a second eval-script to modify it. (You could probably lump everything together but breaking it up makes it easier to follow) so you would set it to Post-level/10000/2 and it is now guaranteed to run after script.

I used the Phase/Timing/Priority notation above,
Minous is offline   #2 Reply With Quote
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 12,895

Old July 16th, 2020, 07:34 AM
Minous - I'm not sure what you mean by "Timing". If you mean "Index", that is only an identifier - it's used so that when reporting script errors, HL can tell you it's in script #1 vs. script #2 on this particular pick, and has nothing to do with the order things are run in.

Two different scripts that are both set to the same phase and priority will be assigned to be first and second according to some internal rules that are not easy to analyze or discover. You should not count on the order you observe them running in on a particular character at a particular time staying the same if a different user used that same combination on a different character.
Mathias is offline   #3 Reply With Quote
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 12,895

Old July 16th, 2020, 07:35 AM
But other than that, Minous is correct - the phase & priority combination is how you decide that this script happens before that script, so that you can look up the results of one script before running the other.
Mathias is offline   #4 Reply With Quote
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 12,895

Old July 16th, 2020, 07:39 AM
My rule of thumb for priority selection is to default to 10000. I try my best not to use priorities that are not a multiple of 1000, unless there's a specific pair of other scripts I'm trying to get in-between, which forces me to pick a priority number that's between two other numbers, like a script that needs to operate between other scripts at Post-Levels/9000 and Post-Levels/10000.
Mathias is offline   #5 Reply With Quote
Daniel V
Senior Member
Lone Wolf Staff
Join Date: Apr 2020
Posts: 130

Old July 17th, 2020, 10:57 AM
Also of note, if you're not able to group multiple scripts together in the same Priority for some reason (which is better for running them), it's generally better to have them run at different Priorities, rather than just a different Index. This allows other scripts to be run between them as needed to modify parts. Probably not really applicable to anything you're doing, but a good habit none the less.
Daniel V is offline   #6 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 08:12 AM.

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