1134 <code language="lua">count, prob, delay, numberInCrate = GetAmmo(amGrenade) -- Get ammo settings of amGrenade</code> |
1134 <code language="lua">count, prob, delay, numberInCrate = GetAmmo(amGrenade) -- Get ammo settings of amGrenade</code> |
1135 |
1135 |
1136 ==== <tt>!SetAmmoDelay(ammoType, delay)</tt> ==== |
1136 ==== <tt>!SetAmmoDelay(ammoType, delay)</tt> ==== |
1137 Changes the delay of a specified [AmmoTypes Ammo Type]. |
1137 Changes the delay of a specified [AmmoTypes Ammo Type]. |
1138 |
1138 |
1139 ==== <tt>!SetAmmoTexts(ammoType, name, caption, description)</tt> (0.9.23) ==== |
1139 ==== <tt>!SetAmmoTexts(ammoType, name, caption, description [, showExtra])</tt> (0.9.23) ==== |
1140 Allows you to overwrite the displayed name and tooltip descriptions of a given ammo type. This function must only be called either inside the `onGameStart` callback function, or after the engine has called `onGameStart`. |
1140 Allows you to overwrite the displayed name and tooltip descriptions of a given ammo type. This function must only be called either inside the `onGameStart` callback function, or after the engine has called `onGameStart`. |
1141 |
1141 |
1142 * `ammoType`: The ammo type to set the text for |
1142 * `ammoType`: The ammo type to set the text for |
1143 * `name`: Name of the ammo type (e.g. “Grenade” for `amGrenade`), affects both name in ammo menu and in the “ticker” message on the screen top. |
1143 * `name`: Name of the ammo type (e.g. “Grenade” for `amGrenade`), affects both name in ammo menu and in the “ticker” message on the screen top. |
1144 * `caption`: The second line in the ammo menu (below the title). E.g. “Timed grenade” for `amGrenade`. |
1144 * `caption`: The second line in the ammo menu (below the title). E.g. “Timed grenade” for `amGrenade`. |
1145 * `description`: Description text in ammo menu, below the caption. |
1145 * `description`: Description text in ammo menu, below the caption. |
|
1146 * `showExtra`: If `false` the special “extra” text line like “Weapon is not yet available” or “Weapon does not end turn” will be suppressed |
1146 |
1147 |
1147 `title`, `caption`, `description` can be `nil`, in which case they will be reverted to the engine default value. This function returns `nil`. |
1148 `title`, `caption`, `description` can be `nil`, in which case they will be reverted to the engine default value. This function returns `nil`. |
1148 |
1149 |
1149 Example: |
1150 Example: |
1150 <code language="lua"> |
1151 <code language="lua"> |