LuaAPI.wiki
changeset 820 cf7f4be0c083
parent 819 80d8736efefa
child 821 2bf17581d46b
equal deleted inserted replaced
819:80d8736efefa 820:cf7f4be0c083
    12 === About this wiki page ===
    12 === About this wiki page ===
    13 This page tends to become outdated. For a list of undocumented functions, see [http://hw.ercatec.net/docs/lua_wiki_check.php].
    13 This page tends to become outdated. For a list of undocumented functions, see [http://hw.ercatec.net/docs/lua_wiki_check.php].
    14 
    14 
    15 <wiki:toc max_depth="4" />
    15 <wiki:toc max_depth="4" />
    16 
    16 
    17 == Overview ==
    17 == Overview ==f
    18 === How Hedgewars handles Lua scripts ===
    18 === How Hedgewars handles Lua scripts ===
    19 As of Version 0.9.20, Hedgewars supports Lua scripts for two similar tasks: Define tutorial missions, campaign missions or provide special map behaviour for precreated maps. It is also used for multiplayer scripts to create new game styles.
    19 As of Version 0.9.20, Hedgewars supports Lua scripts for two similar tasks: Define tutorial missions, campaign missions or provide special map behaviour for precreated maps. It is also used for multiplayer scripts to create new game styles.
    20 
    20 
    21 === Tutorial missions ===
    21 === Tutorial missions ===
    22 Tutorial missions are located within text files inside `share/hedgewars/Data/Missions/Training`. The game will list all files with the lua extension inside this directory in the Training selection screen. You’ll find some premade example scripts within this directory that contain several comments on the script lines and what they do.
    22 Tutorial missions are located within text files inside `share/hedgewars/Data/Missions/Training`. The game will list all files with the lua extension inside this directory in the Training selection screen. You’ll find some premade example scripts within this directory that contain several comments on the script lines and what they do.
  1230 === <tt>bnot(value)</tt> ===
  1230 === <tt>bnot(value)</tt> ===
  1231 Returns the bitwise logical NOT of `value`.
  1231 Returns the bitwise logical NOT of `value`.
  1232 
  1232 
  1233 
  1233 
  1234 == Debugging Functions ==
  1234 == Debugging Functions ==
       
  1235 === `WriteLnToConsole(string)` ===
       
  1236 Writes `string` to `Logs/game0.log`, found in the user data directory.
       
  1237 
       
  1238 === `DumpPoint(x, y)` (0.9.23) ===
       
  1239 Writes the numbers `x` and `y` to `Logs/game0.log, one line each.
  1235 
  1240 
  1236 === <tt>!ParseCommand(string)</tt> ===
  1241 === <tt>!ParseCommand(string)</tt> ===
  1237 Makes the game client parse the specified custom command.
  1242 Makes the game client parse the specified custom command.
  1238 
  1243 
  1239 *Note*: Please be aware that the *engine protocol can (and will) change* between releases.
  1244 *Note*: Please be aware that the *engine protocol can (and will) change* between releases.
  1242 
  1247 
  1243 With your report we can fix the shortcoming in future releases.
  1248 With your report we can fix the shortcoming in future releases.
  1244 This will allow scripts to use the previously missing feature in a way that won’t break!
  1249 This will allow scripts to use the previously missing feature in a way that won’t break!
  1245 
  1250 
  1246 
  1251 
  1247 === `WriteLnToConsole(string)` ===
       
  1248 Writes `string` to the `Logs/game0.log`, found in the user data directory.