CEG-Classes: Difference between revisions
From Spring
Jump to navigationJump to search
Evil4zerggin (talk | contribs) New page: == 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 sp... |
Evil4zerggin (talk | contribs) No edit summary |
||
| Line 8: | Line 8: | ||
== CExpGenSpawner == | == 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 <code>nounit = 1;</code> and the spawned <code>CEG water = 1;</code>. | |||
*This allows you to give a set of spawners the same (and possibly random) direction. | |||
Revision as of 09:23, 30 December 2008
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 spawnedCEG water = 1;. - This allows you to give a set of spawners the same (and possibly random) direction.