ent_create(STRING* filename, VECTOR* position, function);

ent_createlocal(STRING* filename, VECTOR* position, function);

Creates a model, sprite or map entity in the current level. Mostly used for creating bullets or explosions, or for creating players in a multiplayer game. The given function will start immediately after creation, with the my pointer set to the created entity, and you set to the creating (if any). The instruction returns a pointer to the created entity that can be used for setting further entity parameters.

ent_create creates a global entity on the server and on all connected clients. The entity function runs on the server. ent_createlocal creates the entity on the local machine only. A local entity is not transmitted to the server, and thus not visible on other clients. The local entity function runs on the local machine only. Local entities can be used for advanced particle effects, player weapons or the like. In a single player system, both instructions are identical.

Parameters:

filename - name of the entity file to be created, in wmp, mdl, tga, pcx, bmp, or dds format; or NULL for creating a dummy entity.
position - Inital position of the entity.
function - Action of the entity, or NULL for no action.

Returns:

Pointer to the created entity.

Remarks:

Speed:

Slow when the entity file was not used in this level, medium otherwise.

Example:

you = ent_create ("flash.pcx", temp, flash_prog); 

See also:

ent_morph, ent_purge, ent_preload, ptr_remove, ent_createlayer, level_load

► latest version online