Functions (TeaScript)

NCreateGroup
This function can create a group of NPCs when called.

AudioSet
This function allows you to play sound effects, or play/stop music.

To load a sound effect:

To play a sound effect:

To stop a sound effect:

To play music:

To stop music:

EXEScript
This function is used to execute a script. When this function is called, the given script will immediately be executed and the original script will be halted until the execution of the given script completes. This can be used to call world map/global scripts.

Debug
This function will output a string to the debug box. It will only work in the editor, and will not do anything in game mode. It is recommended to delete these functions after debugging for better performance.

FXCreate
This function is used to create an effect.

HUDSet
This function allows you to draw your own HUD. The function serves different purposes with the first parameter.

To erase previous HUD data and initialize the HUD system:

To disable the custom HUD system and erase all the previous custom HUD data.

To add a bitmap to the HUD: The image source must be in a file called 'scflash.png'.

To add text to the HUD:

KeyPress
This function returns input data. This also can be used to check if a key is being held in statements that start with if or other similar terms.

LMove
This function is used to move layers.

LSet
This function is used to change the visibility of a layer

To Show/Hide/Toggle a layer:

To change the alpha value of a layer:

LSpin
This function is used to rotate layers. This function only affect NPCs and Blocks.

NCreate
This function is used to spawn an NPC. The function returns the permanent id of the spawned NPC. Note that the spawned NPC becomes active until the next frame.

PlayNote
This function is used to play a note.

ShowMsg
This function shows a message using a message box. RGB, quake, break, and alpha message formats are supported.

Sleep
This function is used to pause the script for a number of frames. It can only be used in scripts called through an event.

SpEvent
This function is used to trigger special events.

SysShowInput
Will show a message box that has a text box.

SysShowMsg
Will show a message box with default options.

TCreate
This function is used to call an event/create an event timer.

TCreateEx
This function is used to execute a script after the set delay and pass parameters to the said script.

TxtCreate
This function is used to create a text object.