LuaAPI.wiki
changeset 637 8a18ff3d8024
parent 636 55b08e9ee152
child 638 9f17dc37a141
equal deleted inserted replaced
636:55b08e9ee152 637:8a18ff3d8024
   548 === <tt>!GetGearValues(gearUid)</tt> (0.9.22) ===
   548 === <tt>!GetGearValues(gearUid)</tt> (0.9.22) ===
   549 This returns a bunch of values associated with the gear, their meaning is often depending on the gear type and many values might be unused for certain gear types.
   549 This returns a bunch of values associated with the gear, their meaning is often depending on the gear type and many values might be unused for certain gear types.
   550 
   550 
   551 This is returned (all variables are integers):
   551 This is returned (all variables are integers):
   552 
   552 
   553 `Angle, Power, WDTimer, Radius, Density, Karma, DirAngle, AdvBounce, ImpactSound, nImpactSounds, Tint`
   553 `Angle, Power, WDTimer, Radius, Density, Karma, DirAngle, AdvBounce, ImpactSound, nImpactSounds, Tint, Damage`
   554 
   554 
   555 A rough description of some of the parameters:
   555 A rough description of some of the parameters:
   556 
   556 
   557  * `Radius`: Effect or collision radius, most of the time
   557  * `Radius`: Effect or collision radius, most of the time
   558  * `ImpactSound`: Sound it makes on a collision (see [Sounds])
   558  * `ImpactSound`: Sound it makes on a collision (see [Sounds])
   559  * `Tint`: Used by some gear types to determine its colorization. The color is in RGBA format.
   559  * `Tint`: Used by some gear types to determine its colorization. The color is in RGBA format.
   560 
   560 
   561 Example:
   561 Example:
   562 <code language="lua">
   562 <code language="lua">
   563 -- Get all values in a single line of code:
   563 -- Get all values in a single line of code:
   564 local Angle, Power, WDTimer, Radius, Density, Karma, DirAngle, AdvBounce, ImpactSound, nImpactSounds, Tint = GetGearValues(myGear)
   564 local Angle, Power, WDTimer, Radius, Density, Karma, DirAngle, AdvBounce, ImpactSound, nImpactSounds, Tint, Damage = GetGearValues(myGear)
   565 </code>
   565 </code>
   566 
   566 
   567 === <tt>!GetVisualGearValues(vgUid)</tt> ===
   567 === <tt>!GetVisualGearValues(vgUid)</tt> ===
   568 This returns the typically set visual gear values, useful if manipulating things like smoke or bubbles or circles. It returns the following values:
   568 This returns the typically set visual gear values, useful if manipulating things like smoke or bubbles or circles. It returns the following values:
   569 
   569 
   618 Example:
   618 Example:
   619 
   619 
   620 <code language="lua">    vgear = AddVisualGear(...)
   620 <code language="lua">    vgear = AddVisualGear(...)
   621     DeleteVisualGear(vgear) -- Delete the newly created visual gear.</code>
   621     DeleteVisualGear(vgear) -- Delete the newly created visual gear.</code>
   622 
   622 
   623 === <tt>!SetGearValues(gearUid, Angle, Power, WDTimer, Radius, Density, Karma, DirAngle, AdvBounce, ImpactSound, ImpactSounds, Tint)</tt> (0.9.22) ===
   623 === <tt>!SetGearValues(gearUid, Angle, Power, WDTimer, Radius, Density, Karma, DirAngle, AdvBounce, ImpactSound, ImpactSounds, Tint, Damage)</tt> (0.9.22) ===
   624 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.
   624 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.
   625 
   625 
   626 Set `nil` for each value you do not want to change.
   626 Set `nil` for each value you do not want to change.
   627 
   627 
   628 Example:
   628 Example: