Under Construction
Models are the templates that all in game entities spawn from. The model sheet contains the animation definitions, starting properties, name, sub models, and all the other other basics needed to build an entity.
Contents
Script
Model properties are attributes possessed by models, which are in turn used as templates for entities. Animations, starting hit-points, and other properties that are mostly immutable throughout a game are kept as model properties. Model properties are accessible through the get_model_property()
and set_model_property()
functions.
mixed x = get_model_property(void <model pointer>, int <identifier>);
mixed x = <value>;
set_model_property(void <model pointer>, int <identifier>, x);
It’s important to understand the difference between an entity, a model, and modeldata to avoid conflicts and causing unwanted behavior with scripts.
- Entity: Entities are interactive objects in the game world, usually controlled directly by players or the computer. Most entity properties are mutable by nature, such as location in the game world or remaining hit points.
- Model: Models are global templates used to create an entity. Model properties act as default values. They also house values that normally remain constant, such compiled scripts. Model pointers are available by index. Each entity also has a pointer available to the model it was created from as an entity property.
- Modeldata: Modeldata is a partial copy of the model that is created by the entity spawn routine. It contains values for the entity that are semi-constant and set when the entity is first spawned. Examples include an alias name or maximum points. Modeldata is unique to each entity. Its pointer is available as an entity property.
This example modifies an entity’s maximum health (actually a model property) by getting the entity’s modeldata pointer, then getting and setting the model hp property.
void acting_entity = <entity>
void model_data = get_entity_property(acting_entity, openborconstant("ENTITY_PROPERTY_MODELDATA"));
int hp_current = get_model_property(model_data, openborconstant("MODEL_PROPERTY_HP"));
hp_current += 5;
set_model_property(model_data, openborconstant("MODEL_PROPERTY_HP"), hp_current);
Property List
- Name: The
openborconstant()
used to access property. For exampleopenborconstant("MODEL_PROPERTY_ANTI_GRAVITY")
. - Type: The property value’s variable type.
- Description: A short description of what the property is and does.
Name | Type | Description |
---|---|---|
MODEL_PROPERTY_ACTION_FREEZE | Integer | If true, any entities that are not Text type freeze in place while this entity performs its Special animation. Used by legacy Smartbomb. |
MODEL_PROPERTY_AIR_CONTROL | Integer | Flags to configure control options during jump. See air_control. |
MODEL_PROPERTY_ANTI_GRAVITY | Float | Model’s resistance to gravity. Higher values impart greater resistance. 0.0 = No gravity resistance.1.0 = Immune to gravity. |
MODEL_PROPERTY_BLEND_MODE | Integer | Model blend mode (“alpha”). * openborconstant("BLEND_MODE_ALPHA") * openborconstant("BLEND_MODE_ALPHA_NEGATIVE") * openborconstant("BLEND_MODE_AVERAGE") * openborconstant("BLEND_MODE_DODGE") * openborconstant("BLEND_MODE_HARDLIGHT") * openborconstant("BLEND_MODE_MODEL") * openborconstant("BLEND_MODE_NONE") * openborconstant("BLEND_MODE_OVERLAY") |
MODEL_PROPERTY_BOUNCE | Integer | If true, entity has bounce effect when landing from fall. |
MODEL_PROPERTY_BLOCK_CONFIG_FLAGS | Integer | General blocking setup. See Blocking configuration. |
MODEL_PROPERTY_BLOCK_ODDS | Integer | Chance that AI blocks attack. See Blocking odds. |
MODEL_PROPERTY_BLOCK_PAIN | Integer | When blocking an attack, the attack damage must meet or exceed this value for entity to assume a block pain animation. |
MODEL_PROPERTY_BLOCK_THRESHOLD | Integer | Maximum incoming attack damage entity can block. See Threshold. |
MODEL_PROPERTY_CHILD_FOLLOW | Pointer | Pointer to the model’s child follow properties. |
MODEL_PROPERTY_COLORSET | Pointer | Pointer to colorset indexes and configuration. See Palette. |
MODEL_PROPERTY_DEATH_CONFIG_FLAGS | Integer | Behavior on death. See Death. |
MODEL_PROPERTY_ENHANCED_DELAY_CAP_MAX | Integer | Maximum calculated delay. See Enhanced Delay. |
MODEL_PROPERTY_ENHANCED_DELAY_CAP_MIN | Integer | Minimum calculated delay. See Enhanced Delay. |
MODEL_PROPERTY_ENHANCED_DELAY_MODIFIER | Integer | Added to existing frame delay. See Enhanced Delay. |
MODEL_PROPERTY_ENHANCED_DELAY_MULTIPLIER | Decimal | Multiplied by frame delay to get new delay. See Enhanced Delay. |
MODEL_PROPERTY_ENHANCED_DELAY_RANGE_MAX | Integer | Maximum existing delay edelay will affect. See Enhanced Delay. |
MODEL_PROPERTY_ENHANCED_DELAY_RANGE_MIN | Integer | Minimum existing delay edelay will affect. See Enhanced Delay. |
MODEL_PROPERTY_FACTION | Pointer | Pointer to faction data. See Faction. |
MODEL_PROPERTY_FALL_DISABLE | Integer | If true, model is immune to knockdown while on the ground. |
MODEL_PROPERTY_FLIP | Integer | If true, entity flips when spawned as an attack flash and the hit location is at a higher X Axis position than target. |
MODEL_PROPERTY_GROUND | Integer | If true, entity cannot hit others with attacks if it is in the air. |
MODEL_PROPERTY_GUARD_POINTS | Integer | Starting and maximum guard points. |
MODEL_PROPERTY_GUARD_RATE | Integer | Number (half when blocking) of guard points recovered every 200 centiseonds. |
MODEL_PROPERTY_HP | Integer | Starting and maximum hit points. |
MODEL_PROPERTY_HUD_DISABLE | Integer | When true, this entity does not display in player’s HUD. |
MODEL_PROPERTY_HUD_POPUP | Pointer | Pointer to model’s Pop Up HUD Properties (ex. Boss HUD). |
MODEL_PROPERTY_ICON | Pointer | Pointer to model’s Icon Properties. |
MODEL_PROPERTY_INDEX | Integer | Model’s unique numeric index assigned on read in. |
MODEL_PROPERTY_LAYER | Integer | Text setlayer property. If any non-zero value, the model’s layer position is this value + HOLE_Z. |
MODEL_PROPERTY_MAKE_INVINCIBLE | Integer | If this is an item, it will set invincibility time to the collecting entity. If positive, the collecting entity also has blink flag set. If negative, the value is inverted to positive first, and the entity’s blink flag is not set. |
MODEL_PROPERTY_MOVE_CONFIG_FLAGS | Integer | Flags to control how the model behaves in relation to movement and its environment. See Move Configuration. |
MODEL_PROPERTY_MP | Integer | Starting and maximum magic/energy points. |
MODEL_PROPERTY_MULTIPLE | Integer | When this entity is struck, attacker gains attack damage * multiple to its score. Default = 5 for enemy types, -1 for NPC, 0 for all else. |
MODEL_PROPERTY_NAME | String | Name of model. Used as entity name if no alias provided. |
MODEL_PROPERTY_OFF_SCREEN_KILL | Integer | Distance an entity can pass out of the screen borders before it is killed. |
MODEL_PROPERTY_OFF_SCREEN_NO_ATTACK | Float | Replaces the global off screen kill for model. Off screen kill subtracts from calculated chance of attack when entity is 10 or more pixels of screen. 0.0 = No change.1.0 = No chance to attack when off screen. |
MODEL_PROPERTY_PAIN_CONFIG_FLAGS | Integer | Basic hit reaction behavior. See Pain Configuration. |
MODEL_PROPERTY_PATH | String | Relative file path to model sheet. Ex: data/chars/kula/kula.txt |
MODEL_PROPERTY_PRIORITY | Integer | Applies when attempting to spawn an entity if the maximum allowed entities are in play already. The first existing entity with a priority value less than the incoming spawn is killed to make room. If no existing entity has lower priority, the spawn aborts. |
MODEL_PROPERTY_QUAKE_CONFIG | Integer | Controls interaction between entity and native quake behavior. Bitmasked with following constants:openborconstant("QUAKE_CONFIG_NONE") – Quake functions normally (screen shakes when landing from knockdown).openborconstant("QUAKE_CONFIG_DISABLE_SCREEN") – Entity does not trigger screen shake.openborconstant("QUAKE_CONFIG_DISABLE_SELF") – Entity is not affected by screen shake. |
MODEL_PROPERTY_RISE_INVINCIBILITY | Integer | Set invincibility flag and add value as time when rising from knockdown. May be positive or negative, using same logic as MODEL_PROPERTY_MAKE_INVINCIBLE. |
MODEL_PROPERTY_SHADOW_CONFIG_FLAGS | Integer | Shadow behavior. See Shadow Configuration. |
MODEL_PROPERTY_SHADOW_INDEX | Integer | Static Shadow Index. |
MODEL_PROPERTY_SCORE | Integer | Score allotted to when defeated or collected as an item. |
MODEL_PROPERTY_SCROLL | Float | Rate (if any) entity scrolls with background. |
MODEL_PROPERTY_SPAWN_HUD | Pointer | Pointer to model’s Spawn HUD Properties. |
MODEL_PROPERTY_SUBTYPE | Integer | See Type for list of constants. |
MODEL_PROPERTY_TYPE | Integer | See Type for list of constants. |
MODEL_PROPERTY_WEAPON | Pointer | Pointer to model’s weapon properties. See Weapons. |
Name | Type | Description |
3 thoughts on “Model”
Comments are closed.