Introduction
Functions
Misc
Introduction/defines-component
Component Define
Parts can have their own components, for example a moving component.
You can define them using component_define define.
For example, here we can define two components of a custom part for game Monolith:
component_define->render_object_component = resources/ro.mcs
component_define->additional_component = resources/joint.mcs
..you can add as many components as you want..
.mcs (Monolith Component Structure) are types of files that define everything
about a component.
Example .mcs file for a render_object (render object is the root component):
define->display_texture = resources/ro_tex.png
define->collision_data = resources/ro.cld
define->origin_point = center
define->z_order = 0
define->rotation = 0
define->size = 1, 1
Components can be accessed in .vrv files using get operator (->).
For example:
begin::
{
render_object_component->move(50, 0, 0)
}
Line above will move the "render_object_component" defined earlier in the code by
50 cm on x Axis right after the part spawns.
Every defined component is a child of render object component (root) so if you
want to move the entire part, just move the render_object.