CEG:Calls: Difference between revisions
From Spring
Jump to navigationJump to search
Evil4zerggin (talk | contribs) New page: == Overview == There are three places where you can call a CEG: weapons, COB, and Lua. == Weapon CEGs == There are three weapon tags that can spawn CEGs: *cegtag: Spawns the CEG every f... |
Evil4zerggin (talk | contribs) No edit summary |
||
| Line 38: | Line 38: | ||
To actually generate the explosion, you need to <code>emit-sfx</code> 1024 plus the number of the explosion generator in the unit definition (the first one is 0, the next is 1, and so on). The CEG will have the position and direction of the piece you emit it from. | To actually generate the explosion, you need to <code>emit-sfx</code> 1024 plus the number of the explosion generator in the unit definition (the first one is 0, the next is 1, and so on). The CEG will have the position and direction of the piece you emit it from. | ||
== Lua CEGs == | |||
See [[Lua_SyncedCtrl]]. | |||
Revision as of 09:09, 30 December 2008
Overview
There are three places where you can call a CEG: weapons, COB, and Lua.
Weapon CEGs
There are three weapon tags that can spawn CEGs:
- cegtag: Spawns the CEG every frame at the weapon projectile's position and direction.
- explosionGenerator: Spawns the CEG when the weapon hits its target.
- bounceExplosionGenerator: For bouncing weapons only. Spawns the CEG when the weapon bounces.
You need to set these tags equal to custom:ExplosionGeneratorName. For example, in a .tdf,
explosionGenerator=custom:ExplosionGeneratorName;
COB CEGs
Calling a CEG from COB requires two steps. First, in the unit's definition, you need to put
[sfxtypes] {
explosiongenerator0 = custom:ExplosionGeneratorName0;
explosiongenerator1 = custom:ExplosionGeneratorName1;
//and so on...
}
for a .fbi, or
sfxtypes = {
explosiongenerators = {
"custom:ExplosionGeneratorName0",
"custom:ExplosionGeneratorName1",
--and so on...
},
},
To actually generate the explosion, you need to emit-sfx 1024 plus the number of the explosion generator in the unit definition (the first one is 0, the next is 1, and so on). The CEG will have the position and direction of the piece you emit it from.
Lua CEGs
See Lua_SyncedCtrl.