ent_createlayer(STRING* filename, var flags2, var layer)
Creates a layered view or sky entity at runtime.
|| Texture or model of the entity.
combination of the following flags:
||creates a sky entity. Otherwise it's a view entity.
||360 degrees half dome texture
||six sided cube texture
||360 degrees cylinder texture
||don't use the z buffer (sky models only)
||Determines the rendering order;
0..999999 for sky entities and -999999..+999999 for view entities.
Pointer to the entity.
- The sky flags are not available
- 0 must be passed instead.
The client_id parameter can be used to change the view
parameters of a view entity, or assign a sky entity to a certain view. Otherwise the camera parameters are used and the sky entity is assigned to all views.
View entities can be created even when no level is loaded.
The view entity is created in the center of the screen, meaning that it won't be visible when the camera looks at it from the inside. Give it a distance in x direction to make it visible.
All layer and sky entities must be created before the first game_load or game_save call. Layer and sky entities created before the first level_load call are not removed on level change; otherwise they are removed when a new level is loaded.
you = ent_createlayer("gun.mdl",0,10);
you.x = 200;