# HG changeset patch # User Wuzzy # Date 1534892546 -3600 # Node ID 1b32e9ff8adf7497e8acd008226cffe906ba0688 # Parent 1840cbe874bb4efab7ce38bb6f4b07fe9647a5f5 LuaAPI: Define gears diff -r 1840cbe874bb -r 1b32e9ff8adf LuaAPI.wiki --- a/LuaAPI.wiki Tue Aug 21 23:58:55 2018 +0100 +++ b/LuaAPI.wiki Wed Aug 22 00:02:26 2018 +0100 @@ -396,7 +396,8 @@ == Functions for creating gears == === !AddGear(x, y, gearType, state, dx, dy, timer) === -This creates a new gear at position x,y (measured from top left) of kind `gearType` (see [GearTypes Gear Types]). The initial velocities are `dx` and `dy`. All arguments are numbers. The function returns the `uid` of the gear created. Gears can have multple states at once: `state` is a bitmask, the flag variables can be found in [States]. +This creates a new gear at position x,y (measured from top left) of kind `gearType` (see [GearTypes Gear Types]). Gears are dynamic objects or events in the world that affect the gameplay, including hedgehogs, projectiles, weapons, land objects, active utilities and a few more esoteric things. +The initial velocities are `dx` and `dy`. All arguments are numbers. The function returns the `uid` of the gear created. Gears can have multple states at once: `state` is a bitmask, the flag variables can be found in [States]. Example: @@ -404,7 +405,7 @@ FindPlace(gear, true, 0, LAND_WIDTH) === !AddVisualGear(x, y, visualGearType, state, critical [, layer]) === -This attempts to create a new visual gear at position x,y (measured from top left) of kind `visualGearType` (see [VisualGearTypes Visual Gear Types]). Visual gears are decorational objects which are usually used for purely decorational graphical effects. They have no effect on gameplay. +This attempts to create a new visual gear at position x,y (measured from top left) of kind `visualGearType` (see [VisualGearTypes Visual Gear Types]). Visual gears are decorational objects which are usually used for purely decorational graphical effects. They have no effect on gameplay. Visual gears are not the same as gears, but they share some similarities. The function returns the `uid` of the visual gear created or `nil` if creation failed. There is no guarantee that a visual gear will spawn. *IMPORTANT: Do not rely on visual gears to spawn*. *Always* be prepared for this function to return `nil`.