MinMaxFormat





Some scripts retun values in what is called the Min/Max Format. Before calling such scripts the engine sets the minimum and the maximum to values that depend on the particular 'Hook', as specified the the hook's description. Then it calls the scripts and the results of a script can modify the minimum, maximum, both, or neither.

These scripts can return an absolute number such as "12", a minimum number such as ">2", a maximum number such as "<14", or a combination of minimum and maximum such as "<14>2". Returning an empty string causes nothing to change. ">2" means 3, 4, 5,.... and "<6" means 0, 1, 2, 3, 4, or 5.

If a number is reutrned and it is within the current min/max then both min and max are set to that number. If min and/or max are specified and are within the current min/max range then the current min/max values are changed. Any numbers outside the current min/max are ignored. After all scripts have been called, the hook uses the resulting minimum and maximum in the way specified by the hook's description.

As a result of this algorithm, the order that multiple scripts are called is important. For example, if two scripts return the values "5" and "7" then the first script to be called will take precedence.