LuaGameplay.wiki
changeset 2255 3b53cfb51850
parent 2254 6f6f15fb33d5
child 2256 54f89e50129d
equal deleted inserted replaced
2254:6f6f15fb33d5 2255:3b53cfb51850
   109 -- Fake explosion which only pushes gears but deals no damage to gears and terrain
   109 -- Fake explosion which only pushes gears but deals no damage to gears and terrain
   110 Explode(500, 1000, 50, EXPLAutoSound + EXPLNoDamage + EXPLDontDraw)
   110 Explode(500, 1000, 50, EXPLAutoSound + EXPLNoDamage + EXPLDontDraw)
   111 
   111 
   112 -- Erase a circle of land without side effects
   112 -- Erase a circle of land without side effects
   113 Explode(500, 100, 100, EXPLNoDamage + EXPLDoNotTouchAny + EXPLNoGfx)
   113 Explode(500, 100, 100, EXPLNoDamage + EXPLDoNotTouchAny + EXPLNoGfx)
       
   114 </code>
       
   115 
       
   116 == <tt>!GetEngineString(stringType, msgId)</tt> (1.1.0-dev) ==
       
   117 Returns a string that is used in the engine in localized form. For example, "Round draw!". Useful to avoid repeating common gameplay-relevant texts in Lua which reduces redundancy.
       
   118 
       
   119  * `stringType`: One of:
       
   120   * `"TMsgStrId"` for basic messages (section `01` in `en.txt`) or
       
   121   * `"TGoalStrId"` for strings used to describe game rules in the mission panel (section `05` in `en.txt`) 
       
   122  * `msgId`: The corresponding message ID (see https://hg.hedgewars.org/hedgewars/file/tip/hedgewars/uTypes.pas for a list of IDs; look for `TMsgStrId` and `TGoalStrId`)
       
   123 
       
   124 Example:
       
   125 <code language="lua">
       
   126 -- Shows the "round draw" text from the engine, localized to the player's language
       
   127 AddCaption(GetEngineString("TMsgStrId", sidDraw), capcolDefault, capgrpGameState)
   114 </code>
   128 </code>
   115 
   129 
   116 == Ammo ==
   130 == Ammo ==
   117 === <tt>!SetAmmo(ammoType, count, probability, delay, numberInCrate)</tt> ===
   131 === <tt>!SetAmmo(ammoType, count, probability, delay, numberInCrate)</tt> ===
   118 This updates the settings (initial ammo, crate probability, etc.) for a specified [AmmoTypes ammo type]. This must only be used in the `onAmmoStoreInit()` [LuaEvents event handler]. In other places, this function will not work.
   132 This updates the settings (initial ammo, crate probability, etc.) for a specified [AmmoTypes ammo type]. This must only be used in the `onAmmoStoreInit()` [LuaEvents event handler]. In other places, this function will not work.