Classes (Entities) and Properties
(Davor Hunski)
INTRODUCTION
Classes (entities) discussed here are those that are present in the Serious Editor's virtual tree or that exist in the Classes directory and can be added to the virtual tree. Note that some classes (entities) present in the Classes directory are not intended for users' direct use within the editor and cannot be added to the virtual tree (you can try, but they will ultimately not be added).
Units Of Measure: Measurements in Serious are in meters.
Property Types: Values stored and edited in classes' (entities') properties are of the following types:
FLOAT (decimal number)
BOOL (flag, yes/no, i.e. light switch)
POINTER (link, relation)
ENUM (defined set of values i.e. light types: directional, ambient, point,..)
Common Properties (shared by most entities)
Most entities share some common properties, due to entities being implemented in base classes or added through 'Features' .es coding interface. Some of these properties are listed below
Name
-string property. Almost all entity classes have a Name property. It is used to assign individual names to specified entity(s). It is very important to properly name your important entities, so that you can identify them later. Names of entities are also used to define clones. Clones are all entities having the same name (the entities don't have to be of the same class).
Parent
-pointer to another entity. The Serious engine implements hierarchical linking of entities. Hierarchical structure is obtained by defining relationships between objects. The 'Parent' property is used to target the entity that is parent of the entity being edited. An entity can have only one parent. If one moves a parent, all of its children are moved identically, maintaining their location and orientation relative to the parent. Child entities can be moved freely, without moving their parent. Parenting is important when working with clones. For example, create a few bare columns and assign all of them the same name. This way they become clones. Then, on one column, create a torch with a fire and a light. Form this into a hierarchical structure: set column as parent of torch, torch as parent of fire and light. Apply "update clones" to this column equipped with torch/file/light and all remaining columns having the same name will be replaced by columns equipped with torch/fire/light. Parenting is also useful for destroying entities during game play. If you destroy a parent entity, all of its child entities will also be destroyed. Destroy a "parent" column and its torch, fire and light will be destroyed. Destroy a 'parent" torch and its fire and light will also be destroyed.
Spawn flags
-array of flags. All entities have this property. It is an array of editable flags that determine in which game levels of difficulty (easy, normal, hard,...) and game modes (single play, cooperative, deathmatch, ...) an entity (health, trees, enemy spawners, ....) will exist.
Background
-flag property. Background (skybox) is rendered as viewed from backgroundviewer entity. All entities that have 'Background' property flag set are taken into consideration for rendering when rendering view from backgroundviewer.
Target
-entity pointer. This is also a common property. In general, there are two types of target properties. The first one comes from class CMarker, which is one of the basic .es classes. Its basic purpose is to serve as a position in space, defining a position and an orientation. All classes extracted from CMarker (CPlayerMarker, CBackgroundViewer, CCameraMarker, CGradientMarker,....) share this property due to inheritance behaviour of object programming (higher classes have all properties of classes beneath). Second type of target properties are widely used to link with destination entity that should be notified that source entity has been activated. For example, when you press a switch, through target property (actually named On/Off target) you activate entity that is to perform an action due to switch activation. Or, if you enter an area contained in a touch field entity, the touch field entity detects it and sends event (trigger, activate, start,....) to target entity (i.e. enemy spawner).
Targetable
-flag property. If this flag isn't set, entity can't be targeted by other entities. This flag exists to prevent typically unwanted numerous entities (such as lights) from appearing as possible targets in target combo boxes. So if you want to perform triggering on such entities (that have the "Targetable" property), you will have to set this flag in order to be able to target it.