From f16b39a22365f3af2a43f6f7da376a91abcc6f52 Mon Sep 17 00:00:00 2001 From: tatjam Date: Sat, 26 Aug 2023 19:21:53 +0200 Subject: [PATCH] Logical groups implemented in the wiring editor #62 --- res/.luadef/definitions/game_database.lua | 4 + res/core/locale.lua | 4 +- res/core/package.lua | 8 +- src/game/database/GameDatabase.cpp | 5 + src/game/database/GameDatabase.h | 5 + src/game/scenes/editor/gui/EditorGUI.cpp | 1 + src/game/scenes/editor/gui/WiringPanel.cpp | 26 ++ src/game/scenes/editor/gui/WiringPanel.h | 10 +- .../scenes/editor/interfaces/WireInterface.h | 3 +- src/lua/libs/LuaGameDatabase.cpp | 7 + src/universe/vehicle/VehicleLoader.cpp | 143 ++++--- .../vehicle/connections/LogicalGroup.h | 1 + udata/vehicles/debug.toml | 374 +++++++++--------- 13 files changed, 347 insertions(+), 244 deletions(-) diff --git a/res/.luadef/definitions/game_database.lua b/res/.luadef/definitions/game_database.lua index a7e80a10..e3b05bbe 100644 --- a/res/.luadef/definitions/game_database.lua +++ b/res/.luadef/definitions/game_database.lua @@ -25,6 +25,10 @@ function game_database:add_plumbing_machine(path) end ---@param path string Path to the reaction .toml function game_database:add_reaction(path) end +---@param local_id string ID to use for the group, not including the package, as it's automatically added +---@param display_str string String to display to the user. Displayed directly! It's not a locale string ID +function game_database:add_logical_group(local_id, display_str) end + ---@param locale table Table containing the locale function game_database:load_locale(locale) end diff --git a/res/core/locale.lua b/res/core/locale.lua index d1d1f927..ae6a5c42 100644 --- a/res/core/locale.lua +++ b/res/core/locale.lua @@ -52,7 +52,9 @@ local locale = {"gman_move_down", "Move Group Down", "Bajar Grupo"}, {"gman_move_all", "Move all parts to...", "Mover las partes a..."}, -- Symmetry -{"radial_piece_name", "Radial Symmetry - Piece", "Simetria Radial - Pieza"} +{"radial_piece_name", "Radial Symmetry - Piece", "Simetria Radial - Pieza"}, +-- Logical groups +{"lg_control", "Control Orders", "Ordenes de Control"} } diff --git a/res/core/package.lua b/res/core/package.lua index c8332217..bb8391c1 100755 --- a/res/core/package.lua +++ b/res/core/package.lua @@ -3,6 +3,9 @@ local logger = require("logger") local glm = require("glm") function load(database) + -- The first locale is the default if selected one is not available + database:load_locale(dofile("locale.lua")) + database:add_part_category("categories/command.toml") database:add_part_category("categories/engines.toml") database:add_part_category("categories/all.toml") @@ -20,13 +23,12 @@ function load(database) database:add_reaction("materials/reactions/hydrogen_combustion.toml") database:add_reaction("materials/reactions/methane_combustion.toml") - -- The first locale is the default if selected one is not available - database:load_locale(dofile("locale.lua")) - database:add_editor_script("scenes/editor/editor.lua") database:add_editor_script("scenes/editor/symmetry_debug.lua") database:add_symmetry_mode("scenes/editor/symmetry/radial_piece.toml") + database:add_logical_group("control", database:get_string("core:lg_control")) + end diff --git a/src/game/database/GameDatabase.cpp b/src/game/database/GameDatabase.cpp index 026fbe26..35d7ddc1 100755 --- a/src/game/database/GameDatabase.cpp +++ b/src/game/database/GameDatabase.cpp @@ -147,3 +147,8 @@ void GameDatabase::add_symmetry_mode(const std::string &path, const std::string symmetry_modes.push_back(sane_path); } +void GameDatabase::add_logical_group(const std::string &id, const std::string &display_string) +{ + logical_groups.emplace_back(id, display_string); +} + diff --git a/src/game/database/GameDatabase.h b/src/game/database/GameDatabase.h index 7802840d..3e8b4026 100755 --- a/src/game/database/GameDatabase.h +++ b/src/game/database/GameDatabase.h @@ -33,6 +33,10 @@ class GameDatabase std::vector symmetry_modes; std::vector reactions; std::vector materials; + + // id and localized name (ready to display to user) + std::vector> logical_groups; + std::unordered_map current_locale; std::vector editor_scripts; @@ -43,6 +47,7 @@ class GameDatabase void add_symmetry_mode(const std::string& path, const std::string& pkg); void add_material(const std::string& path, const std::string& pkg); void add_reaction(const std::string& path, const std::string& pkg); + void add_logical_group(const std::string& id, const std::string& display_string); void finish_loading(); diff --git a/src/game/scenes/editor/gui/EditorGUI.cpp b/src/game/scenes/editor/gui/EditorGUI.cpp index 4161bd05..299fe74a 100755 --- a/src/game/scenes/editor/gui/EditorGUI.cpp +++ b/src/game/scenes/editor/gui/EditorGUI.cpp @@ -26,6 +26,7 @@ int EditorGUI::get_panel_width() part_list.init(sc, vg); trashcan.init(sc, vg); plumbing.init(sc, vg); + wiring.init(sc, vg); modify_tools.init(sc, vg); create_toolset(); diff --git a/src/game/scenes/editor/gui/WiringPanel.cpp b/src/game/scenes/editor/gui/WiringPanel.cpp index e12268a9..454341b3 100644 --- a/src/game/scenes/editor/gui/WiringPanel.cpp +++ b/src/game/scenes/editor/gui/WiringPanel.cpp @@ -9,9 +9,35 @@ void WiringPanel::init(EditorScene *sc, NVGcontext *vg) this->vg = vg; this->edgui = &sc->gui; + group_dropdown = std::make_shared(); + update_logical_groups(); + group_dropdown->item = 0; + scene->vehicle_int.wire_interface.editing = scene->vehicle->veh->logical_groups[group_dropdown->options[0].first]; + + + + // Group selector + panel.divide_v(0.05); + panel.child_pixels = 32; + panel.pixels_for_child_1 = false; + + panel.child_0->layout = std::make_shared(); + panel.child_0->layout->add_widget(group_dropdown); + } void WiringPanel::add_gui(int width, int panel_width, int height, GUIScreen *screen) { screen->add_canvas(&panel, glm::ivec2(0, 0), glm::ivec2(panel_width, height)); } + +void WiringPanel::update_logical_groups() +{ + for(auto& p : scene->vehicle->veh->logical_groups) + { + group_dropdown->options.emplace_back(p.first, p.second->display_str); + } + // Last option to allow the user to create logical groups + group_dropdown->options.emplace_back("manage", "Manager user logical groups"); + group_dropdown->update_options(); +} diff --git a/src/game/scenes/editor/gui/WiringPanel.h b/src/game/scenes/editor/gui/WiringPanel.h index 0556f544..a373f691 100644 --- a/src/game/scenes/editor/gui/WiringPanel.h +++ b/src/game/scenes/editor/gui/WiringPanel.h @@ -2,10 +2,11 @@ #include "EditorPanel.h" #include #include -#include +#include #include #include + class EditorVehicleInterface; class EditorGUI; @@ -16,12 +17,15 @@ class WiringPanel : EditorPanel AssetHandle trash_image; + GUICanvas panel; - GUISingleLayout* trash_area_layout; - GUIImageButton trash_button; + std::shared_ptr group_dropdown; + EditorGUI* edgui; + void update_logical_groups(); + public: void init(EditorScene* sc, NVGcontext* vg) override; void add_gui(int width, int panel_width, int height, GUIScreen* screen) override; diff --git a/src/game/scenes/editor/interfaces/WireInterface.h b/src/game/scenes/editor/interfaces/WireInterface.h index ebbbaa39..9abef6b3 100755 --- a/src/game/scenes/editor/interfaces/WireInterface.h +++ b/src/game/scenes/editor/interfaces/WireInterface.h @@ -9,7 +9,6 @@ class WireInterface : public BaseInterface { private: - LogicalGroup* editing; EditorVehicle* edveh; EditorScene* scene; @@ -35,6 +34,8 @@ class WireInterface : public BaseInterface public: + LogicalGroup* editing; + bool show_hidden; virtual void update(double dt) override; diff --git a/src/lua/libs/LuaGameDatabase.cpp b/src/lua/libs/LuaGameDatabase.cpp index f5cec599..af18338c 100755 --- a/src/lua/libs/LuaGameDatabase.cpp +++ b/src/lua/libs/LuaGameDatabase.cpp @@ -34,6 +34,13 @@ void LuaGameDatabase::load_to(sol::table& table) std::string pkg = view["__pkg"]; self->add_reaction(path, pkg); }, + "add_logical_group", [](GameDatabase* self, const std::string& local_id, const std::string& display, sol::this_environment st) + { + sol::environment view = st; + std::string pkg = view["__pkg"]; + std::string id = pkg + ":" + local_id; + self->add_logical_group(id, display); + }, "load_locale", [](GameDatabase* self, const sol::table& table, sol::this_environment st) { sol::environment view = st; diff --git a/src/universe/vehicle/VehicleLoader.cpp b/src/universe/vehicle/VehicleLoader.cpp index 10eff149..7224088b 100755 --- a/src/universe/vehicle/VehicleLoader.cpp +++ b/src/universe/vehicle/VehicleLoader.cpp @@ -245,80 +245,108 @@ void VehicleLoader::copy_pieces(const cpptoml::table& root) void VehicleLoader::obtain_logical_groups(const cpptoml::table& root) { auto groups = root.get_table_array_qualified("logical_group"); - if(!groups) + if(groups) { - return; - } - - for(auto& g : *groups) - { - auto connections = root.get_table_array_qualified("connection"); - if (!connections) + for(auto& g : *groups) { - return; - } + auto connections = g->get_table_array_qualified("connection"); + if (!connections) + { + continue; + } - LogicalGroup* gr = new LogicalGroup(); - auto id = g->get_qualified_as("id"); - logger->check(!id->empty(), "Logical group has no ID!"); + LogicalGroup* gr = new LogicalGroup(); + auto id = g->get_qualified_as("id"); + logger->check(!id->empty(), "Logical group has no ID!"); - auto existing = n_vehicle->logical_groups.find(*id); - logger->check(existing == n_vehicle->logical_groups.end(), "Duplicated ID for logical group"); + auto existing = n_vehicle->logical_groups.find(*id); + logger->check(existing == n_vehicle->logical_groups.end(), "Duplicated ID for logical group"); - for (auto conn_toml : *connections) - { - int from = *conn_toml->get_as("from"); - int to = *conn_toml->get_as("to"); - std::string fmachine = *conn_toml->get_as("fmachine"); - std::string tmachine = *conn_toml->get_as("tmachine"); - - Part *fromp = parts_by_id[from]; - Part *top = parts_by_id[to]; - Machine *fromm = fromp->get_machine(fmachine); - Machine *tom = top->get_machine(tmachine); - - // Check if it already exists bidirectionally to emit a warning - // TODO: Move this code to a function as it may be reused - auto from_it = gr->connections.equal_range(fromm); - bool found_from_to = false; - for (auto from_subit = from_it.first; from_subit != from_it.second; from_subit++) + for (auto conn_toml : *connections) { - if (from_subit->second == tom) + int from = *conn_toml->get_as("from"); + int to = *conn_toml->get_as("to"); + std::string fmachine = *conn_toml->get_as("fmachine"); + std::string tmachine = *conn_toml->get_as("tmachine"); + + Part *fromp = parts_by_id[from]; + Part *top = parts_by_id[to]; + Machine *fromm = fromp->get_machine(fmachine); + Machine *tom = top->get_machine(tmachine); + + // Check if it already exists bidirectionally to emit a warning + // TODO: Move this code to a function as it may be reused + auto from_it = gr->connections.equal_range(fromm); + bool found_from_to = false; + for (auto from_subit = from_it.first; from_subit != from_it.second; from_subit++) { - found_from_to = true; - break; + if (from_subit->second == tom) + { + found_from_to = true; + break; + } } - } - auto to_it = gr->connections.equal_range(tom); - bool found_to_from = false; - for (auto to_subit = to_it.first; to_subit != to_it.second; to_subit++) - { - if (to_subit->second == fromm) + auto to_it = gr->connections.equal_range(tom); + bool found_to_from = false; + for (auto to_subit = to_it.first; to_subit != to_it.second; to_subit++) { - found_to_from = true; - break; + if (to_subit->second == fromm) + { + found_to_from = true; + break; + } } - } - if (!found_from_to) - { - gr->connections.insert(std::make_pair(fromm, tom)); - } + if (!found_from_to) + { + gr->connections.insert(std::make_pair(fromm, tom)); + } + + if (!found_to_from) + { + gr->connections.insert(std::make_pair(tom, fromm)); + } - if (!found_to_from) + if (found_from_to || found_to_from) + { + logger->warn("Found a duplicate wire (from: {} fmachine: {} -> to: {} tmachine: {}), it was ignored", + from, fmachine, to, tmachine); + } + } + // Search for the logical group display string in the game database, if not present use ID directly + gr->display_str = *id; + for(const auto& p : osp->game_database->logical_groups) { - gr->connections.insert(std::make_pair(tom, fromm)); + if(p.first == *id) + { + gr->display_str = p.second; + break; + } } + // Insert the logical group + n_vehicle->logical_groups[*id] = gr; + } + } - if (found_from_to || found_to_from) + // Load empty logical groups from game database + for(const auto& p : osp->game_database->logical_groups) + { + bool found = false; + for(const auto& lg : n_vehicle->logical_groups) + { + if(lg.first == p.first) { - logger->warn("Found a duplicate wire (from: {} fmachine: {} -> to: {} tmachine: {}), it was ignored", - from, fmachine, to, tmachine); + found = true; + break; } } - // Insert the logical group - n_vehicle->logical_groups[*id] = gr; + if(!found) + { + LogicalGroup* gr = new LogicalGroup(); + gr->display_str = p.second; + n_vehicle->logical_groups[p.first] = gr; + } } } @@ -528,6 +556,11 @@ void VehicleSaver::write_logical_groups(cpptoml::table &target, const Vehicle &w for(auto lg : what.logical_groups) { + if(lg.second->connections.empty()) + { + continue; + } + auto tb = cpptoml::make_table(); auto conn_array = cpptoml::make_table_array(); diff --git a/src/universe/vehicle/connections/LogicalGroup.h b/src/universe/vehicle/connections/LogicalGroup.h index aae69c89..fd2c9e22 100644 --- a/src/universe/vehicle/connections/LogicalGroup.h +++ b/src/universe/vehicle/connections/LogicalGroup.h @@ -9,6 +9,7 @@ class Machine; class LogicalGroup { public: + std::string display_str; // Bidirectional wires, so if A is connected to B then B is connected to A std::unordered_multimap connections; diff --git a/udata/vehicles/debug.toml b/udata/vehicles/debug.toml index 1d05b4b1..a4c43ce7 100755 --- a/udata/vehicles/debug.toml +++ b/udata/vehicles/debug.toml @@ -3,202 +3,202 @@ piece_id = 20 in_flight = false group_names = ["Other group"] [[symmetry_group]] - __can_use_radial_attachments = true - __can_use_stack_attachments = false - __priority = -9999 - __all_in_symmetry = [2, 9, 14, 13, 12, 7, 10, 19, 17, 15, 8, 11, 20, 18, 16] - __script = "scenes/editor/symmetry/radial_piece.lua" - __description = "core:radial_piece_description" - __clone_depth = 5 - __icon = "scenes/editor/symmetry/radial_piece.png" __name = "core:radial_piece_name" -[[symmetry_group]] - __can_use_radial_attachments = true - __can_use_stack_attachments = false - __priority = -9999 - __all_in_symmetry = [12, 13, 14] - __script = "scenes/editor/symmetry/radial_piece.lua" - __description = "core:radial_piece_description" - __clone_depth = 1 __icon = "scenes/editor/symmetry/radial_piece.png" + __clone_depth = 5 + __description = "core:radial_piece_description" + __script = "scenes/editor/symmetry/radial_piece.lua" + __all_in_symmetry = [17, 18, 8, 13, 10, 19, 9, 6, 4, 7, 15, 20, 2, 3, 5] + __priority = -9999 + __can_use_stack_attachments = false + __can_use_radial_attachments = true +[[symmetry_group]] __name = "core:radial_piece_name" + __icon = "scenes/editor/symmetry/radial_piece.png" + __clone_depth = 1 + __description = "core:radial_piece_description" + __script = "scenes/editor/symmetry/radial_piece.lua" + __all_in_symmetry = [10, 13, 8] + __priority = -9999 + __can_use_stack_attachments = false + __can_use_radial_attachments = true [[piece]] node = "p_root" - part = 19 - transform = [7.5497882227658423e-8, 0.49999986923378753, -0.86602547928233009, 0.0000000000000000, -0.99999999999998856, 1.5099580280564235e-7, -6.6613379801119463e-16, 0.0000000000000000, 1.3076621232040609e-7, 0.86602547928232032, 0.49999986923379292, 0.0000000000000000, 4.1483500393083768, -1.7010874013245130, -2.4831777121397831, 1.0000000000000000] - id = 20 - [piece.link] - welded = true - to = 11 -[[piece]] - node = "p_root" - part = 17 - transform = [7.5497920689004320e-8, 0.50000013076618877, 0.86602532828652734, 0.0000000000000000, -0.99999999999998823, 1.5099580258359769e-7, -4.7184476870179243e-16, 0.0000000000000000, -1.3076618999451114e-7, -0.86602532828651757, 0.50000013076619498, 0.0000000000000000, 4.1483505623731816, 1.7630142138131633, -2.4831782352045870, 1.0000000000000000] - id = 18 + part = 9 + transform = [-0.86602540378443837, 0.50000000000000044, -5.5511151231257827e-17, 0.0000000000000000, 5.5511151231257827e-17, 2.2204460492503131e-16, 0.99999999999999989, 0.0000000000000000, 0.50000000000000044, 0.86602540378443826, 0.0000000000000000, 0.0000000000000000, -0.85164969915918709, -1.7010870993329463, -1.4831779736721973, 1.0000000000000000] + id = 19 [piece.link] + from_attachment = "m_attach_top" welded = true - to = 11 + to = 16 [[piece]] node = "p_root" - part = 16 - transform = [0.43301277739010058, -0.25000013076621158, 0.86602532828652712, 0.0000000000000000, 0.50000013076619532, 0.86602532828652679, -4.7184477708374317e-16, 0.0000000000000000, -0.74999986923378714, 0.43301277739010169, 0.50000013076619498, 0.0000000000000000, -0.35165009145780779, -4.2991633861841150, -2.4831782352045870, 1.0000000000000000] + part = 12 + transform = [0.86602540378443882, 0.49999999999999983, 0.0000000000000000, 0.0000000000000000, 0.0000000000000000, -2.2204460492503131e-16, 1.0000000000000002, 0.0000000000000000, 0.49999999999999983, -0.86602540378443893, -2.2204460492503131e-16, 0.0000000000000000, -0.85164969915918587, 1.7630145158048078, -1.4831779736721971, 1.0000000000000000] id = 17 [piece.link] + from_attachment = "m_attach_top" welded = true - to = 10 + to = 16 [[piece]] node = "p_root" - part = 15 - transform = [-1.5099580308319635e-7, -0.99999999999997735, 1.5099580269817147e-7, 0.0000000000000000, -0.99999999999998890, 1.5099580308319815e-7, -6.7847786723188247e-16, 0.0000000000000000, -2.2202528598811800e-14, -1.5099580247612530e-7, -0.99999999999998868, 0.0000000000000000, 4.1483503008408453, 0.030963859231732598, 0.51682202632777963, 1.0000000000000000] + part = 6 + transform = [0.99999999999978884, 0.0000000000000000, -6.5168273977172410e-7, 0.0000000000000000, 0.0000000000000000, 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, 6.5168273977172410e-7, 0.0000000000000000, 0.99999999999978884, 0.0000000000000000, 0.14835030084081374, 0.030963708235930310, -1.4831779736721973, 1.0000000000000000] id = 16 [piece.link] + to_attachment = "m_attach_bottom" + from_attachment = "m_attach_top" welded = true - to = 11 + to = 12 [[piece]] node = "p_root" - part = 18 - transform = [0.43301255089641588, -0.24999999999997802, -0.86602547928232998, 0.0000000000000000, 0.50000013076619565, 0.86602532828652690, -6.6613380639314546e-16, 0.0000000000000000, 0.74999999999997724, -0.43301285288802210, 0.49999986923379280, 0.0000000000000000, -3.3516498299253370, -2.5671121256278671, -2.4831777121397831, 1.0000000000000000] - id = 19 + part = 5 + transform = [0.99999999999994693, 0.0000000000000000, -3.2584136988587576e-7, 0.0000000000000000, 0.0000000000000000, 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, 3.2584136988587576e-7, 0.0000000000000000, 0.99999999999994693, 0.0000000000000000, 0.14835106733065165, 0.030963708235930310, -0.13083751384881906, 1.0000000000000000] + id = 14 [piece.link] + to_attachment = "m_attach_bottom" + from_attachment = "m_attach_top" welded = true - to = 10 + to = 1 [[piece]] node = "p_root" - part = 14 - transform = [-0.86602532828651724, 0.50000013076619032, 1.5099580275368259e-7, 0.0000000000000000, 0.50000013076619609, 0.86602532828652701, -6.7847787561383330e-16, 0.0000000000000000, -1.3076619001119600e-7, 7.5497920258846049e-8, -0.99999999999998856, 0.0000000000000000, -1.8516495683930023, -3.4331379823997517, 0.51682202632777940, 1.0000000000000000] - id = 15 - [piece.link] - welded = true - to = 10 + root = true + part = 10 + transform = [1.0000000000000000, 0.0000000000000000, 0.0000000000000000, 0.0000000000000000, 0.0000000000000000, 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, 0.0000000000000000, 0.0000000000000000, 1.0000000000000000, 0.0000000000000000, 0.14835110050680012, 0.030963708235930310, 0.97529479114556494, 1.0000000000000000] + id = 1 [[piece]] node = "p_root" - part = 13 - transform = [-0.43301262639429838, -0.24999986923380943, -0.86602547928233031, 0.0000000000000000, 0.49999986923379303, -0.86602547928233031, -8.8817841970012523e-16, 0.0000000000000000, -0.75000013076618965, -0.43301262639429849, 0.49999986923379292, 0.0000000000000000, -0.35164930686059970, 4.3610906516601737, -2.4831777121397827, 1.0000000000000000] - id = 14 + part = 1 + transform = [7.5497882227658423e-8, 0.49999986923378753, -0.86602547928233009, 0.0000000000000000, -0.99999999999998856, 1.5099580280564235e-7, -6.6613379801119463e-16, 0.0000000000000000, 1.3076621232040609e-7, 0.86602547928232032, 0.49999986923379292, 0.0000000000000000, 4.1483500393083768, -1.7010874013245130, -2.4831777121397831, 1.0000000000000000] + id = 2 [piece.link] - from_attachment = "m_attach_top" welded = true - to = 9 + to = 20 [[piece]] node = "p_root" - part = 9 - transform = [4.5497785665130798e-16, -4.4010368850797069e-16, -0.99999999999999967, 0.0000000000000000, -0.86602532828652745, 0.50000013076619576, -2.7755572262848513e-16, 0.0000000000000000, 0.50000013076619565, 0.86602532828652734, 8.3819482841127460e-24, 0.0000000000000000, -1.8516498299253830, -3.4331378314039114, -1.4831779736721973, 1.0000000000000000] - id = 10 + part = 4 + transform = [0.99999999999987443, 0.0000000000000000, -5.0068693724367187e-7, 0.0000000000000000, 0.0000000000000000, 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, 5.0068693724367187e-7, 0.0000000000000000, 0.99999999999987443, 0.0000000000000000, 0.14834877490887710, 0.030963708235930310, -4.2292774457176616, 1.0000000000000000] + id = 11 [piece.link] + to_attachment = "m_attach_bottom" + from_attachment = "m_attach_top" welded = true - to = 7 + to = 16 [[piece]] node = "p_root" - part = 11 - transform = [0.86602547928232054, 0.49999986923378731, 1.5099580280919377e-7, 0.0000000000000000, 0.49999986923379297, -0.86602547928233076, -9.0052248892081327e-16, 0.0000000000000000, 1.3076621204719117e-7, 7.5497882439323883e-8, -0.99999999999998890, 0.0000000000000000, -1.8516498299254032, 3.4950652478758117, 0.51682202632778085, 1.0000000000000000] - id = 12 + part = 15 + transform = [7.5497920689004320e-8, 0.50000013076618877, 0.86602532828652734, 0.0000000000000000, -0.99999999999998823, 1.5099580258359769e-7, -4.7184476870179243e-16, 0.0000000000000000, -1.3076618999451114e-7, -0.86602532828651757, 0.50000013076619498, 0.0000000000000000, 4.1483505623731816, 1.7630142138131633, -2.4831782352045870, 1.0000000000000000] + id = 3 [piece.link] - from_attachment = "m_attach_top" welded = true - to = 9 + to = 20 [[piece]] node = "p_root" - part = 2 - transform = [0.99999999999987443, 0.0000000000000000, -5.0068693724367187e-7, 0.0000000000000000, 0.0000000000000000, 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, 5.0068693724367187e-7, 0.0000000000000000, 0.99999999999987443, 0.0000000000000000, 0.14834877490887710, 0.030963708235930310, -4.2292774457176616, 1.0000000000000000] - id = 3 + part = 3 + transform = [0.43301277739010058, -0.25000013076621158, 0.86602532828652712, 0.0000000000000000, 0.50000013076619532, 0.86602532828652679, -4.7184477708374317e-16, 0.0000000000000000, -0.74999986923378714, 0.43301277739010169, 0.50000013076619498, 0.0000000000000000, -0.35165009145780779, -4.2991633861841150, -2.4831782352045870, 1.0000000000000000] + id = 4 [piece.link] - to_attachment = "m_attach_bottom" - from_attachment = "m_attach_top" welded = true - to = 6 + to = 9 [[piece]] node = "p_decoupled" - part = 4 + part = 5 transform = [0.99999999999994693, 0.0000000000000000, -3.2584136988587576e-7, 0.0000000000000000, 0.0000000000000000, 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, 3.2584136988587576e-7, 0.0000000000000000, 0.99999999999994693, 0.0000000000000000, 0.14835100625965730, 0.030963708235930310, -0.31826305274632583, 1.0000000000000000] - id = 4 + id = 12 [piece.link] to_attachment = "m_decoupling_point" editor_dettachable = false welded = true - to = 5 + to = 14 [[piece]] node = "p_root" - part = 12 - transform = [-0.43301285288802127, -0.24999999999997749, 0.86602532828652745, 0.0000000000000000, 0.49999986923379303, -0.86602547928232987, -6.9388939039072284e-16, 0.0000000000000000, 0.74999999999997746, 0.43301255089641610, 0.50000013076619521, 0.0000000000000000, -3.3516495683929342, 2.6290402970787445, -2.4831782352045870, 1.0000000000000000] - id = 13 + part = 2 + transform = [0.43301255089641588, -0.24999999999997802, -0.86602547928232998, 0.0000000000000000, 0.50000013076619565, 0.86602532828652690, -6.6613380639314546e-16, 0.0000000000000000, 0.74999999999997724, -0.43301285288802210, 0.49999986923379280, 0.0000000000000000, -3.3516498299253370, -2.5671121256278671, -2.4831777121397831, 1.0000000000000000] + id = 6 [piece.link] - from_attachment = "m_attach_top" welded = true to = 9 [[piece]] node = "p_root" - part = 4 - transform = [0.99999999999994693, 0.0000000000000000, -3.2584136988587576e-7, 0.0000000000000000, 0.0000000000000000, 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, 3.2584136988587576e-7, 0.0000000000000000, 0.99999999999994693, 0.0000000000000000, 0.14835106733065165, 0.030963708235930310, -0.13083751384881906, 1.0000000000000000] - id = 5 + part = 19 + transform = [-0.43301262639429838, -0.24999986923380943, -0.86602547928233031, 0.0000000000000000, 0.49999986923379303, -0.86602547928233031, -8.8817841970012523e-16, 0.0000000000000000, -0.75000013076618965, -0.43301262639429849, 0.49999986923379292, 0.0000000000000000, -0.35164930686059970, 4.3610906516601737, -2.4831777121397827, 1.0000000000000000] + id = 8 [piece.link] - to_attachment = "m_attach_bottom" from_attachment = "m_attach_top" welded = true - to = 1 + to = 18 [[piece]] node = "p_root" - part = 7 - transform = [-2.2204460492503131e-16, -1.0000000000000000, -1.1102230246251565e-16, 0.0000000000000000, 1.1102230246251565e-16, -2.2204460492503131e-16, 1.0000000000000000, 0.0000000000000000, -1.0000000000000000, 1.1102230246251565e-16, 0.0000000000000000, 0.0000000000000000, 2.1483503008408138, 0.030963708235929952, -1.4831779736721973, 1.0000000000000000] - id = 8 + part = 13 + transform = [-4.4408920985006262e-16, -1.1102230246251565e-16, -1.0000000000000000, 0.0000000000000000, 0.86602547928233042, 0.49999986923379336, -2.2204460492503131e-16, 0.0000000000000000, 0.49999986923379347, -0.86602547928233042, -2.2204460492503136e-16, 0.0000000000000000, -1.8516495683929790, 3.4950653988715770, -1.4831779736721966, 1.0000000000000000] + id = 18 [piece.link] + to_attachment = "m_attach_bottom" from_attachment = "m_attach_top" welded = true - to = 6 + to = 17 [[piece]] node = "p_root" - part = 5 - transform = [0.99999999999978884, 0.0000000000000000, -6.5168273977172410e-7, 0.0000000000000000, 0.0000000000000000, 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, 6.5168273977172410e-7, 0.0000000000000000, 0.99999999999978884, 0.0000000000000000, 0.14835030084081374, 0.030963708235930310, -1.4831779736721973, 1.0000000000000000] - id = 6 + part = 11 + transform = [-2.2204460492503131e-16, -1.0000000000000000, -1.1102230246251565e-16, 0.0000000000000000, 1.1102230246251565e-16, -2.2204460492503131e-16, 1.0000000000000000, 0.0000000000000000, -1.0000000000000000, 1.1102230246251565e-16, 0.0000000000000000, 0.0000000000000000, 2.1483503008408138, 0.030963708235929952, -1.4831779736721973, 1.0000000000000000] + id = 15 [piece.link] - to_attachment = "m_attach_bottom" from_attachment = "m_attach_top" welded = true - to = 4 + to = 16 [[piece]] node = "p_root" - part = 1 - transform = [0.86602540378443882, 0.49999999999999983, 0.0000000000000000, 0.0000000000000000, 0.0000000000000000, -2.2204460492503131e-16, 1.0000000000000002, 0.0000000000000000, 0.49999999999999983, -0.86602540378443893, -2.2204460492503131e-16, 0.0000000000000000, -0.85164969915918587, 1.7630145158048078, -1.4831779736721971, 1.0000000000000000] - id = 2 + part = 7 + transform = [-1.5099580308319635e-7, -0.99999999999997735, 1.5099580269817147e-7, 0.0000000000000000, -0.99999999999998890, 1.5099580308319815e-7, -6.7847786723188247e-16, 0.0000000000000000, -2.2202528598811800e-14, -1.5099580247612530e-7, -0.99999999999998868, 0.0000000000000000, 4.1483503008408453, 0.030963859231732598, 0.51682202632777963, 1.0000000000000000] + id = 5 [piece.link] - from_attachment = "m_attach_top" welded = true - to = 6 + to = 20 [[piece]] node = "p_root" part = 8 - transform = [-4.4408920985006262e-16, -1.1102230246251565e-16, -1.0000000000000000, 0.0000000000000000, 0.86602547928233042, 0.49999986923379336, -2.2204460492503131e-16, 0.0000000000000000, 0.49999986923379347, -0.86602547928233042, -2.2204460492503136e-16, 0.0000000000000000, -1.8516495683929790, 3.4950653988715770, -1.4831779736721966, 1.0000000000000000] + transform = [-0.86602532828651724, 0.50000013076619032, 1.5099580275368259e-7, 0.0000000000000000, 0.50000013076619609, 0.86602532828652701, -6.7847787561383330e-16, 0.0000000000000000, -1.3076619001119600e-7, 7.5497920258846049e-8, -0.99999999999998856, 0.0000000000000000, -1.8516495683930023, -3.4331379823997517, 0.51682202632777940, 1.0000000000000000] + id = 7 + [piece.link] + welded = true + to = 9 +[[piece]] + node = "p_root" + part = 14 + transform = [4.5497785665130798e-16, -4.4010368850797069e-16, -0.99999999999999967, 0.0000000000000000, -0.86602532828652745, 0.50000013076619576, -2.7755572262848513e-16, 0.0000000000000000, 0.50000013076619565, 0.86602532828652734, 8.3819482841127460e-24, 0.0000000000000000, -1.8516498299253830, -3.4331378314039114, -1.4831779736721973, 1.0000000000000000] id = 9 [piece.link] - to_attachment = "m_attach_bottom" - from_attachment = "m_attach_top" welded = true - to = 2 + to = 19 [[piece]] node = "p_root" - root = true - part = 3 - transform = [1.0000000000000000, 0.0000000000000000, 0.0000000000000000, 0.0000000000000000, 0.0000000000000000, 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, 0.0000000000000000, 0.0000000000000000, 1.0000000000000000, 0.0000000000000000, 0.14835110050680012, 0.030963708235930310, 0.97529479114556494, 1.0000000000000000] - id = 1 + part = 16 + transform = [-1.7742210049501887e-16, 7.7317059589551745e-16, -0.99999999999999978, 0.0000000000000000, -1.5099580275013125e-7, -0.99999999999998890, -3.3306687385974236e-16, 0.0000000000000000, -0.99999999999998890, 1.5099580252808664e-7, 1.6763899107371531e-23, 0.0000000000000000, 4.1483503008408018, 0.030963557240127396, -1.4831779736721973, 1.0000000000000000] + id = 20 + [piece.link] + welded = true + to = 15 [[piece]] node = "p_root" - part = 6 - transform = [-0.86602540378443837, 0.50000000000000044, -5.5511151231257827e-17, 0.0000000000000000, 5.5511151231257827e-17, 2.2204460492503131e-16, 0.99999999999999989, 0.0000000000000000, 0.50000000000000044, 0.86602540378443826, 0.0000000000000000, 0.0000000000000000, -0.85164969915918709, -1.7010870993329463, -1.4831779736721973, 1.0000000000000000] - id = 7 + part = 18 + transform = [-0.43301285288802127, -0.24999999999997749, 0.86602532828652745, 0.0000000000000000, 0.49999986923379303, -0.86602547928232987, -6.9388939039072284e-16, 0.0000000000000000, 0.74999999999997746, 0.43301255089641610, 0.50000013076619521, 0.0000000000000000, -3.3516495683929342, 2.6290402970787445, -2.4831782352045870, 1.0000000000000000] + id = 13 [piece.link] from_attachment = "m_attach_top" welded = true - to = 6 + to = 18 [[piece]] node = "p_root" - part = 10 - transform = [-1.7742210049501887e-16, 7.7317059589551745e-16, -0.99999999999999978, 0.0000000000000000, -1.5099580275013125e-7, -0.99999999999998890, -3.3306687385974236e-16, 0.0000000000000000, -0.99999999999998890, 1.5099580252808664e-7, 1.6763899107371531e-23, 0.0000000000000000, 4.1483503008408018, 0.030963557240127396, -1.4831779736721973, 1.0000000000000000] - id = 11 + part = 17 + transform = [0.86602547928232054, 0.49999986923378731, 1.5099580280919377e-7, 0.0000000000000000, 0.49999986923379297, -0.86602547928233076, -9.0052248892081327e-16, 0.0000000000000000, 1.3076621204719117e-7, 7.5497882439323883e-8, -0.99999999999998890, 0.0000000000000000, -1.8516498299254032, 3.4950652478758117, 0.51682202632778085, 1.0000000000000000] + id = 10 [piece.link] + from_attachment = "m_attach_top" welded = true - to = 8 + to = 18 [[part]] proto = "test_parts:parts/fuel_tank/part_fuel_tank.toml" - group_id = 94147221203544 + group_id = 3342912776466489188 id = 19 [part.oxidizer_tank] __plumbing_rot = 0 @@ -212,21 +212,21 @@ group_names = ["Other group"] x = 0 [[part]] proto = "test_parts:parts/fuel_tank/part_fuel_tank.toml" - group_id = 0 - id = 18 + group_id = 281500746579969 + id = 17 [part.oxidizer_tank] __plumbing_rot = 0 [part.oxidizer_tank.__plumbing_pos] - y = 0 - x = 6 + y = 31 + x = -1 [part.fuel_tank] __plumbing_rot = 0 [part.fuel_tank.__plumbing_pos] - y = 0 - x = 0 + y = 31 + x = -7 [[part]] proto = "test_parts:parts/fuel_tank/part_fuel_tank.toml" - group_id = 0 + group_id = 4633861554207442788 id = 16 [part.oxidizer_tank] __plumbing_rot = 0 @@ -238,37 +238,9 @@ group_names = ["Other group"] [part.fuel_tank.__plumbing_pos] y = 0 x = 0 -[[part]] - proto = "test_parts:parts/engine/part_engine.toml" - group_id = -1 - id = 2 - [part.engine] - __plumbing_rot = 0 - [part.engine.__plumbing_pos] - y = 16 - x = -4 -[[part]] - proto = "test_parts:parts/decoupler/part_decoupler.toml" - group_id = -1 - id = 4 - [part.decoupler] [[part]] proto = "test_parts:parts/fuel_tank/part_fuel_tank.toml" - group_id = -1 - id = 5 - [part.oxidizer_tank] - __plumbing_rot = 0 - [part.oxidizer_tank.__plumbing_pos] - y = -1 - x = -2 - [part.fuel_tank] - __plumbing_rot = 0 - [part.fuel_tank.__plumbing_pos] - y = -1 - x = -7 -[[part]] - proto = "test_parts:parts/fuel_tank/part_fuel_tank.toml" - group_id = -4508103223694336000 + group_id = 94147221103392 id = 15 [part.oxidizer_tank] __plumbing_rot = 0 @@ -282,7 +254,7 @@ group_names = ["Other group"] x = 0 [[part]] proto = "test_parts:parts/fuel_tank/part_fuel_tank.toml" - group_id = 0 + group_id = 281500746579969 id = 14 [part.oxidizer_tank] __plumbing_rot = 0 @@ -296,8 +268,8 @@ group_names = ["Other group"] x = 0 [[part]] proto = "test_parts:parts/fuel_tank/part_fuel_tank.toml" - group_id = 2533330625822732 - id = 6 + group_id = 281500746579969 + id = 11 [part.oxidizer_tank] __plumbing_rot = 0 [part.oxidizer_tank.__plumbing_pos] @@ -308,15 +280,10 @@ group_names = ["Other group"] [part.fuel_tank.__plumbing_pos] y = 0 x = 0 -[[part]] - proto = "test_parts:parts/capsule/part_capsule.toml" - group_id = -1 - id = 3 - [part.capsule] [[part]] proto = "test_parts:parts/fuel_tank/part_fuel_tank.toml" - group_id = 281500746579969 - id = 7 + group_id = -9223372035789422592 + id = 18 [part.oxidizer_tank] __plumbing_rot = 0 [part.oxidizer_tank.__plumbing_pos] @@ -329,36 +296,36 @@ group_names = ["Other group"] x = 0 [[part]] proto = "test_parts:parts/fuel_tank/part_fuel_tank.toml" - group_id = 281500746579969 - id = 1 + group_id = 0 + id = 2 [part.oxidizer_tank] __plumbing_rot = 0 [part.oxidizer_tank.__plumbing_pos] - y = 21 - x = -1 + y = 0 + x = 6 [part.fuel_tank] __plumbing_rot = 0 [part.fuel_tank.__plumbing_pos] - y = 21 - x = -7 + y = 0 + x = 0 [[part]] proto = "test_parts:parts/fuel_tank/part_fuel_tank.toml" - group_id = 5188 - id = 8 + group_id = 0 + id = 3 [part.oxidizer_tank] __plumbing_rot = 0 [part.oxidizer_tank.__plumbing_pos] - y = 26 - x = -1 + y = 0 + x = 6 [part.fuel_tank] __plumbing_rot = 0 [part.fuel_tank.__plumbing_pos] - y = 26 - x = -7 + y = 0 + x = 0 [[part]] proto = "test_parts:parts/fuel_tank/part_fuel_tank.toml" - group_id = 281500746579969 - id = 9 + group_id = -4508103223694336000 + id = 7 [part.oxidizer_tank] __plumbing_rot = 0 [part.oxidizer_tank.__plumbing_pos] @@ -371,8 +338,8 @@ group_names = ["Other group"] x = 0 [[part]] proto = "test_parts:parts/fuel_tank/part_fuel_tank.toml" - group_id = 94147221103392 - id = 17 + group_id = 94147221203544 + id = 1 [part.oxidizer_tank] __plumbing_rot = 0 [part.oxidizer_tank.__plumbing_pos] @@ -385,8 +352,8 @@ group_names = ["Other group"] x = 0 [[part]] proto = "test_parts:parts/fuel_tank/part_fuel_tank.toml" - group_id = 4633861554207442788 - id = 10 + group_id = 2533330625822732 + id = 9 [part.oxidizer_tank] __plumbing_rot = 0 [part.oxidizer_tank.__plumbing_pos] @@ -397,24 +364,52 @@ group_names = ["Other group"] [part.fuel_tank.__plumbing_pos] y = 0 x = 0 +[[part]] + proto = "test_parts:parts/engine/part_engine.toml" + group_id = -1 + id = 4 + [part.engine] + __plumbing_rot = 0 + [part.engine.__plumbing_pos] + y = 16 + x = -4 +[[part]] + proto = "test_parts:parts/decoupler/part_decoupler.toml" + group_id = -1 + id = 5 + [part.decoupler] [[part]] proto = "test_parts:parts/fuel_tank/part_fuel_tank.toml" group_id = 281500746579969 - id = 11 + id = 12 [part.oxidizer_tank] __plumbing_rot = 0 [part.oxidizer_tank.__plumbing_pos] - y = 31 + y = 21 x = -1 [part.fuel_tank] __plumbing_rot = 0 [part.fuel_tank.__plumbing_pos] - y = 31 + y = 21 x = -7 [[part]] proto = "test_parts:parts/fuel_tank/part_fuel_tank.toml" - group_id = -9223372035789422592 - id = 12 + group_id = -1 + id = 6 + [part.oxidizer_tank] + __plumbing_rot = 0 + [part.oxidizer_tank.__plumbing_pos] + y = -1 + x = -2 + [part.fuel_tank] + __plumbing_rot = 0 + [part.fuel_tank.__plumbing_pos] + y = -1 + x = -7 +[[part]] + proto = "test_parts:parts/fuel_tank/part_fuel_tank.toml" + group_id = 0 + id = 8 [part.oxidizer_tank] __plumbing_rot = 0 [part.oxidizer_tank.__plumbing_pos] @@ -427,15 +422,32 @@ group_names = ["Other group"] x = 0 [[part]] proto = "test_parts:parts/fuel_tank/part_fuel_tank.toml" - group_id = 3342912776466489188 + group_id = 5188 id = 13 [part.oxidizer_tank] __plumbing_rot = 0 [part.oxidizer_tank.__plumbing_pos] - y = 0 - x = 6 + y = 26 + x = -1 [part.fuel_tank] __plumbing_rot = 0 [part.fuel_tank.__plumbing_pos] - y = 0 - x = 0 + y = 26 + x = -7 +[[part]] + proto = "test_parts:parts/capsule/part_capsule.toml" + group_id = -1 + id = 10 + [part.capsule] +[[logical_group]] + id = "core:control" + [[logical_group.connection]] + to = 10 + fmachine = "engine" + tmachine = "capsule" + from = 4 + [[logical_group.connection]] + to = 10 + fmachine = "decoupler" + tmachine = "capsule" + from = 5