377 Example: |
377 Example: |
378 |
378 |
379 <code language="lua"> local gear = AddGear(0, 0, gtTarget, 0, 0, 0, 0) |
379 <code language="lua"> local gear = AddGear(0, 0, gtTarget, 0, 0, 0, 0) |
380 FindPlace(gear, true, 0, LAND_WIDTH)</code> |
380 FindPlace(gear, true, 0, LAND_WIDTH)</code> |
381 |
381 |
382 === <tt>!AddVisualGear(x, y, visualGearType, state, critical)</tt> === |
382 === <tt>!AddVisualGear(x, y, visualGearType, state, critical [, layer])</tt> === |
383 This creates a new visual gear at position x,y (measured from top left) of kind `visualGearType` (see [VisualGearTypes Visual Gear Types]). The function returns the `uid` of the visual gear created. Set `critical` to `true` if the visual gear is crucial to game play. Use `false` if it is just an effect, and can be skipped when in fast-forward mode (such as when joining a room). A critical visual gear will always be created, a non-critical one may fail. Most visual gears delete themselves. |
383 This creates a new visual gear at position x,y (measured from top left) of kind `visualGearType` (see [VisualGearTypes Visual Gear Types]). The function returns the `uid` of the visual gear created. Set `critical` to `true` if the visual gear is crucial to game play. Use `false` if it is just an effect, and can be skipped when in fast-forward mode (such as when joining a room). A critical visual gear will always be created, a non-critical one may fail. Most visual gears delete themselves. You can set an optional `layer` to specify which visual gears get drawn on top. |
384 |
384 |
385 Example: |
385 Example: |
386 |
386 |
387 <code language="lua"> -- adds an non-critical explosion at position 1000,1000. Returns 0 if it was not created. |
387 <code language="lua"> -- adds an non-critical explosion at position 1000,1000. Returns 0 if it was not created. |
388 vgear = AddVisualGear(1000, 1000, vgtExplosion, 0, false) |
388 vgear = AddVisualGear(1000, 1000, vgtExplosion, 0, false) |