Subroutine

In SgneepBox we can declare a function with two different methods.

The first method consists of using the 'make_sub' and 'sub' functions within the main script. This method is not compatible with the GraphView mode of SgneepBox, so the graphic objects will not be displayed.

Example (main script), First Method

make_sub function_name
sub function_name ds_mp3_load sound.mp3
sub function_name sleep 10

The second method is to use the control panel[1] and create a new function, then a new script to all effects, compatible with GraphView.

Where possible, we always recommend using this method[1].

Sub-Function Window[1]:



Open New Script.

In the main script(new_script) write this code:

exec_sub FNC_TEST

Press SAVE in File 'Tool Menu'

Press New Function Button and use the name:FNC_TEST

Write this example code :

ds_mp3_load sound.mp3
sleep 10

Press 'Save Function' Button in Sub-Function window.

Powered by Sgneep.com