engine/source/openborscript/entity.c
// Use string property argument to find an
// integer property constant and populate
// varlist->lval.
Use string property argument to find an
integer property constant and populate
varlist->lval.
Use string property argument to find an integer property constant and populate varlist - > lval .
int mapstrings_entity_property(ScriptVariant **varlist, int paramCount)
{
    #define ARG_MINIMUM     2   // Minimum number of arguments allowed in varlist.
    #define ARG_PROPERTY    1   // Varlist element carrying which property is requested.
    char *propname = NULL;  
    int prop;               
    static const char *proplist[] =
    {
		"ai_disable",
		"ai_target_entity",
		"alternate_idle",
		"alternate_walk",
		"animation",
		"animation_frame",
		"animation_id",
		"animation_id_previous",
		"animation_state",
		"animation_time",
		"arrow_state",
		"attack_id_incoming",
		"attack_id_outgoing",
		"attack_state",
		"autokill",
		"back_hit_direction",
		"bind",
		"blast_state",
		"blink",
		"block_state",
		"boss",
		"charge_state",
		"child",
		"colorset_default",
		"colorset_dying_health_1",
		"colorset_dying_health_2",
		"colorset_dying_index_1",
		"colorset_dying_index_2",
		"colorset_table",
		"colorset_time",
		"combo_step",
		"combo_time",
		"command_time",
		"damage_on_landing",
		"dead",
		"deduct_ammo",
		"defense_collection",
		"destination_x",
		"destination_z",
		"die_on_landing",
		"drawmethod",
		"drop",
		"duck_state",
		"entvar_collection",
		"escape_count",
		"exists",
		"explode",
		"fall_state",
		"freeze_state",
		"freeze_time",
		"function_take_action",
		"function_take_damage",
		"function_think",
		"function_try_move",
		"get_state",
		"grab_target",
		"grab_walk_state",
		"guard_time",
		"hp",
		"hp_old",
		"idle_state",
		"in_pain",
		"in_pain_back",
		"invincible_state",
		"invincible_time",
		"item_data",
		"jump_animation_id",
		"jump_state",
		"jump_velocity_x",
		"jump_velocity_y",
		"jump_velocity_z",
		"knockdown_count",
		"knockdown_time",
		"last_damage_type",
		"last_hit",
		"lifespan",
		"link",
		"model",
		"model_data",
		"model_default",
		"move_time",
		"move_x",
		"move_z",
		"mp",
		"mp_charge_time",
		"mp_old",
		"mp_time",
		"name",
		"next_attack_time",
		"next_hit_time",
		"nograb",
		"nograb_default",
		"obstructed",
		"obstruction_overhead",
		"offense_collection",
		"opponent",
		"owner",
		"parent",
		"path_obstructed_wait",
		"pause_time",
		"platform_land",
		"player_index",
		"position_base",
		"position_base_alternate",
		"position_direction",
		"position_x",
		"position_y",
		"position_z",
		"projectile_prime",
		"recursive_damage",
		"release_time",
		"rise_attack_delay",
		"rise_attack_time",
		"rise_delay",
		"rise_state",
		"run_state",
		"rush",
		"script_collection",
		"seal_energy",
		"seal_time",
		"sleep_time",
		"sort_id",
		"space_other",
		"spawn_type",
		"speed_multiplier",
		"stall_time",
		"think_time",
		"timestamp",
		"to_cost",
		"toss_time",
		"turn_state",
		"turn_time",
		"update_mark",
		"velocity_x",
		"velocity_y",
		"velocity_z",
		"walk_state",
		"waypoint_collection",
		"waypoint_count",
		"weapon_item"
    };
    if(paramCount < ARG_MINIMUM)
    {
        return 1;
    }
    MAPSTRINGS(varlist[ARG_PROPERTY], proplist, _ENTITY_END,
               "\n\n Error: '%s' is not a known entity property.\n");
    return 1;
    #undef ARG_MINIMUM
    #undef ARG_PROPERTY
}
int mapstrings_entity_property ( ScriptVariant * * varlist , int paramCount ) { #define ARG_MINIMUM      2   // Minimum number of arguments allowed in varlist. #define ARG_PROPERTY     1   // Varlist element carrying which property is requested. char * propname = NULL ; int prop ; static const char * proplist [ ] = { " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " } ; if ( paramCount < ARG_MINIMUM ) { return 1 ; } MAPSTRINGS ( varlist [ ARG_PROPERTY ] , proplist , _ENTITY_END , " \n \n \n " ) ; return 1 ; #undef  ARG_MINIMUM #undef  ARG_PROPERTY }
Use string property argument to find an
integer property constant and populate
varlist->lval.
Use string property argument to find an integer property constant and populate varlist - > lval .
// Placeholder for string property name from varlist. // Placeholder for integer constant located by string. // If the minimum argument count // was not passed, then there is // nothing to map. Return true - we'll // catch the mistake in property access // functions. // See macro - will return 0 on fail. // If we made it this far everything should be OK.