User Tools

Site Tools


pf:prpldocs:built_in_functions

<script type="text/javascript"> function selectText(containerid) { if (document.selection) { var range = document.body.createTextRange(); range.moveToElementText(document.getElementById(containerid)); range.select(); } else if (window.getSelection) { var range = document.createRange(); range.selectNode(document.getElementById(containerid)); window.getSelection().addRange(range); } } </script>   <a href="#" onclick="selectText('selectable')">Select All</a><br/> Save the contents to "Built in Functions.txt"   <div id="selectable">

=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

</div>

pf/prpldocs/built_in_functions.txt · Last modified: 2016/06/23 13:15 by virgilw