OCF

Description

OFC stands for Object Character Flag. Objects can be assigned certain properties by using OCF. With GetOCF the currently set flags are returned as a bitmask. Alternatively, it is also possible to search for specific flags with Find_OCF. For more information and examples on how to use these constants, see Object character flags.

Constants

Name Category Description Introduced in Value
OCF_Normal Objects/OCF Internally reserved, not selectable. 4.6.5.0 CP 1
OCF_Construct Objects/OCF Marks the object as a construction site. 4.6.5.0 CP 2
OCF_Grab Objects/OCF Tangible object. 4.6.5.0 CP 4
OCF_Collectible Objects/OCF Collectable object. Internally listed under "OCF_Carryable". 4.6.5.0 CP 8
OCF_OnFire Objects/OCF Burning object. 4.6.5.0 CP 16
OCF_HitSpeed1 Objects/OCF Object that moves with at least 1.5 pixels per frame. 4.9.1.0 GWE 32
OCF_Fullcon Objects/OCF Object that is at least 100% complete. For example, the object is not a construction site, or as a living thing it is at least fully grown. See also GetCon, DoCon and SetCon. 4.6.5.0 CP 64
OCF_Inflammable Objects/OCF Flammable object. 4.9.1.0 GWE 128
OCF_Chop Objects/OCF Felling object. Usually these are trees. 4.6.5.0 CP 256
OCF_Rotate Objects/OCF Rotatable object. 4.9.1.0 GWE 512
OCF_Exclusive Objects/OCF The object blocks (covers) objects behind it and prevents other objects from being built in front. This flag is set by DefCore entry "Exclusive". 4.9.1.0 GWE 1024
OCF_Entrance Objects/OCF The object has an active entrance area. For this there must be a defined entrance area (see DefCore.txt), the object must be complete and not rotated too far. 4.9.1.0 GWE 2048
OCF_HitSpeed2 Objects/OCF Object that moves with at least 2 pixels per frame. 4.9.1.0 GWE 4096
OCF_HitSpeed3 Objects/OCF Object that moves with at least 6 pixels per frame. 4.9.1.0 GWE 8192
OCF_Collection Objects/OCF The object has a collection area, is not rotated or incomplete, and the contents has not reached the CollectionLimit. See also Collect. 4.9.1.0 GWE 16384
OCF_Living Objects/OCF A living being. Notice: dead animals are still OCF_Living. To check for live animals use OCF_Alive. 4.6.5.0 CP 32768
OCF_HitSpeed4 Objects/OCF Object that moves with at least 8 pixels per frame. 4.9.1.0 GWE 65536
OCF_FightReady Objects/OCF Object is a living being, has an activity, and no ObjectDisabled flag in that activity. 4.9.1.0 GWE 131072
OCF_LineConstruct Objects/OCF It is currently possible to connect lines to this object. 4.9.1.0 GWE 262144
OCF_Prey Objects/OCF Prey for certain animals (usual prey are Wipfs, clonks etc.) 4.6.5.0 CP 524288
OCF_AttractLightning Objects/OCF The object attracts lightning. See DefCore entry "AttractLightning". 4.6.5.0 CP 1048576
OCF_NotContained Objects/OCF Object is located outdoors. See also NoContainer. 4.9.1.0 GWE 2097152
OCF_CrewMember Objects/OCF The object can theoretically be added to a crew or already belongs to a crew. This means that it has the corresponding DefCore-property and is alive.
Objects which have set the OCF_CrewMember-Flag are given special treatment by the engine:
  • Will use pathfinding even if the PathFinder value in DefCore is not set
  • Uses internal pathfinding optimizations adjusted for the size of a clonk
  • Will use modified jumping (also short jumps) even if the PathFinder value in DefCore is not set.
  • Can be attacked via the Attack command
  • Failed commands will produce failure messages and %sFailed calls in the command target
  • Will automatically add Acquire commands if a BUILD action requires material. BuildNeedsMaterial calls are not made
  • Right mouse clicks will show Context* script functions as menu entries if the controller is the owner
  • The object name is displayed if seen by another allied player and enabled in the options
  • The object can not be sold
4.6.5.0 CP 4194304
OCF_Edible Objects/OCF Edible object. This flag is set by DefCore-entry "Edible". 4.6.5.0 CP 8388608
OCF_InLiquid Objects/OCF The object is in a liquid. See also GBackLiquid. 4.6.5.0 CP 16777216
OCF_InSolid Objects/OCF The object center is stuck in the floor. See also GBackSolid and Stuck. 4.6.5.0 CP 33554432
OCF_InFree Objects/OCF The center of the object is free. 4.6.5.0 CP 67108864
OCF_Available Objects/OCF This object can theoretically be acquired by a clonk, meaning it is either uncontained or in a container to which the clonk can have access. 4.6.5.0 CP 134217728
OCF_PowerConsumer Objects/OCF Energy consumer. This property is controlled by DefCore entry "LineConnect". The object must also be completely built. 4.6.5.0 CP 268435456
OCF_PowerSupply Objects/OCF Energy supplier. This property is controlled by DefCore entry "LineConnect". This will apply to sole energy suppliers but also to energy consumers, if they are completely built, have some energy stored, and an outgoing energy line can be connected. 4.6.5.0 CP 536870912
OCF_Container Objects/OCF The object is a container with theoretically accessible contents (e.g. a building with entrance, transport vehicle, etc.). 4.6.5.0 CP 1073741824
OCF_Alive Objects/OCF The object is a living creature. 4.9.1.0 GWE 2147483648

Examples

ObjectCount2(Find_OCF(OCF_InLiquid | OCF_InSolid));
				
Returns the number of objects which are currently in a liquid or stuck in the ground.
FindObject2(Find_OCF(OCF_Alive), Find_OCF(OCF_OnFire));
				
Returns the first found burning object, if one can be found.

Changelog

Date Author Version Affecting Description
May 2002 Sven2 4.6.5.0 CP OCF_Normal, OCF_Construct, OCF_Grab, OCF_Collectible, OCF_OnFire, OCF_Fullcon, OCF_Chop, OCF_Living, OCF_Prey, OCF_AttractLightning, OCF_CrewMember, OCF_Edible, OCF_InLiquid, OCF_InSolid, OCF_InFree, OCF_Available, OCF_PowerConsumer, OCF_PowerSupply, OCF_Container Constants added.
May 2002 Sven2 4.9.1.0 GWE OCF_HitSpeed1, OCF_Inflammable, OCF_Rotate, OCF_Exclusive, OCF_Entrance, OCF_HitSpeed2, OCF_HitSpeed3, OCF_Collection, OCF_HitSpeed4, OCF_FightReady, OCF_LineConstruct, OCF_NotContained, OCF_Alive Constants added.
Sven2, May 2002