LuaGears.wiki
changeset 1782 503aa47f3aaf
parent 1781 2d057448d499
child 1783 b25684cd9837
equal deleted inserted replaced
1781:2d057448d499 1782:503aa47f3aaf
   326 Example: 
   326 Example: 
   327 
   327 
   328 <code language="lua">    gear = AddGear(...)
   328 <code language="lua">    gear = AddGear(...)
   329      HideHog(gear) -- Hide the newly created gear.
   329      HideHog(gear) -- Hide the newly created gear.
   330      RestoreHog(gear) -- Restore the newly hidden gear.</code>
   330      RestoreHog(gear) -- Restore the newly hidden gear.</code>
       
   331 
       
   332 === <tt>!SetGearValues(gearUid, Angle, Power, WDTimer, Radius, Density, Karma, DirAngle, AdvBounce, ImpactSound, ImpactSounds, Tint, Damage, Boom)</tt> ===
       
   333 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.
       
   334 
       
   335 Set `nil` for each value you do not want to change.
       
   336 
       
   337 Example:
       
   338 <code language="lua">
       
   339 -- Paints all RC planes into a white color
       
   340 function onGearAdd(gear)
       
   341     if GetGearType(gear) == gtRCPlane then
       
   342          SetGearValues(gear, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 0xFFFFFFFF)
       
   343     end
       
   344 end
       
   345 </code>
   331 
   346 
   332 === <tt>!SetVisualGearValues(vgUid, X, Y, dX, dY, Angle, Frame, !FrameTicks, State, Timer, Tint, Scale)</tt> ===
   347 === <tt>!SetVisualGearValues(vgUid, X, Y, dX, dY, Angle, Frame, !FrameTicks, State, Timer, Tint, Scale)</tt> ===
   333 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.
   348 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.
   334 
   349 
   335 All visual gear values are numbers. Each visual gear may be using these parameters differently, but the *usual* meaning of these is the following:
   350 All visual gear values are numbers. Each visual gear may be using these parameters differently, but the *usual* meaning of these is the following:
   608 
   623 
   609 Example:
   624 Example:
   610 
   625 
   611 <code language="lua">    vgear = AddVisualGear(...)
   626 <code language="lua">    vgear = AddVisualGear(...)
   612     DeleteVisualGear(vgear) -- Delete the newly created visual gear.</code>
   627     DeleteVisualGear(vgear) -- Delete the newly created visual gear.</code>
   613 
       
   614 === <tt>!SetGearValues(gearUid, Angle, Power, WDTimer, Radius, Density, Karma, DirAngle, AdvBounce, ImpactSound, ImpactSounds, Tint, Damage, Boom)</tt> ===
       
   615 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.
       
   616 
       
   617 Set `nil` for each value you do not want to change.
       
   618 
       
   619 Example:
       
   620 <code language="lua">
       
   621 -- Paints all RC planes into a white color
       
   622 function onGearAdd(gear)
       
   623     if GetGearType(gear) == gtRCPlane then
       
   624          SetGearValues(gear, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 0xFFFFFFFF)
       
   625     end
       
   626 end
       
   627 </code>
       
   628