# HG changeset patch # User Wuzzy # Date 1523923192 -3600 # Node ID d4d6bc1dc1dea75ed995583f09d0aeede2a1623b # Parent dff2be85c8d2a9f4ddd8f3236526d538c90fdc95 LuaAPI: add SetGearCollisionMask constants diff -r dff2be85c8d2 -r d4d6bc1dc1de LuaAPI.wiki --- a/LuaAPI.wiki Tue Apr 17 00:50:26 2018 +0100 +++ b/LuaAPI.wiki Tue Apr 17 00:59:52 2018 +0100 @@ -78,6 +78,7 @@ || *Identifier* || *Description* || || `LAND_WIDTH` || The width of the landscape in pixels || || `LAND_HEIGHT` || The height of the landscape in pixels || +|| `LOCALE` || Current locale identifier (e.g. “de” for German) || || `LeftX` || X coordinate of the leftmost point of the landscape || || `RightX` || X coordinate of the rightmost point of the landscape || || `TopY` || Y coordinate of the topmost point of the landscape || @@ -777,22 +778,23 @@ `mask` is a number between `0x0000` and `0xFFFF` and used as a bitfield, which means you can combine these flags with `bor`. These are the available flags (excerpt): -|| *Flag* || *Collision with …* || -|| `0xFF00` || Terrain || -|| `0x0080` || Current hedgehog and crates || -|| `0x000F` || Other hedgehogs || -|| `0x0070` || Mines and explosives || +|| *Idntifier* || *Collision with …* || +|| `lfLandMask` || Terrain || +|| `lfCurrentHog` || Current hedgehog and crates || +|| `lfHHMask` || Hedgehogs except current hedgehog || +|| `lfNotHHObjMask` || `not lfNotHHObjMask` || +|| `lfAllObjMask` || Mines and explosives || Beware, the collision mask is often set by the engine as well. Examples: -SetGearCollisionMask(gear, 0xFF7F) +SetGearCollisionMask(gear, bnot(lfCurrentHegehog)) -- Ignore collision with current hedgehog SetGearCollisionMask(gear, 0xFFFF) -- Collide with everything -SetGearCollisionMask(gear, 0x00FF) +SetGearCollisionMask(gear, bor(bor(lfHHMask, lfCurrentHog), lfAllObjMask)) -- Collide with hedgehogs and objects SetGearCollisionMask(gear, 0x0000)