944 SetAmmo(amGrenade, 0, 0, 0, 3) -- crates should contain always three grenade</code> |
944 SetAmmo(amGrenade, 0, 0, 0, 3) -- crates should contain always three grenade</code> |
945 |
945 |
946 ==== <tt>!SetAmmoDelay(ammoType, delay)</tt> ==== |
946 ==== <tt>!SetAmmoDelay(ammoType, delay)</tt> ==== |
947 Changes the delay of a specified [AmmoTypes Ammo Type]. |
947 Changes the delay of a specified [AmmoTypes Ammo Type]. |
948 |
948 |
|
949 ==== <tt>!SetAmmoTexts(ammoType, name, caption, description)</tt> (0.9.23) ==== |
|
950 Allows you to overwrite the displayed name and tooltip descriptions of a given ammo type. |
|
951 |
|
952 * `ammoType`: The ammo type to set the text for |
|
953 * `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. |
|
954 * `caption`: The second line in the ammo menu (below the title). E.g. “Timed grenade” for `amGrenade`. |
|
955 * `description`: Description text in ammo menu, below the caption. |
|
956 |
|
957 `title`, `caption`, `description` can be `nil`, in which case they will be reverted to the engine default value. This function returns `nil`. |
|
958 |
|
959 Example: |
|
960 <code language="lua"> |
|
961 -- Overwrites bazooka name and description |
|
962 SetAmmoTexts(amBazooka, "Spoon Missile", "Crazy weapon", "This crazy weapon looks like a spoon and explodes on impact.|Attack: Hold to launch with more power")</code> |
|
963 |
|
964 ==== <tt>!SetAmmoDescriptionAppendix(ammoType, descAppend)</tt> (0.9.23) ==== |
|
965 Will set a string `descAppend` to be appended below the “core” description (ammo tooltip) of the specified `ammoType`, without changing the ordinary description. |
|
966 Note that calling this function always sets the complete appended string, you can't use this function to append multiple texts in row. |
|
967 |
|
968 This function is recommended if you heave tweaked an existing ammo type only a little and want to keep the original description intact as much as possible. |
|
969 |
|
970 Example: |
|
971 <code language="lua"> |
|
972 -- Appends a text to the ammo tooltip of the bazooka but leaves name and main description intact |
|
973 SetAmmoTexts(amBazooka, "This weapon deals double the damage than usually.")</code> |
|
974 |
949 ==== <tt>!AddAmmo(gearUid, ammoType, ammoCount) (0.9.16) </tt> ==== |
975 ==== <tt>!AddAmmo(gearUid, ammoType, ammoCount) (0.9.16) </tt> ==== |
950 Adds `ammoType` to the specified gear. The amount added is determined by the arguments passed via `SetAmmo()` in the `onAmmoStoreInit()` event handler. In 0.9.16 ammo can be set directly via the optional third parameter, `ammoCount`. A value of 0 will remove the weapon, a value of 100 will give infinite ammo. |
976 Adds `ammoType` to the specified gear. The amount added is determined by the arguments passed via `SetAmmo()` in the `onAmmoStoreInit()` event handler. In 0.9.16 ammo can be set directly via the optional third parameter, `ammoCount`. A value of 0 will remove the weapon, a value of 100 will give infinite ammo. |
951 |
977 |
952 *Note:* The effectiveness of this function may be limited due to problems with `gfPerHogAmmo` in Lua scripting. |
978 *Note:* The effectiveness of this function may be limited due to problems with `gfPerHogAmmo` in Lua scripting. |
953 |
979 |
954 ==== <tt>!GetAmmoName(ammoType)</tt> (0.9.23) ==== |
980 ==== <tt>!GetAmmoName(ammoType [, ignoreOverwrite ])</tt> (0.9.23) ==== |
955 Returns the localized name for the specified `ammoType`. |
981 Returns the localized name for the specified `ammoType`, taking an ammo name overwritten by `SetAmmoTexts` into account. If `ignoreOverwrite` is `true`, this function will always return the original ammo name of the weapon and ignores names which may have been overwritten by `SetAmmoTexts`. |
956 |
982 |
957 === Map === |
983 === Map === |
958 ==== <tt>!MapHasBorder()</tt> ==== |
984 ==== <tt>!MapHasBorder()</tt> ==== |
959 Returns `true`/`false` if the map has a border or not. |
985 Returns `true`/`false` if the map has a border or not. |
960 |
986 |