From 9425efbffe59416d07f4338532acc87847e67cfa Mon Sep 17 00:00:00 2001 From: Runa Dacino Date: Mon, 6 Mar 2023 21:07:42 +0100 Subject: [PATCH] Fixes compile_pois failing --- code/controllers/subsystems/overmap_renamer_vr.dm | 4 ++-- .../awaymissions/overmap_renamer/debrisfield_renamer.dm | 7 ++++--- code/modules/awaymissions/overmap_renamer/readme.md | 8 +++++--- code/modules/overmap/sectors.dm | 2 ++ maps/expedition_vr/space/_debrisfield.dm | 1 + 5 files changed, 14 insertions(+), 8 deletions(-) diff --git a/code/controllers/subsystems/overmap_renamer_vr.dm b/code/controllers/subsystems/overmap_renamer_vr.dm index 6731e989d3..6dec2a5b2c 100644 --- a/code/controllers/subsystems/overmap_renamer_vr.dm +++ b/code/controllers/subsystems/overmap_renamer_vr.dm @@ -23,8 +23,8 @@ if we end up with multiple renamable lateload overmap objects.*/ if(!visitable_Z_levels_name_list || !islist(visitable_Z_levels_name_list) || !length(visitable_Z_levels_name_list)) return if("Debris Field - Z1 Space" in visitable_Z_levels_name_list) - for(var/obj/effect/overmap/visitable/sector/debrisfield/D in visitable_overmap_object_instances) - if(D && istype(D)) + for(var/obj/effect/overmap/visitable/D in visitable_overmap_object_instances) + if(D.unique_identifier == "Debris Field") D.modify_descriptors() if(D.visitable_renamed) //could just if(D.modify_descriptors()), but having a var recording renaming is useful for debugging and stuff! if(D.known) diff --git a/code/modules/awaymissions/overmap_renamer/debrisfield_renamer.dm b/code/modules/awaymissions/overmap_renamer/debrisfield_renamer.dm index 7d183088d2..100efec22f 100644 --- a/code/modules/awaymissions/overmap_renamer/debrisfield_renamer.dm +++ b/code/modules/awaymissions/overmap_renamer/debrisfield_renamer.dm @@ -7,6 +7,7 @@ /obj/effect/landmark/overmap_renamer/debris_field/Initialize() ..() - for(var/obj/effect/overmap/visitable/sector/debrisfield/D in visitable_overmap_object_instances) - if(D.possible_descriptors && islist(D.possible_descriptors)) - D.possible_descriptors |= list(descriptors) + for(var/obj/effect/overmap/visitable/D in visitable_overmap_object_instances) + if(D.unique_identifier == "Debris Field") + if(D.possible_descriptors && islist(D.possible_descriptors)) + D.possible_descriptors |= list(descriptors) diff --git a/code/modules/awaymissions/overmap_renamer/readme.md b/code/modules/awaymissions/overmap_renamer/readme.md index 14392b4410..39536438e2 100644 --- a/code/modules/awaymissions/overmap_renamer/readme.md +++ b/code/modules/awaymissions/overmap_renamer/readme.md @@ -25,19 +25,20 @@ How to use - for mappers: Did you want to make an abandoned mining facility overmap adventure? Now this system will let you turn the DF into one (if the dice permits) Adding a new POI to a brand new lateloaded Z level (you can check which Z levels are handled by the renamer in code\controllers\subsystems\overmap_renamer_vr.dm) + First, go to your /obj/effect/overmap/visitable, and define unique_identifier as something unique. Like, "Debris Field" - basically, this is a way to check if the map loaded without causing compiler errors. + Your task will become a bit more difficult now. Create a new .dm file following convention already estabilished with debrisfield_renamer.dm Within this file, define your /obj/effect/landmark/overmap_renamer/newname here Within this file, create a new /obj/effect/landmark/overmap_renamer/newname/Initialize() Within this proc, copy what's done in code\modules\awaymissions\overmap_renamer\debrisfield_renamer.dm - except, replace var/obj/effect/overmap/visitable/sector/debrisfield/D with var/obj/effect/overmap/visitable/my/sector/S, - naturally replacing D with whatever you decided to name this var. + except, replace if(D == "Debris Field") with whatever your unique identifier was defined for your specific overmap object Now go to code\controllers\subsystems\overmap_renamer_vr.dm copy the if("Debris Field - Z1 Space" in visitable_Z_levels_name_list) and everything belonging to this if statement paste it below this if statement and change things as described: change the if("map_template.name goes here" in visitable_z_levels_name_list) (you can get the proper name by going to wherever your /datum/map_template/ for your map is. For Debris field, it's maps\offmap_vr\common_offmaps.dm. Yours is probably there too!) - change the for(var/obj/effect/overmap/visitable/sector/debrisfield/D in visitable_overmap_object_instances) section in your new if statement just like you did for the landmark! + change the if(D == "Debris Field") section in your new if statement just like you did for the landmark! And you're done! Refer to the "How to add a landmark" section on the top from now on. @@ -52,6 +53,7 @@ code\_helpers\global_lists_vr.dm code\modules\overmap\sectors.dm var/list/possible_descriptors - contains a list of list("name","desc","scanner_desc") + var/unique_identifier - A way to check if the object in question loaded without causing a compiler error. Name them sth easy to recognize, like "Debris field" for... debris field. var/real_name - Used to handle known = FALSE overmap objects properly var/real_desc - same as real_name /obj/effect/overmap/visitable/Initialize() - adds the object's instance with reference to visitable_overmap_object_instances diff --git a/code/modules/overmap/sectors.dm b/code/modules/overmap/sectors.dm index 354595ce50..4fb71ff02f 100644 --- a/code/modules/overmap/sectors.dm +++ b/code/modules/overmap/sectors.dm @@ -42,6 +42,8 @@ var/list/possible_descriptors = list() //While only affects sectors for now, initialized here for proc definition convenience. var/visitable_renamed = FALSE //changed if non-default name is assigned. + var/unique_identifier //Define this for objs that we want to be able to rename. Needed to avoid compiler errors if not included. + /obj/effect/overmap/visitable/Initialize() . = ..() if(. == INITIALIZE_HINT_QDEL) diff --git a/maps/expedition_vr/space/_debrisfield.dm b/maps/expedition_vr/space/_debrisfield.dm index 7505d2b41f..b51c01ee31 100644 --- a/maps/expedition_vr/space/_debrisfield.dm +++ b/maps/expedition_vr/space/_debrisfield.dm @@ -11,6 +11,7 @@ initial_generic_waypoints = list("debrisfield_se", "debrisfield_nw") icon_state = "spacehulk_g" possible_descriptors = list("default") + unique_identifier = "Debris Field" // -- Objs -- //