Hey,
Autodesk 3ds Max has a scripting language known as MaxScript, In MaxScript every value in script is driven from Value base :
class Value : public Collectable
{
...
}
To expose a function we simply define it as following :
// Maxscript Exposed API
def_visible_primitive(FunctionName, "FunctionNameInScript");
Value* FunctionName_cf(Value** arg_list, int count)
{
if (count == 3)
{
const wchar_t* str = arg_list[0]->to_string();
INT64 str = arg_list[1]->to_int64();
INT_PTR str = arg_list[2]->to_intptr();
return &ok;
}
else
{
throw RuntimeError(L"Invalid parameters"); return &false_value;
}
}
So we can have a function with unlimited and dynamic parameters (arguments), Is this possible in AngelScript? I've seen usage of Generic value but it needs to define function definition still with limited parameters, Also return value is dynamic as well, I guess return value can be set by generic API dynamically but I'm not sure, This can be very useful.
If it's not possible is there a hope for implementing such feature?
Note : I am aware of getting close result using dictionary but I want something like what MaxScript offers like any function(param1,param2,param3,param4,param5,…)