CleverRaven / Cataclysm-DDA

Cataclysm - Dark Days Ahead. A turn-based survival game set in a post-apocalyptic world.
http://cataclysmdda.org
Other
10.1k stars 4.11k forks source link

Overriding integral overmap terrain in a mod without copy-from results in errors #73200

Closed NetSysFire closed 4 months ago

NetSysFire commented 4 months ago

Describe the bug

I am making a mod where everything is barren and dead. Thus I want to rename the forest to "dead forest" and make its glyph brown:

[
  {
    "type": "overmap_terrain",
    "id": "forest",
    "name": "dead forest",
    "sym": "F",
    "color": "brown",
    "see_cost": 1
  }
]

This produces a heap of errors and stuff appears to break in weird ways.

Attach save file

n/a

Steps to reproduce

  1. Make a minimal mod with just the above change.
  2. Load or create a character with that mod.
 DEBUG    : Tried to add invalid overmap terrain forest to overmap_lake_settings shore_extendable_overmap_terrain.
 FUNCTION : void overmap_lake_settings::finalize()
 FILE     : src/regional_settings.cpp
 LINE     : 951
 VERSION  : cdda-experimental-2024-04-22-1537 a60d305

 DEBUG    : invalid overmap terrain id "forest"
 FUNCTION : int_id<T> generic_factory<T>::convert(const string_id<T>&, const int_id<T>&, bool) const [with T = oter_t]
 FILE     : src/generic_factory.h
 LINE     : 513
 VERSION  : cdda-experimental-2024-04-22-1537 a60d305

 DEBUG    :  forest was referenced as an alias in overmap_lake_settings shore_extendable_overmap_terrain_aliases, but the value is not present in the shore_extendable_overmap_terrain.
 FUNCTION : void overmap_lake_settings::finalize()
 FILE     : src/regional_settings.cpp
 LINE     : 961
 VERSION  : cdda-experimental-2024-04-22-1537 a60d305

 DEBUG    : Error: Json error: data/json/mapgen/hells_raiders/bandit_cabin.json:9:14: <color_white><color_cyan>format: rows: row 1 column 1: ' ' is not in 'terrain',and no 'fill_ter', 'predecessor_mapgen' or 'fallback_predecessor_mapgen' is set!</color>

    "object": {
      "predecessor_mapgen": "forest",
<color_light_red>      "rows": [</color>
            <color_cyan>▲▲▲</color>
        "                        ",
        "              #####     ",
</color>

 FUNCTION : bool main_menu::new_character_tab()
 FILE     : src/main_menu.cpp
 LINE     : 1051
 VERSION  : cdda-experimental-2024-04-22-1537 a60d305

Expected behavior

Less super weird errors?

This entry appears to be hardcoded.

I primarily reported this one because people on the devcord told me to so this is properly written down and can be investigated.

Screenshots

No response

Versions and configuration

Additional context

No response

IdleSol commented 4 months ago

https://github.com/CleverRaven/Cataclysm-DDA/blob/a60d305954dc305990b83df1c521790bc245be8f/data/json/overmap/special_locations.json#L22-L26

https://github.com/CleverRaven/Cataclysm-DDA/blob/a60d305954dc305990b83df1c521790bc245be8f/data/json/overmap/overmap_terrain/overmap_terrain_hardcoded.json#L25-L35

PGR-14 commented 4 months ago

Yo, quick question, not about the code, but the mod. When will you release it?

NetSysFire commented 4 months ago

This is (1) not an official mod that will be in repo (2) just random shenanigans of me (3) very heavily WIP. I might put it in its own repo under my user when I am somewhat satisfied with it (or when enough people bug me), which is not the case right now. For reference, I started messing around with it a year ago. There is nothing but mapgen stuff in there now. No cool gameplay. No factions.

PGR-14 commented 4 months ago

Thanks for the info

Procyonae commented 4 months ago

This isn't a bug, it needs "NO_ROTATE" bc otherwise it thinks there should be a forest_north _east etc, if you have further problems I suggest you consult how desert_region and aftershock_exoplanet work.