about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorStar Rauchenberger <fefferburbia@gmail.com>2025-10-23 12:28:39 -0400
committerStar Rauchenberger <fefferburbia@gmail.com>2025-10-23 12:28:39 -0400
commit1d81570d217e7827ad089f07272bfa668a172c3d (patch)
treeccc6b06d17a57ef6a0c5f437150ae64d035b257d
parentb5942389aa81b2f10e57e27e1c39164b1197b111 (diff)
downloadlingo2-archipelago-1d81570d217e7827ad089f07272bfa668a172c3d.tar.gz
lingo2-archipelago-1d81570d217e7827ad089f07272bfa668a172c3d.tar.bz2
lingo2-archipelago-1d81570d217e7827ad089f07272bfa668a172c3d.zip
Allow validator to ignore custom nodes
-rw-r--r--data/maps/the_advanced/metadata.txtpb2
-rw-r--r--data/maps/the_entry/metadata.txtpb3
-rw-r--r--data/maps/the_sturdy/metadata.txtpb3
-rw-r--r--proto/human.proto13
-rw-r--r--tools/validator/human_processor.cpp4
5 files changed, 23 insertions, 2 deletions
diff --git a/data/maps/the_advanced/metadata.txtpb b/data/maps/the_advanced/metadata.txtpb index 578fe72..cee10b6 100644 --- a/data/maps/the_advanced/metadata.txtpb +++ b/data/maps/the_advanced/metadata.txtpb
@@ -1,2 +1,4 @@
1display_name: "The Advanced" 1display_name: "The Advanced"
2type: GIFT_MAP 2type: GIFT_MAP
3# The map's mastery is created at runtime.
4custom_nodes: "Components/Collectables/collectable"
diff --git a/data/maps/the_entry/metadata.txtpb b/data/maps/the_entry/metadata.txtpb index 0eeb29a..9536831 100644 --- a/data/maps/the_entry/metadata.txtpb +++ b/data/maps/the_entry/metadata.txtpb
@@ -11,3 +11,6 @@ excluded_nodes: "Panels/Back Left/backleft_4_proxied_1"
11excluded_nodes: "Panels/Back Left/backleft_4_proxied_2" 11excluded_nodes: "Panels/Back Left/backleft_4_proxied_2"
12# This is a proxy related to the first panel and it doesn't seem useful. 12# This is a proxy related to the first panel and it doesn't seem useful.
13excluded_nodes: "Panels/Entry/entry_proxied_fake" 13excluded_nodes: "Panels/Entry/entry_proxied_fake"
14# The gift map entrance is created by the mod.
15custom_nodes: "Components/GiftMapEntrance/IcelyPanel"
16custom_nodes: "Components/GiftMapEntrance/Panel"
diff --git a/data/maps/the_sturdy/metadata.txtpb b/data/maps/the_sturdy/metadata.txtpb index 9f42137..624f765 100644 --- a/data/maps/the_sturdy/metadata.txtpb +++ b/data/maps/the_sturdy/metadata.txtpb
@@ -4,3 +4,6 @@ display_name: "The Sturdy"
4# I don't know why there's a second copy of the rainbow. 4# I don't know why there's a second copy of the rainbow.
5#excluded_nodes: "Components/Doors/Rainbow/Hinge/rainbow" 5#excluded_nodes: "Components/Doors/Rainbow/Hinge/rainbow"
6#excluded_nodes: "Components/Doors/Rainbow/Hinge/rainbowMirrored" 6#excluded_nodes: "Components/Doors/Rainbow/Hinge/rainbowMirrored"
7# The validator doesn't know that this node exists because it is part of a
8# sub-scene.
9custom_nodes: "Components/Doors/Rainbow2/Hinge/rainbow"
diff --git a/proto/human.proto b/proto/human.proto index 41fce45..df33a5e 100644 --- a/proto/human.proto +++ b/proto/human.proto
@@ -221,9 +221,18 @@ message HumanRoom {
221 221
222message HumanMap { 222message HumanMap {
223 optional string display_name = 1; 223 optional string display_name = 1;
224 repeated string excluded_nodes = 2;
225 optional PortIdentifier worldport_entrance = 3;
226 optional MapType type = 4; 224 optional MapType type = 4;
225
226 optional PortIdentifier worldport_entrance = 3;
227
228 // These two fields are used by the validator and nothing else. excluded_nodes
229 // are objects in the tscn that are intentionally not mentioned in the txtpb.
230 // custom_nodes are the reverse of that; objects that are mentioned in the
231 // txtpb but not present in the tscn. These are generally created dynamically
232 // by the game mod, but may also be used for places where the validator is
233 // just wrong about the contents of the map file.
234 repeated string excluded_nodes = 2;
235 repeated string custom_nodes = 5;
227} 236}
228 237
229message HumanProgressive { 238message HumanProgressive {
diff --git a/tools/validator/human_processor.cpp b/tools/validator/human_processor.cpp index de80db0..5a1c095 100644 --- a/tools/validator/human_processor.cpp +++ b/tools/validator/human_processor.cpp
@@ -78,6 +78,10 @@ class HumanProcessor {
78 map_info.game_nodes[path].uses++; 78 map_info.game_nodes[path].uses++;
79 } 79 }
80 80
81 for (const std::string& path : metadata.custom_nodes()) {
82 map_info.game_nodes[path].defined = true;
83 }
84
81 if (metadata.has_worldport_entrance()) { 85 if (metadata.has_worldport_entrance()) {
82 auto port_identifier = GetCompletePortIdentifier( 86 auto port_identifier = GetCompletePortIdentifier(
83 metadata.worldport_entrance(), current_map_name, std::nullopt); 87 metadata.worldport_entrance(), current_map_name, std::nullopt);