So I'm back to ramble on the RET part
I run into one more issue with it - if the var specified in defined RET is not set then the installation fails with Not_found error. It took me almost an hour of mindfaqing to figure out where exactly I made a mistake.
To demonstrate
DEFINE_ACTION_FUNCTION test
RET a b
BEGIN
OUTER_SET a=1
END
LAUNCH_ACTION_FUNCTION test END
will fail, while
DEFINE_ACTION_FUNCTION test
RET a b
BEGIN
OUTER_SET a=1
END
LAUNCH_ACTION_FUNCTION test STR_VAR b=~boo~ END
works.
Furthermore, if possible I would want the following to be applied to FUNCTIONs:
In
DEFINE_TYPE_FUNCTION name RET var1 BEGIN patch_list END ret variables are always returned if they exist, whether specified in LAUNCHing or not, so that 'var1' always goes outside.
LAUNCH_TYPE_FUNCTION name RET outcome=var2 END (I honestly would prefer just 'var2' instead of 'outcome=var2', but guess it'll break already existing mods) - these rets, if exist at the end of function execution, will be added to ones specified by DEFINE.
If rets do not exist then nothing happens, user will simply get the usual 'cannot convert %varname% or varname to integer' later on when they try to use vars they forgot to set.
Finally, is there any chance to shortcut macros and functions to three letters?
LAUNCH_ACTION_FUNCTION = LAF
LAUNCH_ACTION_MACRO = LAM
LAUNCH_PATCH_FUNCTION = LPF
LAUNCH_PATCH_MACRO = LPM
PS About breaking older mods. Perhaps just one more category beside INT_VAR, STR_VAR and RET? Which would do exactly what proposed, autoret from launching ('var2' instead of 'outcome=var2') and definition.