User prop add string

From Sim Innovations Wiki
Revision as of 10:53, 12 July 2018 by Admin (talk | contribs) (→‎Example)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search


user_prop_id = user_prop_add_string(name, default_value, description)

user_prop_add_string will add an additional user customizable setting to your instrument of the type string (text).

Return value

Argument Type Description
user_prop_id ID This value can be used for further reference. Functions such as user_prop_get can use this user_prop_id. Its good practice to store this persist_id in your logic code.


# Argument Type Description
1 name String The name of the user property. This name must be unique (there may only be one user property of a certain name in an instrument)
2 default_value String The default value of the property. The is the value the property gets when the user adds the instrument to a panel.
3 description String A description of the property, explaining to the user what function this user property has.


-- Let's give our instrument a property
title_prop = user_prop_add_string("Title", "Default title", "Text that shows up at the top of the instrument")

-- We can check here what the user has configured
print("Title: " .. user_prop_get(title_prop) )
Settings visible to user within instrument configuration