LuaAPI.wiki
changeset 1244 fb89844d7b78
parent 1243 770aa6d54ae2
child 1245 355898ec2631
equal deleted inserted replaced
1243:770aa6d54ae2 1244:fb89844d7b78
   468 This function returns the [VisualGearTypes visual gear type] for the specified visual gear.
   468 This function returns the [VisualGearTypes visual gear type] for the specified visual gear.
   469 
   469 
   470 === <tt>!GetGearPosition(gearUid)</tt> ===
   470 === <tt>!GetGearPosition(gearUid)</tt> ===
   471 Returns x,y coordinates for the specified gear. Not to be confused with `GetGearPos`.
   471 Returns x,y coordinates for the specified gear. Not to be confused with `GetGearPos`.
   472 
   472 
       
   473 === `GetGearCollisionMask(gearUid)` ===
       
   474 Returns the current collision mask of the given gear. See `SetGearCollisionMask` for an explanation of the mask.
       
   475 
   473 === <tt>!GetGearRadius(gearUid)</tt> ===
   476 === <tt>!GetGearRadius(gearUid)</tt> ===
   474 Returns the `Radius` value for the specified gear. For most [GearTypes gear types] for “projectile” gears (like `gtShell` or `gtGrenade`), the radius refers to the gear's collision radius. This is an invisible circle around the center of the gear which is used for the collision checks. For a few gear types, its radius means something different, see [Gear Types] for a full list.
   477 Returns the `Radius` value for the specified gear. For most [GearTypes gear types] for “projectile” gears (like `gtShell` or `gtGrenade`), the radius refers to the gear's collision radius. This is an invisible circle around the center of the gear which is used for the collision checks. For a few gear types, its radius means something different, see [Gear Types] for a full list.
   475 
   478 
   476 To set the `Radius` value, use `SetGearValues`.
   479 To set the `Radius` value, use `SetGearValues`.
   477 
   480 
   792 <code language="lua">SetGearCollisionMask(gear, 0x0000)
   795 <code language="lua">SetGearCollisionMask(gear, 0x0000)
   793 -- Collide with nothing</code>
   796 -- Collide with nothing</code>
   794 
   797 
   795 There are actual more flags availbable, but they are not as useful for use in Lua. You can find the full range of flags in the engine source code (in Pascal):
   798 There are actual more flags availbable, but they are not as useful for use in Lua. You can find the full range of flags in the engine source code (in Pascal):
   796 https://hg.hedgewars.org/hedgewars/file/default/hedgewars/uConsts.pas#l112
   799 https://hg.hedgewars.org/hedgewars/file/default/hedgewars/uConsts.pas#l112
   797 
       
   798 === `GetGearCollisionMask(gearUid)` ===
       
   799 Returns the current collision mask of the given gear. See `SetGearCollisionMask` for an explanation of the mask.
       
   800 
   800 
   801 === <tt>!SetGearVelocity(gearUid, dx, dy)</tt> ===
   801 === <tt>!SetGearVelocity(gearUid, dx, dy)</tt> ===
   802 Gives the specified gear the velocity of `dx`, `dy`.
   802 Gives the specified gear the velocity of `dx`, `dy`.
   803 
   803 
   804 === <tt>!SetFlightTime(gearUid, flighttime)</tt> ===
   804 === <tt>!SetFlightTime(gearUid, flighttime)</tt> ===