ent_for_name (STRING* name);
Returns a pointer to the entity with
the given WED name. Names can be assigned to entities through [Properties]
in WED. This way, entities placed in a level can be accessed in functions even
if they have no action themselves. Only the first 20 characters of the entity
name are evaluated.
Parameters:
name - Entities' name in WED
Returns:
ENTITY* pointer or NULL if not found.
Remarks:
Note that when an entity is static - that means when it has no action attached
- it's parameters and skills can be read, but must not be changed during
gameplay..
Speed:
Medium.Example:
string entname[30];
...
you = ptr_for_name ("waffe1_mdl_012"); // get pointer to that entity
str_for_entfile (entname, you); // retrieve the file name, like "waffe1.mdl"
your.string1 = entname; // let the file name appear
your.enable_touch = on; // when the entity is touched with the mouse
your.event = handle_touch;
See also:
ent_next, ent_vertices