not sure if this has been covered yet so i'll give a basic run down of how to use the new dynamic lua system in Max
firstly the scripts in Max require a comment at the top of the script to work
--DESCRIPTION: this script does...
great, now the script can be assigned in max and you can keep track of what the script does... but that's only the beginning
these description comments also gives you access to the dynamic lua - i.e. the ability to change the settings in the editor
basic usage is enclose a variable name with a default value inside some square brackets
e.g.
--DESCRIPTION: [VARIABLE=1]
you can add text outside the brackets to help explain what it does
e.g.
--DESCRIPTION: This [VARIABLE=1] can be accessed in the script
currently there are a few different things we can get access to using this method
--DESCRIPTION: [MY_NUMBER=1]
will let you access an integer value for the variable MY_NUMBER to use in the script
*how to use the variable i will explain after*
--DESCRIPTION: [MY_NUMBER=200(100,500)]
will let you access an integer value as above but this time between 100 and 500 (inclusive) and will be set to 200 by default
--DESCRIPTION: [MY_STRING$="hello"]
will let you change the string "hello"
*note the $ at the end of the variable name, this is required to tell the system it is a string*
(you will not need the $ when referencing the variable later)
--DESCRIPTION: [MY_NUMBER#=1.5]
will let you access a float number (set to 1.5)
*note the # at the end of the variable name, this is required to tell the system it is a float*
(you will not need the # when referencing the variable later)
--DESCRIPTION: [MY_NUMBER#=1.5(0.5,2.5)]
same as above but this time it will let you access a float number (set to 1.5) with a range from 0.5 to 2.5 (inclusive)
--DESCRIPTION: [THIS_IS_TRUE!=1]
this gives a tick box / toggle for if a variable is 1 or 0
*note the ! at the end, again this is required to tell the system it should be a true / false box
*note2 - not actually true or false in lua code but acts like it, the variable will be 1 if true (ticked) and 0 if false (unticked)
--DESCRIPTION: [@SELECTION=1(1=Item_1,2=Item_2)]
this one gives you a drop down selection box like when picked a weapon on the start marker etc
the part in brackets is broken up into 2 parts again - the left hand side being the index of the list and the right hand side being the name shown in the inspector
the actual value given in code is the index of the item selected
i.e. if you set SELECTION = "item_2" in the editor then in code the variable (selection) will be equal to 2
finally you can use any number of these together but you need to give them all unique names
i.e.
--DESCRIPTION: [MY_FIRST_NUMBER=1]
--DESCRIPTION: [MY_SECOND_NUMBER=10]
--DESCRIPTION: [MY_FIRST_FLOAT#=1.4]
--DESCRIPTION: [MY_FIRST_STRING$="Hello world"]