CEG-Classes: Difference between revisions

From Spring
Jump to navigationJump to search
No edit summary
No edit summary
Line 49: Line 49:
== CExploSpikeProjectile ==
== CExploSpikeProjectile ==


*length
*length (float)
*width
*width (float)
*alpha
*alpha (float)
*alphaDecay
*alphaDecay (float)
*lengthGrowth
*lengthGrowth (float)
*dir
*dir (float3)
*color
*color (float3)


Suggested Use:
Suggested Use:
Line 63: Line 63:
== CHeatCloudProjectile ==
== CHeatCloudProjectile ==


*heat
*heat (float)
*maxheat
*maxheat (float)
*heatFalloff
*heatFalloff (float)
*size
*size (float)
*sizeGrowth
*sizeGrowth (float)
*sizemod
*sizemod (float)
*sizemodmod
*sizemodmod (float)
*texture
*texture (string)


Suggested Use:
Suggested Use:
Line 77: Line 77:
== CSimpleParticleSystem ==
== CSimpleParticleSystem ==


*emitVector
*emitVector (float3)
*emitMul
*emitMul (float3)
*gravity
*gravity (float3)
*colorMap
*colorMap (string)
*texture
*texture (string)
*airdrag
*airdrag (float)
*particleLife
*particleLife (float)
*particleLifeSpread
*particleLifeSpread (float)
*numParticles
*numParticles (int)
*particleSpeed
*particleSpeed (float)
*particleSpeedSpread
*particleSpeedSpread (float)
*particleSize
*particleSize (float)
*particleSizeSpread
*particleSizeSpread (float)
*emitRot
*emitRot (float)
*emitRotSpread
*emitRotSpread (float)
*directional
*directional (bool)
*sizeGrowth
*sizeGrowth (float)
*sizeMod
*sizeMod (float)


Suggested Use:
Suggested Use:
Line 105: Line 105:


Properties:
Properties:
*alpha (float in [0, 1])
*alpha (float)
*ttl (int)
*ttl (int)
*expansionSpeed (float)
*expansionSpeed (float)

Revision as of 21:53, 31 December 2008

Source: https://spring.clan-sy.com/svn/spring/trunk/rts/Sim/Projectiles/

https://spring.clan-sy.com/svn/spring/trunk/rts/Sim/Projectiles/Unsynced/

Common Properties

All classes have the following properties, although not all of them use them:

  • pos (float3): The initial position of the spawner.
  • useAirLos (bool): Whether the spawner uses air LoS to determine if it is visible. This may allow the spawner to be seen from a further distance than normal.
  • alwaysVisible (bool): If true, the spawner is always visible, ignoring LoS.
  • speed (float3): The initial speed of the spawner.

CExpGenSpawner

This is the closest thing CEG has to a function call. Instead of creating a graphical effect on its own, it creates another ceg.

Properties:

  • delay (int): How long to wait before spawning the CEG.
  • dir (float3): The CEG will be called with this direction.
  • damage (float): The CEG will be called with this damage. The CEG doesn't actually deal any damage, but you can use this as a parameter and read it using the 'd' operator.
  • explosionGenerator (string): The name of the CEG you want to spawn.

Suggested Use:

  • If you use a spawner a lot of times, you may want to make it a separate CEG to avoid having to copy-paste many times.
  • This is the only way to truly delay a graphical effect.
  • The spawned CEG still checks conditions, so if you want to, say, spawn an effect only if it is in water and doesn't hit a unit, you can give the CExpGenSpawner nounit = 1; and the spawned CEG water = 1;.
  • This allows you to give a set of spawners the same (and possibly random) direction.

CBitmapMuzzleFlame

This creates three rectangular textures at right angles to each other. The frontTexture has dir as its normal.

Properties:

  • sideTexture (string)
  • frontTexture (string)
  • dir (float3)
  • colorMap (string)
  • size (float)
  • length (float)
  • sizeGrowth (float)
  • ttl (int)
  • frontOffset (float)

Suggested Use:

  • Muzzle flames, obviously.
  • You can use an upward-pointing CBitmapMuzzleFlame as a simple splash of water or dirt.
  • Railgun trails.


CExploSpikeProjectile

  • length (float)
  • width (float)
  • alpha (float)
  • alphaDecay (float)
  • lengthGrowth (float)
  • dir (float3)
  • color (float3)

Suggested Use:

  • Anything glowy.
  • For large, slow missiles, you can try using this as an extended engine flame. Set the width to something fairly large.

CHeatCloudProjectile

  • heat (float)
  • maxheat (float)
  • heatFalloff (float)
  • size (float)
  • sizeGrowth (float)
  • sizemod (float)
  • sizemodmod (float)
  • texture (string)

Suggested Use:

  • As the main background to an explosion.

CSimpleParticleSystem

  • emitVector (float3)
  • emitMul (float3)
  • gravity (float3)
  • colorMap (string)
  • texture (string)
  • airdrag (float)
  • particleLife (float)
  • particleLifeSpread (float)
  • numParticles (int)
  • particleSpeed (float)
  • particleSpeedSpread (float)
  • particleSize (float)
  • particleSizeSpread (float)
  • emitRot (float)
  • emitRotSpread (float)
  • directional (bool)
  • sizeGrowth (float)
  • sizeMod (float)

Suggested Use:

  • This is probably the most versatile class.
  • Anything moving.

CSpherePartSpawner

Draws an expanding sphere.

Properties:

  • alpha (float)
  • ttl (int)
  • expansionSpeed (float)
  • color (float3)

Suggested Use:

  • Looks like a shockwave.