LuaEvents.wiki
changeset 1775 9a5472760632
parent 1774 086bebb89963
child 1795 12e1aa6294d7
equal deleted inserted replaced
1774:086bebb89963 1775:9a5472760632
    45 If neither is set, the parameters passed are the team index and `-1`, and the function will be called once for each team.
    45 If neither is set, the parameters passed are the team index and `-1`, and the function will be called once for each team.
    46 
    46 
    47 These indexes can be used to look up details of the clan/team/hedgehog prior to gear creation. Routines to do these lookups will be created as needed.
    47 These indexes can be used to look up details of the clan/team/hedgehog prior to gear creation. Routines to do these lookups will be created as needed.
    48 If you add this hook, the expectation is that you will call SetAmmo appropriately. Any values from `onAmmoStoreInit` are ignored.
    48 If you add this hook, the expectation is that you will call SetAmmo appropriately. Any values from `onAmmoStoreInit` are ignored.
    49 
    49 
    50 == Game events ==
    50 == Time events ==
    51 === <tt>onGameTick()</tt> ===
    51 === <tt>onGameTick()</tt> ===
    52 This function is called on every game tick, i.e. 1000 times a second. If you just need to check on something periodically, consider `onGameTick20`.
    52 This function is called on every game tick, i.e. 1000 times a second. If you just need to check on something periodically, consider `onGameTick20`.
    53 
    53 
    54 === <tt>onGameTick20()</tt> ===
    54 === <tt>onGameTick20()</tt> ===
    55 This function is called every 20 game ticks, which equals 50 times a second. It reduces Lua overhead for simple monitoring that doesn’t need to happen every single tick.
    55 This function is called every 20 game ticks, which equals 50 times a second. It reduces Lua overhead for simple monitoring that doesn’t need to happen every single tick.
    56 
    56 
       
    57 == Game events ==
    57 === <tt>onNewTurn()</tt> ===
    58 === <tt>onNewTurn()</tt> ===
    58 This function calls at the start of every turn. You can set `ReadyTimeLeft` here to change the ready time for this turn. (See also: `Ready`)
    59 This function calls at the start of every turn. You can set `ReadyTimeLeft` here to change the ready time for this turn. (See also: `Ready`)
    59 
    60 
    60 === <tt>onEndTurn()</tt> (0.9.24) ===
    61 === <tt>onEndTurn()</tt> (0.9.24) ===
    61 This function calls at the end of every turn. The end of a turn is defined as the point of time after the current hedgehog lost control and all the important gears are either gone or have settled.
    62 This function calls at the end of every turn. The end of a turn is defined as the point of time after the current hedgehog lost control and all the important gears are either gone or have settled.