36 *Tip*: If you use the Params library (`/Scripts/Params.lua`), you can make the task of dissecting the string into useful values a bit easier, but it’s not required. (The Params library is not documented yet, however). |
36 *Tip*: If you use the Params library (`/Scripts/Params.lua`), you can make the task of dissecting the string into useful values a bit easier, but it’s not required. (The Params library is not documented yet, however). |
37 |
37 |
38 *Tip*: If you use this callback, make sure to document the interpretation of the parameters so others know how to set the parameters properly. |
38 *Tip*: If you use this callback, make sure to document the interpretation of the parameters so others know how to set the parameters properly. |
39 |
39 |
40 === <tt>onAmmoStoreInit()</tt> === |
40 === <tt>onAmmoStoreInit()</tt> === |
41 This function is called when the game is initialized to request the available ammo and ammo probabilities. Use `SetAmmo` here. |
41 This function is called when the game is initialized to request the available ammo, ammo probabilities and other ammo settings. Use `SetAmmo` here. |
|
42 |
|
43 If you add this event handler, then the weapon scheme (in a multiplayer game) will be ignored, and the settings of all ammos be initialized to the following values: |
|
44 |
|
45 * Initial ammo: 0 |
|
46 * Crate probability: 0 |
|
47 * Number in crate: 0 |
|
48 * Delay: 0 |
|
49 |
|
50 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. |
42 |
51 |
43 === <tt>onNewAmmoStore(team/clan index, hog index)</tt> === |
52 === <tt>onNewAmmoStore(team/clan index, hog index)</tt> === |
44 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. |
53 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. |
45 If `gfSharedAmmo` is set, the parameters passed are the clan index, and `-1`, and the function will be called once for each clan. |
54 If `gfSharedAmmo` is set, the parameters passed are the clan index, and `-1`, and the function will be called once for each clan. |
46 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. |
55 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. |