User-defined JS objects can be serialised/deserialised properly. This includes Vector2D and Vector3D. This requires those objects to have a "default" constructor, i.e. that the can be constructed like so: `new Thing()`.
The approach I take is not via serialization into C++ (and thus via EngineScriptsConversions), but by simply re-constructing the object. This works well because basically all of our objects have default-constructors (i.e.constructors that take no arguments (all components, Vector2/3 classes). It's more generic than serialising through C++, and would for example likely work well for AI objects or nodder-defined objects.
For objects with constructors that take arguments, the constructors that work with 0 arguments). call can fail, It's more generic than serialising through C++in which case it reports an error.
Many constructors with arguments would still work, and would for example likelybecause JS work well for AI objects or nodder-s rather well with undefined objectsvalues.
----
This introduces a more elaborate "GetConstructor" function in scriptinterface, which also tries using lexical scope to get closured objects (such as Class definitions). It's a further improvement on rP22487 as that would have failed for Class objects.
----
Fixes #4698.