Skip to content

Commit

Permalink
Remove translate_ter (#73437)
Browse files Browse the repository at this point in the history
* Remove C++

* Remove docs

* Remove remaining usages

* Make place_ter_furn_transforms x/y arrays have intuitive functionality

* Update ter_furn_transforms docs

* Whoops
  • Loading branch information
Procyonae authored May 3, 2024
1 parent 90d6620 commit 24503b7
Show file tree
Hide file tree
Showing 11 changed files with 106 additions and 129 deletions.
68 changes: 68 additions & 0 deletions data/json/mapgen/nested/aux_nested.json
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,18 @@
"place_item": [ { "item": "glass_shard", "x": 0, "y": 0, "repeat": [ 27, 39 ] } ]
}
},
{
"type": "mapgen",
"method": "json",
"nested_mapgen_id": "1x1_boarded_up",
"object": { "mapgensize": [ 1, 1 ], "place_ter_furn_transforms": [ { "transform": "boarded_up", "x": 0, "y": 0 } ] }
},
{
"type": "mapgen",
"method": "json",
"nested_mapgen_id": "1x1_boarded_up_rushed",
"object": { "mapgensize": [ 1, 1 ], "place_ter_furn_transforms": [ { "transform": "boarded_up_rushed", "x": 0, "y": 0 } ] }
},
{
"type": "ter_furn_transform",
"id": "damaged_window",
Expand Down Expand Up @@ -256,6 +268,29 @@
{ "result": "t_door_green_frame", "valid_terrain": [ "t_door_green_c", "t_door_green_o", "t_door_green_b" ] }
]
},
{
"type": "ter_furn_transform",
"id": "boarded_up",
"terrain": [
{ "result": "t_door_boarded", "valid_flags": [ "DOOR" ] },
{ "result": "t_window_boarded", "valid_flags": [ "WINDOW" ] },
{ "result": "t_scrap_wall", "valid_terrain": [ "t_wall_glass" ] }
]
},
{
"type": "ter_furn_transform",
"id": "boarded_up_rushed",
"terrain": [
{ "result": "t_door_locked", "valid_flags": [ "DOOR" ] },
{ "result": "t_window_taped", "valid_flags": [ "WINDOW" ] }
]
},
{
"type": "ter_furn_transform",
"id": "cut_foliage",
"terrain": [ { "result": "t_dirt", "valid_flags": [ "SHRUB" ], "valid_terrain": [ "t_grass", "t_grass_dead" ] } ],
"furniture": [ { "result": "f_null", "valid_flags": [ "FLOWER" ] } ]
},
{
"type": "ter_furn_transform",
"id": "destroyed_metal_door",
Expand All @@ -271,6 +306,11 @@
"id": "destroyed_window_bars",
"terrain": [ { "result": "t_window_empty", "valid_terrain": [ "t_window_bars", "t_window_bars_alarm" ] } ]
},
{
"type": "ter_furn_transform",
"id": "fit_door",
"terrain": [ { "result": "t_door_c", "valid_terrain": [ "t_door_frame" ] } ]
},
{
"type": "ter_furn_transform",
"id": "looted_gunsafe",
Expand All @@ -286,6 +326,34 @@
"id": "open_gunsafe",
"furniture": [ { "result": "f_gunsafe_o", "valid_furniture": [ "f_gunsafe_ml" ] } ]
},
{
"type": "ter_furn_transform",
"id": "unlock_door",
"terrain": [
{
"result": "t_door_c",
"valid_terrain": [ "t_door_locked_interior", "t_door_locked", "t_door_elocked", "t_door_locked_alarm", "t_door_elocked_alarm" ]
},
{ "result": "t_door_c_peep", "valid_terrain": [ "t_door_locked_peep" ] },
{ "result": "t_door_metal_c", "valid_terrain": [ "t_door_metal_locked", "t_door_metal_interior_locked" ] },
{ "result": "t_door_bar_o", "valid_terrain": [ "t_door_bar_locked" ] }
]
},
{
"type": "ter_furn_transform",
"id": "ranch_wall_upgrade1",
"terrain": [ { "result": "t_wall_wood", "valid_terrain": [ "t_wall_half" ] } ]
},
{
"type": "ter_furn_transform",
"id": "ranch_wall_upgrade2",
"terrain": [ { "result": "t_wall", "valid_terrain": [ "t_wall_wood" ] } ]
},
{
"type": "ter_furn_transform",
"id": "ranch_window_upgrade1",
"terrain": [ { "result": "t_window_boarded_noglass", "valid_terrain": [ "t_window_empty" ] } ]
},
{
"type": "mapgen",
"method": "json",
Expand Down
2 changes: 1 addition & 1 deletion data/json/mapgen_palettes/ranch_camp.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"+": "t_door_c",
",": "t_pavement_y",
"-": "t_wall_w",
".": [ [ "t_region_groundcover_barren", 30 ], [ "t_region_groundcover", 35 ], "t_region_shrub" ],
".": [ [ "t_region_groundcover_barren", 30 ], [ "t_region_groundcover", 35 ], "t_region_shrub_plains" ],
"/": "t_region_groundcover_barren",
"5": "t_barndoor",
"6": "t_palisade_pulley",
Expand Down
2 changes: 1 addition & 1 deletion data/json/npcs/Backgrounds/prepper_1.json
Original file line number Diff line number Diff line change
Expand Up @@ -808,6 +808,6 @@
"type": "mapgen",
"update_mapgen_id": "LMOE_unlock_door",
"method": "json",
"object": { "translate_ter": [ { "from": "t_door_metal_locked", "to": "t_door_metal_c", "x": 0, "y": 0 } ] }
"object": { "place_ter_furn_transforms": [ { "transform": "unlock_door", "x": 0, "y": 0 } ] }
}
]
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@
"update_mapgen_id": "cardboard_castle_1_main",
"method": "json",
"object": {
"translate_ter": [ { "from": "t_door_metal_locked", "to": "t_door_metal_c", "x": [ 0, 23 ], "y": [ 0, 23 ] } ],
"place_ter_furn_transforms": [ { "transform": "unlock_door", "x": [ 0, 23 ], "y": [ 0, 23 ] } ],
"place_nested": [ { "chunks": [ "cardboard_castle_1_main" ], "x": 0, "y": 17 } ],
"set": [ { "point": "variable", "id": "dave_castle", "x": 4, "y": 19 } ]
}
Expand Down
7 changes: 0 additions & 7 deletions data/json/npcs/tacoma_ranch/NPC_ranch_crop_overseer.json
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,6 @@
"effect": [
{ "u_sell_item": "FMCNote", "count": 200 },
{ "npc_add_trait": "NPC_CONSTRUCTION_LEV_2" },
{ "mapgen_update": "tacoma_commune_crop_overseer_field_1_fence_legacy", "om_terrain": "ranch_camp_63" },
{
"u_message": "After counting your money, <npc_name> directs a nearby laborer to begin constructing a fence around your plot…",
"type": "good",
Expand Down Expand Up @@ -285,11 +284,6 @@
{ "npc_lose_trait": "NPC_CONSTRUCTION_LEV_2" },
{ "npc_add_var": "dialogue_tacoma_ranch_purchased_field_1", "value": "yes" },
{ "npc_add_var": "dialogue_tacoma_ranch_purchased_field_1_fence", "value": "yes" },
{ "mapgen_update": "tacoma_commune_crop_overseer_field_1_legacy_clear", "om_terrain": "ranch_camp_63" },
{
"mapgen_update": "tacoma_commune_crop_overseer_field_1_fence_legacy_clear",
"om_terrain": "ranch_camp_63"
},
{ "mapgen_update": "tacoma_commune_crop_overseer_field_1_plant", "om_terrain": "ranch_camp_63" },
{ "mapgen_update": "tacoma_commune_crop_overseer_field_1_fence", "om_terrain": "ranch_camp_63" }
]
Expand All @@ -308,7 +302,6 @@
{ "u_sell_item": "FMCNote", "count": 100 },
{ "npc_lose_trait": "NPC_CONSTRUCTION_LEV_1" },
{ "npc_add_var": "dialogue_tacoma_ranch_purchased_field_1", "value": "yes" },
{ "mapgen_update": "tacoma_commune_crop_overseer_field_1_legacy_clear", "om_terrain": "ranch_camp_63" },
{ "mapgen_update": "tacoma_commune_crop_overseer_field_1_plant", "om_terrain": "ranch_camp_63" }
]
},
Expand Down
28 changes: 14 additions & 14 deletions data/json/npcs/tacoma_ranch/NPC_ranch_foreman.json
Original file line number Diff line number Diff line change
Expand Up @@ -171,12 +171,12 @@
"update_mapgen": [
{
"om_terrain": "ranch_camp_65",
"translate_ter": [ { "from": "t_underbrush", "to": "t_dirt", "x": 0, "y": 0 } ],
"place_ter_furn_transforms": [ { "transform": "cut_foliage", "x": [ 0, 23 ], "y": [ 0, 23 ] } ],
"place_nested": [ { "chunks": [ "tacoma_commune_west_wall_door" ], "x": 22, "y": 0 } ]
},
{
"om_terrain": "ranch_camp_66",
"translate_ter": [ { "from": "t_underbrush", "to": "t_dirt", "x": 0, "y": 0 } ],
"place_ter_furn_transforms": [ { "transform": "cut_foliage", "x": [ 0, 23 ], "y": [ 0, 23 ] } ],
"place_nested": [
{ "chunks": [ "tacoma_commune_east_wall_door" ], "x": 0, "y": 0 },
{ "chunks": [ "tacoma_commune_west_wall_door" ], "x": 13, "y": 0 },
Expand All @@ -185,12 +185,12 @@
},
{
"om_terrain": "ranch_camp_74",
"translate_ter": [ { "from": "t_underbrush", "to": "t_dirt", "x": 0, "y": 0 } ],
"place_ter_furn_transforms": [ { "transform": "cut_foliage", "x": [ 0, 23 ], "y": [ 0, 23 ] } ],
"place_nested": [ { "chunks": [ "tacoma_commune_west_wall_door" ], "x": 22, "y": 0 } ]
},
{
"om_terrain": "ranch_camp_75",
"translate_ter": [ { "from": "t_underbrush", "to": "t_dirt", "x": 0, "y": 0 } ],
"place_ter_furn_transforms": [ { "transform": "cut_foliage", "x": [ 0, 23 ], "y": [ 0, 23 ] } ],
"place_nested": [
{ "chunks": [ "tacoma_commune_east_wall_door" ], "x": 0, "y": 0 },
{ "chunks": [ "tacoma_commune_west_wall_door" ], "x": 13, "y": 0 },
Expand Down Expand Up @@ -291,7 +291,7 @@
{
"om_terrain": "ranch_camp_46",
"//": "tilled soil in the fields",
"translate_ter": [ { "from": "t_underbrush", "to": "t_dirt", "x": 0, "y": 0 } ],
"place_ter_furn_transforms": [ { "transform": "cut_foliage", "x": [ 0, 23 ], "y": [ 0, 23 ] } ],
"set": [
{ "square": "terrain", "id": "t_dirt", "x": 7, "y": 4, "x2": 22, "y2": 23 },
{ "square": "terrain", "id": "t_dirtmound", "x": 8, "y": 5, "x2": 9, "y2": 22 },
Expand All @@ -301,7 +301,7 @@
{
"om_terrain": "ranch_camp_55",
"//": "tilled soil in the fields",
"translate_ter": [ { "from": "t_underbrush", "to": "t_dirt", "x": 0, "y": 0 } ],
"place_ter_furn_transforms": [ { "transform": "cut_foliage", "x": [ 0, 23 ], "y": [ 0, 23 ] } ],
"set": [
{ "square": "terrain", "id": "t_dirt", "x": 7, "y": 0, "x2": 22, "y2": 18 },
{ "square": "terrain", "id": "t_dirtmound", "x": 8, "y": 2, "x2": 9, "y2": 17 },
Expand All @@ -310,7 +310,7 @@
},
{
"om_terrain": "ranch_camp_56",
"translate_ter": [ { "from": "t_underbrush", "to": "t_dirt", "x": 0, "y": 0 } ],
"place_ter_furn_transforms": [ { "transform": "cut_foliage", "x": [ 0, 23 ], "y": [ 0, 23 ] } ],
"place_vehicles": [ { "vehicle": "hippie_van", "x": 13, "y": 19, "rotation": 270, "chance": 100, "faction": "tacoma_commune" } ]
},
{
Expand Down Expand Up @@ -373,17 +373,17 @@
},
{
"om_terrain": "ranch_camp_57",
"translate_ter": [ { "from": "t_underbrush", "to": "t_dirt", "x": 0, "y": 0 } ],
"place_ter_furn_transforms": [ { "transform": "cut_foliage", "x": [ 0, 23 ], "y": [ 0, 23 ] } ],
"place_npcs": [ { "class": "ranch_crop_overseer", "x": 12, "y": 7 } ]
},
{
"om_terrain": "ranch_camp_58",
"translate_ter": [ { "from": "t_underbrush", "to": "t_dirt", "x": 0, "y": 0 } ],
"place_ter_furn_transforms": [ { "transform": "cut_foliage", "x": [ 0, 23 ], "y": [ 0, 23 ] } ],
"place_nested": [ { "chunks": [ "tacoma_commune_lumbermill_4" ], "x": 0, "y": 2 } ]
},
{
"om_terrain": "ranch_camp_67",
"translate_ter": [ { "from": "t_underbrush", "to": "t_dirt", "x": 0, "y": 0 } ],
"place_ter_furn_transforms": [ { "transform": "cut_foliage", "x": [ 0, 23 ], "y": [ 0, 23 ] } ],
"set": [ { "square": "terrain", "id": "t_palisade", "x": 21, "y": 19, "x2": 23, "y2": 19 } ]
}
]
Expand Down Expand Up @@ -740,7 +740,7 @@
},
{
"om_terrain": "ranch_camp_69",
"translate_ter": [ { "from": "t_underbrush", "to": "t_dirt", "x": 0, "y": 0 } ],
"place_ter_furn_transforms": [ { "transform": "cut_foliage", "x": [ 0, 23 ], "y": [ 0, 23 ] } ],
"set": [ { "square": "terrain", "id": "t_palisade", "x": 0, "y": 12, "x2": 2, "y2": 12 } ],
"place_vehicles": [
{ "vehicle": "car_chassis", "chance": 100, "rotation": 0, "x": 3, "y": 14, "faction": "tacoma_commune" },
Expand Down Expand Up @@ -785,7 +785,7 @@
},
{
"om_terrain": "ranch_camp_69",
"translate_ter": [ { "from": "t_underbrush", "to": "t_dirt", "x": 0, "y": 0 } ],
"place_ter_furn_transforms": [ { "transform": "cut_foliage", "x": [ 0, 23 ], "y": [ 0, 23 ] } ],
"place_vehicles": [
{ "vehicle": "cube_van", "chance": 100, "rotation": 180, "x": 13, "y": 15, "faction": "tacoma_commune" },
{ "vehicle": "car_sports", "chance": 100, "rotation": 0, "x": 21, "y": 14, "faction": "tacoma_commune" }
Expand Down Expand Up @@ -826,7 +826,7 @@
{ "om_terrain": "ranch_camp_66", "place_npcs": [ { "class": "ranch_barber", "x": 5, "y": 3 } ] },
{
"om_terrain": "ranch_camp_70",
"translate_ter": [ { "from": "t_underbrush", "to": "t_dirt", "x": 0, "y": 0 } ],
"place_ter_furn_transforms": [ { "transform": "cut_foliage", "x": [ 0, 23 ], "y": [ 0, 23 ] } ],
"place_vehicles": [ { "vehicle": "car_sports", "chance": 100, "rotation": 90, "x": 9, "y": 2, "faction": "tacoma_commune" } ]
}
]
Expand Down Expand Up @@ -866,7 +866,7 @@
},
{
"om_terrain": "ranch_camp_61",
"translate_ter": [ { "from": "t_underbrush", "to": "t_dirt", "x": 0, "y": 0 } ],
"place_ter_furn_transforms": [ { "transform": "cut_foliage", "x": [ 0, 23 ], "y": [ 0, 23 ] } ],
"place_vehicles": [ { "vehicle": "ambulance", "chance": 100, "rotation": 270, "x": 13, "y": 2, "faction": "tacoma_commune" } ]
}
]
Expand Down
16 changes: 8 additions & 8 deletions data/json/npcs/tacoma_ranch/NPC_ranch_nurse.json
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@
"update_mapgen": [
{
"om_terrain": "ranch_camp_50",
"translate_ter": [ { "from": "t_wall_half", "to": "t_wall_wood", "x": 0, "y": 0 } ],
"place_ter_furn_transforms": [ { "transform": "ranch_wall_upgrade1", "x": [ 0, 23 ], "y": [ 0, 23 ] } ],
"set": [
{ "point": "terrain", "id": "t_window_empty", "x": 2, "y": 18 },
{ "point": "terrain", "id": "t_window_empty", "x": 2, "y": 21 },
Expand All @@ -302,7 +302,7 @@
},
{
"om_terrain": "ranch_camp_59",
"translate_ter": [ { "from": "t_wall_half", "to": "t_wall_wood", "x": 0, "y": 0 } ],
"place_ter_furn_transforms": [ { "transform": "ranch_wall_upgrade1", "x": [ 0, 23 ], "y": [ 0, 23 ] } ],
"place_item": [ { "item": "chemistry_set", "x": 5, "y": 5, "faction": "tacoma_commune" } ]
}
]
Expand Down Expand Up @@ -334,9 +334,9 @@
"update_mapgen": [
{
"om_terrain": "ranch_camp_50",
"translate_ter": [
{ "from": "t_window_empty", "to": "t_window_boarded_noglass", "x": 0, "y": 0 },
{ "from": "t_door_frame", "to": "t_door_c", "x": 0, "y": 0 }
"place_ter_furn_transforms": [
{ "transform": "ranch_window_upgrade1", "x": [ 0, 23 ], "y": [ 0, 23 ] },
{ "transform": "fit_door", "x": [ 0, 23 ], "y": [ 0, 23 ] }
],
"set": [
{ "square": "terrain", "id": "t_dirtfloor", "x": 3, "y": 17, "x2": 8, "y2": 22 },
Expand All @@ -346,7 +346,7 @@
},
{
"om_terrain": "ranch_camp_59",
"translate_ter": [ { "from": "t_door_frame", "to": "t_door_c", "x": 0, "y": 0 } ],
"place_ter_furn_transforms": [ { "transform": "fit_door", "x": [ 0, 23 ], "y": [ 0, 23 ] } ],
"set": [
{ "square": "terrain", "id": "t_dirtfloor", "x": 5, "y": 0, "x2": 8, "y2": 2 },
{ "square": "terrain", "id": "t_dirtfloor", "x": 10, "y": 0, "x2": 12, "y2": 4 },
Expand Down Expand Up @@ -442,11 +442,11 @@
{ "chunks": [ "tacoma_commune_clinic_bed" ], "x": 15, "y": 17 },
{ "chunks": [ "tacoma_commune_clinic_bed" ], "x": 18, "y": 17 }
],
"translate_ter": [ { "from": "t_wall_wood", "to": "t_wall", "x": 0, "y": 0 } ]
"place_ter_furn_transforms": [ { "transform": "ranch_wall_upgrade2", "x": [ 0, 23 ], "y": [ 0, 23 ] } ]
},
{
"om_terrain": "ranch_camp_59",
"translate_ter": [ { "from": "t_wall_wood", "to": "t_wall", "x": 0, "y": 0 } ],
"place_ter_furn_transforms": [ { "transform": "ranch_wall_upgrade2", "x": [ 0, 23 ], "y": [ 0, 23 ] } ],
"place_items": [
{ "chance": 100, "item": "cleaning", "x": 17, "y": [ 0, 2 ], "repeat": [ 1, 3 ], "faction": "tacoma_commune" },
{
Expand Down
39 changes: 0 additions & 39 deletions data/json/npcs/tacoma_ranch/mission_mapgen_tacoma_commune.json
Original file line number Diff line number Diff line change
Expand Up @@ -1124,45 +1124,6 @@
"method": "json",
"object": { "place_item": [ { "item": "log", "x": 7, "y": 15, "amount": 100 } ] }
},
{
"type": "mapgen",
"update_mapgen_id": "tacoma_commune_crop_overseer_field_1_fence_legacy",
"method": "json",
"object": {
"set": [
{ "square": "terrain", "id": "t_fence", "x": 4, "y": 3, "x2": 16, "y2": 3 },
{ "square": "terrain", "id": "t_fence", "x": 4, "y": 15, "x2": 16, "y2": 15 },
{ "square": "terrain", "id": "t_fence", "x": 4, "y": 4, "x2": 4, "y2": 14 },
{ "square": "terrain", "id": "t_fence", "x": 16, "y": 4, "x2": 16, "y2": 14 },
{ "point": "terrain", "id": "t_fencegate_c", "x": 10, "y": 3 },
{ "point": "terrain", "id": "t_fencegate_c", "x": 10, "y": 15 },
{ "point": "terrain", "id": "t_fencegate_c", "x": 4, "y": 9 }
]
}
},
{
"type": "mapgen",
"update_mapgen_id": "tacoma_commune_crop_overseer_field_1_legacy_clear",
"method": "json",
"object": {
"translate_ter": [ { "from": "t_dirtmound", "to": "t_dirt", "x": [ 0, 23 ], "y": [ 0, 23 ] } ],
"set": [
{ "square": "furniture", "id": "f_clear", "x": 0, "y": 0, "x2": 23, "y2": 23 },
{ "square": "item_remove", "x": 0, "y": 0, "x2": 23, "y2": 23 }
]
}
},
{
"type": "mapgen",
"update_mapgen_id": "tacoma_commune_crop_overseer_field_1_fence_legacy_clear",
"method": "json",
"object": {
"translate_ter": [
{ "from": "t_fence", "to": "t_dirt", "x": [ 0, 23 ], "y": [ 0, 23 ] },
{ "from": "t_fencegate_c", "to": "t_dirt", "x": [ 0, 23 ], "y": [ 0, 23 ] }
]
}
},
{
"type": "mapgen",
"update_mapgen_id": "tacoma_commune_crop_overseer_field_1_plant",
Expand Down
10 changes: 1 addition & 9 deletions data/mods/No_Hope/Mapgen/map_extras/mapgen_updates.json
Original file line number Diff line number Diff line change
Expand Up @@ -279,15 +279,7 @@
" ",
" "
],
"terrain": { " ": "t_null" },
"translate_ter": [
{ "from": "t_door_locked_interior", "to": "t_door_boarded", "x": [ 0, 23 ], "y": [ 0, 23 ] },
{ "from": "t_door_locked", "to": "t_door_boarded", "x": [ 0, 23 ], "y": [ 0, 23 ] },
{ "from": "t_window", "to": "t_window_taped", "x": [ 0, 23 ], "y": [ 0, 23 ] },
{ "from": "t_window_domestic", "to": "t_window_boarded", "x": [ 0, 23 ], "y": [ 0, 23 ] },
{ "from": "t_curtains", "to": "t_window_boarded", "x": [ 0, 23 ], "y": [ 0, 23 ] },
{ "from": "t_wall_glass", "to": "t_window_boarded", "x": [ 0, 23 ], "y": [ 0, 23 ] }
],
"nested": { " ": { "chunks": [ [ "1x1_boarded_up", 2 ], [ "1x1_boarded_up_rushed", 1 ] ] } },
"place_zones": [
{ "type": "NPC_NO_INVESTIGATE", "faction": "hells_raiders", "x": [ 0, 23 ], "y": [ 0, 6 ] },
{ "type": "NPC_NO_INVESTIGATE", "faction": "hells_raiders", "x": [ 0, 23 ], "y": [ 17, 23 ] },
Expand Down
Loading

0 comments on commit 24503b7

Please sign in to comment.