Functions (TeaScript)

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:

BErase
Erases a bitmap, iterator, or text object when called.

Note: If you only want to temporarily hide the object, modify the object's hide property instead of using this function.

BmpCreate
This function can create a highly customizable bitmap object, but needs an NPC as the bitmap's source.

'''Use this function with caution! Performance issues may occur if too many bitmaps are created at once, and the game may crash if sx, sy, sw, and/or sh, are invalid.'''

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. You can find the debug box by opening the debug menu and double clicking the object count.

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. Remember the HUD must must be initialized before adding any text or bitmaps.

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:

ItrCreate
Creates an iterator. This iterator can let you cycle between objects in a given rectangular area.

ItrNext
Continues through an iterator that was created prior.

KeyPress
This function returns input data. This can be used to check a keyboard key, mouse cursor, and player keys are being held.

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.

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

NKill
This function will destroy an NPC when called if all parameters are met.

PlayNote
This function is used to play midi notes. The first time this command is used, the game stutters for a few frames. It is recommended to use call  at the beginning of the level to avoid any stutters.

Here is a simplified way to play a note. Use this chart to identify your instruments.

Here is a simplified way to play a percussion note. Use this chart to identify your instruments.

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.

Sleep 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. This textbox can be read and stored

SysShowMsg
Will show a message box with default options.

TClear
This function clears and deletes timers, such as timers done for events.

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.