LuaAPI.wiki
changeset 1074 98156a84cdd9
parent 1073 2b133f66693a
child 1075 5b0cf2c32218
equal deleted inserted replaced
1073:2b133f66693a 1074:98156a84cdd9
    76 Here are some unsorted variables or constants which are available in Lua. You shouldn’t write to most of them.
    76 Here are some unsorted variables or constants which are available in Lua. You shouldn’t write to most of them.
    77 
    77 
    78 || *Identifier* || *Description* ||
    78 || *Identifier* || *Description* ||
    79 || `LAND_WIDTH` || The width of the landscape in pixels ||
    79 || `LAND_WIDTH` || The width of the landscape in pixels ||
    80 || `LAND_HEIGHT` || The height of the landscape in pixels ||
    80 || `LAND_HEIGHT` || The height of the landscape in pixels ||
    81 || `LeftX` || X coordinate of the leftmost point of the landsacpe ||
    81 || `LeftX` || X coordinate of the leftmost point of the landscape ||
    82 || `RightX` || X coordinate of the rightmost point of the landsacpe ||
    82 || `RightX` || X coordinate of the rightmost point of the landscape ||
    83 || `TopY` || Y coordinate of the topmost point of the landsacpe ||
    83 || `TopY` || Y coordinate of the topmost point of the landscape ||
    84 || `CursorX` || The X position of the cursor if the player is choosing a target. Otherwise, this is `-2147483648` ||
    84 || `CursorX` || The X position of the cursor if the player is choosing a target. Otherwise, this is `-2147483648` ||
    85 || `CursorY` || The Y position of the cursor if the player is choosing a target. Otherwise, this is `-2147483648` ||
    85 || `CursorY` || The Y position of the cursor if the player is choosing a target. Otherwise, this is `-2147483648` ||
    86 || `WaterLine` || The y position of the water, used to determine at which position stuff drowns. Use `SetWaterLine` to change. ||
    86 || `WaterLine` || The y position of the water, used to determine at which position stuff drowns. Use `SetWaterLine` to change. ||
    87 || `ClansCount` || Number of clans in the game (teams with the same color belong to one clan) ||
    87 || `ClansCount` || Number of clans in the game (teams with the same color belong to one clan) ||
    88 || `TeamsCount` || Number of teams in the game ||
    88 || `TeamsCount` || Number of teams in the game ||
  1362 
  1362 
  1363 With your report we can fix the shortcoming in future releases. We will try to remove the reliance on `ParseCommand` as good as possible. This will allow scripts to use the previously missing feature in a way that won’t break!
  1363 With your report we can fix the shortcoming in future releases. We will try to remove the reliance on `ParseCommand` as good as possible. This will allow scripts to use the previously missing feature in a way that won’t break!
  1364 
  1364 
  1365 There are many available commands, but only a few of them are useful for scripting. These are commands used in official scripts in 0.9.22:
  1365 There are many available commands, but only a few of them are useful for scripting. These are commands used in official scripts in 0.9.22:
  1366 
  1366 
  1367 * `"skip"`: Current hedgehog skips its turn
  1367  * `"skip"`: Current hedgehog skips its turn
  1368 * `"draw <map>"`: Draws a hand-drawn map. `MapGen` must be `mgDrawn` for this to work. `<map>` is a string which must follow the format specified in [DrawnMapFormat]
  1368  * `"draw <map>"`: Draws a hand-drawn map. `MapGen` must be `mgDrawn` for this to work. `<map>` is a string which must follow the format specified in [DrawnMapFormat]
  1369 
  1369 
  1370 Moreover, the control action names as listed in [ConfigurationFiles] (under “Binds”) can be used. Note we will eventually try to remove all `ParseCommand`s in the official scripts.
  1370 Moreover, the control action names as listed in [ConfigurationFiles] (under “Binds”) can be used. Note we will eventually try to remove all `ParseCommand`s in the official scripts.
  1371 
  1371 
  1372 === <tt>!EndLuaTest(success)</tt> ===
  1372 === <tt>!EndLuaTest(success)</tt> ===
  1373 This function is used by the Hedgewars developers in testing scripts in order to test the game engine. The testing scripts can be found in the Hedgewars source code under `tests/lua`. This function is useless for anything else.
  1373 This function is used by the Hedgewars developers in testing scripts in order to test the game engine. The testing scripts can be found in the Hedgewars source code under `tests/lua`. This function is useless for anything else.