Advanced Usage - nojanath/SublimeKSP GitHub Wiki
- To use features of SublimeKSP before official package releases, clone this repo into your
Sublime Text 3/Packages/KSP (Kontakt Script Processor)
- This directory can be located in Sublime Text by selecting
Preferences > Browse Packages
- Ensure that the root directory is
KSP (Kontakt Script Processor)
- After pulling the latest changes reload Sublime Text
- If you wish to pull features without restarting Sublime Text, I recommend installing AutomaticPackageReloader
Advanced SublimeKSP Features
- Functions can be overridden by using the
override
keyword. If you have two or more functions with the same name, the function with the override keyword will take priority. This keyword goes at the end of the function declaration line. - The
import
keyword can be used anywhere in your program, even in callbacks or macros. All of the imported file is inlined at the spot where it is called. For example, you could have a text file of strings on new lines, then import the file inside a list block. - Define macros can be used as single line text substitutions.
define functionName := setFunc
. This can also be combined withUSE_CODE_IF
conditions to create advanced behaviors based on conditions, such as calling different functions or using different variables. - There is a shorthand that can be used instead of
set_control_par()
andget_control_par()
. The syntax is:
ui_or_ui_id -> param := value // setting a value
message(ui_or_ui_id -> param) // getting a value
param
is the last part of the control parameter constant. For example, hide
for $CONTROL_PAR_HIDE
or value
for $CONTROL_PAR_VALUE
. ui_or_ui_id
can either be an ID of the UI control, or its actual name.