# HG changeset patch # User Wuzzy # Date 1683902237 0 # Node ID 4e49d93377fd964615715f939f202311cbc31dcd # Parent 57453f1d37cf1f1a6aeb20a5dc9fe7420fd6c688 LuaEvents: Rewrite onNewAmmoStore help diff -r 57453f1d37cf -r 4e49d93377fd LuaEvents.wiki --- a/LuaEvents.wiki Fri Apr 07 19:39:42 2023 +0300 +++ b/LuaEvents.wiki Fri May 12 14:37:17 2023 +0000 @@ -50,14 +50,15 @@ 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. -=== onNewAmmoStore(team/clan index, hog index) === -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. -If `gfSharedAmmo` is set, the parameters passed are the clan index, and `-1`, and the function will be called once for each clan. -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. -If neither is set, the parameters passed are the team index and `-1`, and the function will be called once for each team. +=== onNewAmmoStore(teamOrClanIndex, hogIndex) === +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. + + * If `gfSharedAmmo` is set, then `teamOrClanIndex` is the clan index and `hogIndex` is `-1`. The function will be called once for each clan. + * 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. + * If neither is set, then `teamsOrClanIndex` is the team index and `hogIndex` is `-1`. The function will be called once for each team. 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. -If you add this hook, the expectation is that you will call SetAmmo appropriately. Any values from `onAmmoStoreInit` are ignored. +If you add this hook, the expectation is that you will call `SetAmmo` appropriately. Any values from `onAmmoStoreInit` are ignored. == Time events == === onGameTick() ===