Lone Wolf Development Forums

Lone Wolf Development Forums (http://forums.wolflair.com/index.php)
-   HL - Pathfinder Roleplaying Game (http://forums.wolflair.com/forumdisplay.php?f=62)
-   -   Different between Phase and Priority? (http://forums.wolflair.com/showthread.php?t=64532)

Aril July 15th, 2020 09:01 PM

Different between Phase and Priority?
 
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?

Minous 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,

Mathias 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 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 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.

Daniel V 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.


All times are GMT -8. The time now is 09:42 AM.

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