<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://www.fightorder.net/wiki/index.php?action=history&amp;feed=atom&amp;title=CEG%3ACalls</id>
	<title>CEG:Calls - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://www.fightorder.net/wiki/index.php?action=history&amp;feed=atom&amp;title=CEG%3ACalls"/>
	<link rel="alternate" type="text/html" href="https://www.fightorder.net/wiki/index.php?title=CEG:Calls&amp;action=history"/>
	<updated>2026-04-21T07:59:14Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.44.2</generator>
	<entry>
		<id>https://www.fightorder.net/wiki/index.php?title=CEG:Calls&amp;diff=650&amp;oldid=prev</id>
		<title>Qrow: 1 revision imported</title>
		<link rel="alternate" type="text/html" href="https://www.fightorder.net/wiki/index.php?title=CEG:Calls&amp;diff=650&amp;oldid=prev"/>
		<updated>2025-11-14T05:21:28Z</updated>

		<summary type="html">&lt;p&gt;1 revision imported&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 22:21, 13 November 2025&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;en&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(No difference)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Qrow</name></author>
	</entry>
	<entry>
		<id>https://www.fightorder.net/wiki/index.php?title=CEG:Calls&amp;diff=649&amp;oldid=prev</id>
		<title>Interwiki&gt;Kloot: Reverted edits by 8611 (talk) to last revision by Flozi</title>
		<link rel="alternate" type="text/html" href="https://www.fightorder.net/wiki/index.php?title=CEG:Calls&amp;diff=649&amp;oldid=prev"/>
		<updated>2015-02-01T13:53:32Z</updated>

		<summary type="html">&lt;p&gt;Reverted edits by &lt;a href=&quot;/wiki/index.php?title=Special:Contributions/8611&quot; title=&quot;Special:Contributions/8611&quot;&gt;8611&lt;/a&gt; (&lt;a href=&quot;/wiki/index.php?title=User_talk:8611&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;User talk:8611 (page does not exist)&quot;&gt;talk&lt;/a&gt;) to last revision by &lt;a href=&quot;/wiki/index.php?title=User:Flozi&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;User:Flozi (page does not exist)&quot;&gt;Flozi&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;= CEG Calls =&lt;br /&gt;
== Overview ==&lt;br /&gt;
There are four places where you can call a CEG: weapons, COB or LUS unit scripts, flying piece projectiles and synced Lua gadgets.&lt;br /&gt;
&lt;br /&gt;
== Weapon CEGs ==&lt;br /&gt;
&lt;br /&gt;
There are three weapon tags that can spawn CEGs:&lt;br /&gt;
&lt;br /&gt;
*{{xtaglink|Gamedev:WeaponDefs|cegTag}} - Spawns the CEG every frame at the weapon projectile&amp;#039;s position and direction.&lt;br /&gt;
*{{xtaglink|Gamedev:WeaponDefs|explosionGenerator}} - Spawns the CEG when the weapon hits its target.&lt;br /&gt;
*{{xtaglink|Gamedev:WeaponDefs|bounceExplosionGenerator}} - For bouncing weapons only. Spawns the CEG when the weapon bounces.&lt;br /&gt;
&lt;br /&gt;
== Calling CEGs from unit scripts ==&lt;br /&gt;
&lt;br /&gt;
Calling a CEG from unit scripts requires two steps. First, in the unit&amp;#039;s definition, you need to &amp;#039;&amp;#039;&amp;#039;define the order of the effects:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
For a .fbi unitdef use:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
[sfxtypes] {&lt;br /&gt;
  explosiongenerator0 = custom:ExplosionGeneratorName0;&lt;br /&gt;
  explosiongenerator1 = custom:ExplosionGeneratorName1;&lt;br /&gt;
  //and so on...&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a .lua unitdef use:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
sfxtypes = {&lt;br /&gt;
  explosiongenerators = {&lt;br /&gt;
    &amp;quot;custom:ExplosionGeneratorName0&amp;quot;,&lt;br /&gt;
    &amp;quot;custom:ExplosionGeneratorName1&amp;quot;,&lt;br /&gt;
    --and so on...&lt;br /&gt;
  },&lt;br /&gt;
},&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
(See [[Gamedev:UnitDefs#SFXTypes]])&lt;br /&gt;
&lt;br /&gt;
=== COB ===&lt;br /&gt;
To actually generate the explosion in a COB, you need to call [[Animation-CobConstants#emit-sfx|emit-sfx]]:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;emit-sfx 1024 + ceg_num from pieceName;&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where ceg_num is 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. For syntactic sugar you can use:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;#define MY_FIRST_AWESOME_CEG 1024 + 0&lt;br /&gt;
emit-sfx MY_FIRST_AWESOME_CEG from pieceName;&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In a COB script, you can call:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;set CEG_DAMAGE damage_value&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Any &amp;lt;code&amp;gt;emit-sfx&amp;lt;/code&amp;gt; instructions will then use that value for the &amp;quot;damage&amp;quot; (use the &amp;#039;[[CEG:Operators#Damage_.28.27d.27.29|&amp;#039;d&amp;#039; operator]] to access this value).&lt;br /&gt;
&lt;br /&gt;
=== LUS ===&lt;br /&gt;
In a Lua unit script you generate the explosion using [[Animation-LuaCallouts#Effects|Spring.UnitScript.EmitSfx]] e.g.:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;EmitSfx(pieceName, SFX.CEG + ceg_num)&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where ceg_num is the number of the explosion generator in the unit definition as before.&lt;br /&gt;
&lt;br /&gt;
== Piece Projectiles ==&lt;br /&gt;
CEGs can be attached to piece projectiles which are created when a unit script calls [[Animation-CobConstants#explode|explode]] (COB) or [[Animation-LuaCallouts#Effects|Explode]] (lua) with an argument of &amp;lt;code&amp;gt;COB.FALL&amp;lt;/code&amp;gt;. See [[Gamedev:UnitDefs#pieceExplosionGenerators]].&lt;br /&gt;
&lt;br /&gt;
== Synced Lua Gadget CEGs ==&lt;br /&gt;
The only method that lets you directly call a CEG by name, anywhere on the map.&lt;br /&gt;
See [[Lua_SyncedCtrl#Other|Spring.SpawnCEG]]. Note that the damage parameter does not apply damage, but is used to set the [[CEG:Operators#Damage_.28.27d.27.29|&amp;#039;d&amp;#039; operator]].&lt;br /&gt;
&lt;br /&gt;
[[Category:CEG]]&lt;/div&gt;</summary>
		<author><name>Interwiki&gt;Kloot</name></author>
	</entry>
</feed>