[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.3.9 Spawn

The spawn property class is responsible for creating other entities based on time related rules.

Property Class Details

General Information

This property class can create entities at positions selected by the user. It can both create simple entities from scratch, or create them from entity templates.

Setting spawn positions

You can set locations to spawn at by specifying positions or map nodes.

This is accomplished by using the AddSpawnPosition method/action.

Setting entity definitions

You can specify full templates to spawn from, or just entities with some behaviour. This is done by using the AddEntityTemplateType or AddEntityType respectively.

Enabling spawning

Spawn is initially enabled, but it is necessary to specify timing information by using SetTiming before it can actually start spawning entities.

After this you can disable or reenable the spawner by using SetEnabled.

Spawned entity names

By default spawned entities will get a number appended to their names to be able to somehow differentiate them. However, this behaviour can be controlled by the use of namecounter and spawnunique boolean properties.

namecounter allows disabling numbering in entity names.

spawnunique allows to prevent spawning of entities with the same name. This is useful in combination with disabled namecounter to allow only one entity of each name at any one time, but respawning afer the entity dissapears (like for example for item spawn points in games).

Message Callbacks

This property class can send the following message to the behaviour.

pcspawn_newentity: new entity has been created. Holds entity and behaviour parameters.

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

This document was generated using texi2html 1.76.