TimeToLive Property

Usage:
   ObjectTemplate.TimeToLive CRD

Argument values:

argument 1:    CRD, e.g. 120, 200, 25, 30, 45, 60, 9999, CRD_NONE/-1/0/0, CRD_NONE/0.01/0/0, CRD_NONE/0.03/0/0, CRD_NONE/0.04/0/0, CRD_NONE/0.05/0.05/0, CRD_NONE/0.05/0/0, CRD_NONE/0.0665/0/0, CRD_NONE/0.07/0.07/0, CRD_NONE/0.07/0/0, ...

Description: This property is used in two different ways, depending if the object is player controlled or is an effect. If the object is a vehicle or projectile, this property is a number; if the object has to do with an effect, this property is a CRD.

For a Projectile, this property defines the lifetime of the projectile, i.e. the longest amount of time it will exist.

A vehicle will self-destruct after a certain amount of time if abandoned some distance from its spawn point. This type of damage is important for game play, as it means that abandoned vehicles will eventually disappear and then get replaced. Unlike most other damage factors, these settings are found in the level's battle type ObjectSpawnTemplates.con file. Here is an example:

  ObjectTemplate.TimeToLive 45
  ObjectTemplate.Distance 40
  ObjectTemplate.DamageWhenLost 10

These settings mean that if the vehicle is moved 40 meters or more away from its spawn point, it will have 45 seconds to live unattended. After this period, the vehicle will take 10 Hitpoints of damage each second. See the Damage Tutorial for more information.

For effects, the TimeToLive property defines the length of time the object exists, using a CRD argument.

Related properties: DamageWhenLost, Distance

Used in object types (and how often in each type): ClusterProjectile (100%), EffectBundle (89%), Emitter (99%), ObjectSpawner (98%), Particle (100%), Projectile (100%), SpriteParticle (99%)

Used in a total of 766 .con files: Effects.con, Objectivespawnertemplates.con, Objects.con, Objectspawntemplates.con, Projectile.con, Smallwar.con, Weapons.con

Parent directories of these .con files: objects/Vehicles, objects/Stationary_Weapons, objects/HandWeapons, objects/Effects, Bf1942/Levels, ai

Example: (from objects/Effects/e_MuzzAAGun/Effects.con)
   rem *** e_MuzzAAgun ***
   ObjectTemplate.Create EffectBundle e_MuzzAAgun
   ObjectTemplate.SaveInSeparateFile 1
   rem -------------------------------------
   ObjectTemplate.AddTemplate Em_MuzzAAgun_Flare
   ObjectTemplate.SetPosition 0.02/-0.02/-1.14
   ObjectTemplate.AddTemplate Em_MuzzAAgun_Glint
   ObjectTemplate.SetPosition 0.02/-0.02/-1.14
   ObjectTemplate.AddTemplate Em_MuzzAAgun_WSmoke
   ObjectTemplate.SetPosition 0.02/-0.02/-1.14
   ObjectTemplate.TimeToLive CRD_NONE/-1/0/0


Go to the ObjectTemplate properties list page, ObjectTemplate page, All Properties list, or Main scripting page.