LuaGears.wiki
changeset 2160 9d683fe2f4f9
parent 2123 7df4304efaef
child 2180 ce320d08ddf7
equal deleted inserted replaced
2159:0a57d46f287a 2160:9d683fe2f4f9
   379 
   379 
   380 This is returned (all variables are integers):
   380 This is returned (all variables are integers):
   381 
   381 
   382 `Angle, Power, WDTimer, Radius, Density, Karma, DirAngle, AdvBounce, ImpactSound, nImpactSounds, Tint, Damage, Boom`
   382 `Angle, Power, WDTimer, Radius, Density, Karma, DirAngle, AdvBounce, ImpactSound, nImpactSounds, Tint, Damage, Boom`
   383 
   383 
   384 A rough description of some of the parameters:
   384 That the concrete meaning of each of this variables depends on the gear type and can vary wildly. For most gear types, many of these variables are unused and have no effect.
   385 
   385 
       
   386 Here's an overview of the purpose of these variables:
       
   387 
       
   388  * `Angle`: Angle the gear was launched in (usually)
       
   389  * `Power`: Power the gear was launched in (usually)
       
   390  * `WDTimer`: An alternative timer variable, used by some more complex gears like air mines
   386  * `Radius`: Effect or collision radius, most of the time
   391  * `Radius`: Effect or collision radius, most of the time
   387  * `Density`: A high density makes the gear less prone to being pushed by forces, like explosons and stuff. Gears with a higher density also make a larger splash
   392  * `Density`: A high density makes the gear less prone to being pushed by forces, like explosions, wind and stuff. Gears with a higher density also make a larger splash
       
   393  * `Karma`: Used to track karma damage for hedgehogs in the Karma game modifier, but abused for different purposes for other gears, too
       
   394  * `DirAngle`: ???
       
   395  * `AdvBounce`: ???
   388  * `ImpactSound`: Sound it makes on a collision (see [Sounds])
   396  * `ImpactSound`: Sound it makes on a collision (see [Sounds])
   389  * `nImpactSounds`: Must be used together with `ImpactSound`. Number of different impact sounds to use. `0`: Disable impact sound. `1`: Use sound selected in `ImpactSound`. `2` or higher: Uses a random impact sound each impact. The first possible sound is `ImpactSound`, the second possible sound is `ImpactSound+1`, and so on. The order of sounds is specified at [https://hg.hedgewars.org/hedgewars/file/default/hedgewars/uTypes.pas#l120]. For example, if `ImpactSound` is `sndHellishImpact1` and `nImpactSounds` equals 4, the impact sounds will be `sndHellishImpact1` to `sndHellishImpact4`
   397  * `nImpactSounds`: Must be used together with `ImpactSound`. Number of different impact sounds to use. `0`: Disable impact sound. `1`: Use sound selected in `ImpactSound`. `2` or higher: Uses a random impact sound each impact. The first possible sound is `ImpactSound`, the second possible sound is `ImpactSound+1`, and so on. The order of sounds is specified at [https://hg.hedgewars.org/hedgewars/file/default/hedgewars/uTypes.pas#l120]. For example, if `ImpactSound` is `sndHellishImpact1` and `nImpactSounds` equals 4, the impact sounds will be `sndHellishImpact1` to `sndHellishImpact4`
   390  * `Tint`: Used by some gear types to determine its colorization. The color is in RGBA format.
   398  * `Tint`: Colorization of gear. The color is in RGBA format. Not supported by all gears.
   391  * `Boom`: Used by most gears to determine the damage dealt.
   399  * `Damage`: Amount of damage taken by gear. Only used by a few gears.
       
   400  * `Boom`: Used by most gears to determine the potential damage / explosion size
   392 
   401 
   393 Example:
   402 Example:
   394 <code language="lua">
   403 <code language="lua">
   395 -- Get all values in a single line of code:
   404 -- Get all values in a single line of code:
   396 local Angle, Power, WDTimer, Radius, Density, Karma, DirAngle, AdvBounce, ImpactSound, nImpactSounds, Tint, Damage, Boom, Scale = GetGearValues(myGear)
   405 local Angle, Power, WDTimer, Radius, Density, Karma, DirAngle, AdvBounce, ImpactSound, nImpactSounds, Tint, Damage, Boom, Scale = GetGearValues(myGear)