built-in functions.txt
=CMD
=COMMAND :Destroyed
=DESC 
Special function that is automatically called on the final invocation of the core after its destruction.
=ENDDESC
=EX 
#Create an enemy particle when this unit is destroyed
:Destroyed
	CreateParticle(CurrentCoords 0 0 0 1)
=ENDEX
=ENDCMD

=CMD
=COMMAND :Awake
=DESC 
Special function that is automatically called whenever a core is created. Whenever a core is created (either dynamically or at a game load), this function is called. At game load time this function is called before the game 'loading' initialization screen is dismissed.
Can be useful for repeating commands that are not persisted across saves, such as SetFieldCell.
=ENDDESC
=EX 
:awake
	trace("Hello World")
=ENDEX
=ENDCMD

=CMD
=COMMAND :GameLoaded
=DESC 
GameLoaded gets called after each time the game is loaded and the initialization screen is finished. It is called before the game is unpaused by the player. The key distinction between :GameLoaded and :Awake is that GameLoaded gets called immediately after the 'loading' initialization screen disappears. Also, GameLoaded does not get called in cores that are dynamically created cores at game time, whereas :Awake does.
=ENDDESC
=EX 
:GameLoaded
   PlaySound("Weapons0")
=ENDEX
=ENDCMD