LuaGears: Add deletion section
authorWuzzy
Wed, 17 Apr 2019 13:33:06 +0100
changeset 1780 1b7b2e1ea829
parent 1779 9cb32a3519ee
child 1781 2d057448d499
LuaGears: Add deletion section
LuaGears.wiki
--- a/LuaGears.wiki	Wed Apr 17 13:29:48 2019 +0100
+++ b/LuaGears.wiki	Wed Apr 17 13:33:06 2019 +0100
@@ -329,41 +329,6 @@
      HideHog(gear) -- Hide the newly created gear.
      RestoreHog(gear) -- Restore the newly hidden gear.</code>
 
-=== <tt>!DeleteGear(gearUid)</tt> ===
-Deletes a gear.  If the specified gear did not exist, nothing happens.
-
-Example:
-
-<code language="lua">    gear = AddGear(...)
-    DeleteGear(gear) -- Delete the newly created gear.</code>
-
-=== <tt>!DeleteVisualGear(vgUid)</tt> ===
-Deletes a visual gear.  If it does not exist, nothing happens. 
-
-Note, most visual gears delete themselves after a while.
-
-
-
-Example:
-
-<code language="lua">    vgear = AddVisualGear(...)
-    DeleteVisualGear(vgear) -- Delete the newly created visual gear.</code>
-
-=== <tt>!SetGearValues(gearUid, Angle, Power, WDTimer, Radius, Density, Karma, DirAngle, AdvBounce, ImpactSound, ImpactSounds, Tint, Damage, Boom)</tt> ===
-Sets various gear value for the specified gear (`gearUid`). The meaining of each value often depends on the gear type. See the documentation on !GetGearValues for a brief description of the gear values. If `gearUid` is invalid or the gear does not exist, nothing happens.
-
-Set `nil` for each value you do not want to change.
-
-Example:
-<code language="lua">
--- Paints all RC planes into a white color
-function onGearAdd(gear)
-    if GetGearType(gear) == gtRCPlane then
-         SetGearValues(gear, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 0xFFFFFFFF)
-    end
-end
-</code>
-
 === <tt>!SetVisualGearValues(vgUid, X, Y, dX, dY, Angle, Frame, !FrameTicks, State, Timer, Tint, Scale)</tt> ===
 This allows manipulation of the internal state of the visual gear `vgUid`. If `vgUid` is invalid or the `vgUid` does not refer to an existing visual gear, the function does nothing. Thus, you can safely call this function even if you are not sure if the visual gear actually exists.
 
@@ -625,3 +590,39 @@
 === <tt>!SetGearPos(gearUid, value)</tt> ===
 Sets the `Pos` value (not the position!) of the specified gear to specified value. See `GetGearPos` for more information.
 
+== Functions to delete gears ==
+=== <tt>!DeleteGear(gearUid)</tt> ===
+Deletes a gear.  If the specified gear did not exist, nothing happens.
+
+Example:
+
+<code language="lua">    gear = AddGear(...)
+    DeleteGear(gear) -- Delete the newly created gear.</code>
+
+=== <tt>!DeleteVisualGear(vgUid)</tt> ===
+Deletes a visual gear.  If it does not exist, nothing happens. 
+
+Note, most visual gears delete themselves after a while.
+
+
+
+Example:
+
+<code language="lua">    vgear = AddVisualGear(...)
+    DeleteVisualGear(vgear) -- Delete the newly created visual gear.</code>
+
+=== <tt>!SetGearValues(gearUid, Angle, Power, WDTimer, Radius, Density, Karma, DirAngle, AdvBounce, ImpactSound, ImpactSounds, Tint, Damage, Boom)</tt> ===
+Sets various gear value for the specified gear (`gearUid`). The meaining of each value often depends on the gear type. See the documentation on !GetGearValues for a brief description of the gear values. If `gearUid` is invalid or the gear does not exist, nothing happens.
+
+Set `nil` for each value you do not want to change.
+
+Example:
+<code language="lua">
+-- Paints all RC planes into a white color
+function onGearAdd(gear)
+    if GetGearType(gear) == gtRCPlane then
+         SetGearValues(gear, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 0xFFFFFFFF)
+    end
+end
+</code>
+