LuaEvents.wiki
changeset 2223 4e49d93377fd
parent 2114 cbb1fde40368
child 2231 f00c578955f7
equal deleted inserted replaced
2222:57453f1d37cf 2223:4e49d93377fd
    48  * Number in crate: 0
    48  * Number in crate: 0
    49  * Delay: 0
    49  * Delay: 0
    50 
    50 
    51 If this event handler is *not* present, then the game will use the weapon scheme that the player selected (in multiplayer games). In missions, all ammos are always initialized at 0 by default, even without this event handler.
    51 If this event handler is *not* present, then the game will use the weapon scheme that the player selected (in multiplayer games). In missions, all ammos are always initialized at 0 by default, even without this event handler.
    52 
    52 
    53 === <tt>onNewAmmoStore(team/clan index, hog index)</tt> ===
    53 === <tt>onNewAmmoStore(teamOrClanIndex, hogIndex)</tt> ===
    54 This function is identical to `onAmmoStoreInit` in function, but is called once per ammo store.  This allows different ammo sets for each clan, team or hedgehog depending on the mode.
    54 This function is identical to `onAmmoStoreInit` in functionality, but is called once per ammo store.  This allows different ammo sets for each clan, team or hedgehog depending on the mode.
    55 If `gfSharedAmmo` is set, the parameters passed are the clan index, and `-1`, and the function will be called once for each clan.
    55 
    56 If `gfPerHogAmmo` is set, the parameters passed are the team index and the hog index in that team, and the function will be called once for each hedgehog.
    56  * If `gfSharedAmmo` is set, then `teamOrClanIndex` is the clan index and `hogIndex` is `-1`. The function will be called once for each clan.
    57 If neither is set, the parameters passed are the team index and `-1`, and the function will be called once for each team.
    57  * If `gfPerHogAmmo` is set, then`teamOrClanIndex` is the team index and `hogIndex` is the hog index in that team. The function will be called once for each hedgehog.
       
    58  * If neither is set, then `teamsOrClanIndex` is the team index and `hogIndex` is `-1`. The function will be called once for each team.
    58 
    59 
    59 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.
    60 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.
    60 If you add this hook, the expectation is that you will call SetAmmo appropriately. Any values from `onAmmoStoreInit` are ignored.
    61 If you add this hook, the expectation is that you will call `SetAmmo` appropriately. Any values from `onAmmoStoreInit` are ignored.
    61 
    62 
    62 == Time events ==
    63 == Time events ==
    63 === <tt>onGameTick()</tt> ===
    64 === <tt>onGameTick()</tt> ===
    64 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`.
    65 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`.
    65 
    66