Grand Prix Rank Points Hook
This merge request adds a hook to the game called GPRankPoints
. This hook can be used to modify scoring used in Grand Prix mode and online when PWRLV is disabled. The hook provides rank position, number of total active players in the lobby, and vanilla points output. Returning a number overwrites the points given.
The rationale for why I run the hook later is to allow points to be read in this hook which could be used for all sorts of things coding wise such as having an action trigger when someone earns a certain amount of points or to add bonus points to the vanilla score calculation.
Hook Format:addHook("GPRankPoints", functionname)
Function Format: function(int position, int numplayers, int points)
Example scripts:
gprankhooknoreturn.lua shows what happens when you don't return (or return nil) with the hook. It prints a message if someone is in first place and earns more then one point.
gpranpointstest.lua shows how this hook can be used to modify points. It modifies the scores of people in the first 3 positions and gives everyone zero points, turning off the phtest_overwrite CVAR makes it add these bonus instead of replacing