Cataclysm-DDA icon indicating copy to clipboard operation
Cataclysm-DDA copied to clipboard

ter_transform does not set the roof until after a save/load cycle

Open Standing-Storm opened this issue 1 year ago • 7 comments

Describe the bug

When using a ter_transform to transform terrain with a defined roof, the roof does not actually appear until after the game is saved and loaded.

Attach save file

Hunts Point-trimmed.tar.gz

Steps to reproduce

  1. Load game.
  2. Open the spellcasting menu and cast the "The Forest Offers Shelter" spell, and use the "Grow Wood Wall" sub-effect on the square next to you
  3. Teleport up on top of that square. Despite being t_triffid_bark_wall which has "roof": "t_barkfloor", set, you will fall after waiting one turn.
  4. Save and quit
  5. Re-enter the game.
  6. Attempt to teleport up on top of the wooden wall again and wait a turn.
  7. Terrain now has a roof, you do not fall.

Expected behavior

Roof is set at the same time the terrain is transformed.

Screenshots

image

Versions and configuration

  • OS: Windows
    • OS Version: 10.0.19045.3803 (22H2)
  • Game Version: 2a67568 [64-bit]
  • Graphics Version: Tiles
  • Game Language: English [en]
  • Mods loaded: [ Dark Days Ahead [dda], Disable NPC Needs [no_npc_food], Portal Storms Ignore NPCs [personal_portal_storms], Slowdown Fungal Growth [no_fungal_growth], Xedra Evolved [xedra_evolved] ]

Additional context

Xedra Evolved used to get a convenient ter_transform effect to demonstrate the bug.

Standing-Storm avatar Jan 12 '24 20:01 Standing-Storm

Update - nothing does upd: okay i thought nest also don't spawn the roof for this exact reason, but it is only related to the terrain/furniture defined roof for example, roof, that is added when you climb, stops spawning at some point image reloading helps to fix it and, for some reason, debug long range teleportation

/confirm

GuardianDll avatar Jan 12 '24 20:01 GuardianDll

Can you not just transform the z1 terrain at the same time? As far as I'm aware that field is purely for auto-roofs and shouldn't be relied upon in any situation where it's not necessary. Related issue where I discuss auto-roofs with PatrickLundell: #70603

Procyonae avatar Jan 12 '24 22:01 Procyonae

I semi-addressed this problem with monster stomach, baby, and milk cycles by simply adding a manual check every couple of hours. That wouldn't be a perfect fix here, but if we ran it a bit more often (ten minutes or so) it might solve most of the issue.

worm-girl avatar Jan 13 '24 06:01 worm-girl

I had a weird experience last week which might be related:

Raided a tower lab which was infested with fungus, burned the rooms which had the fungus in it; after the burning was done, I revisited the rooms - only to find that all the floors were gone, and all the items (especially the ash) had fallen to the level below. Thought that that was working as intended, and left. When I returned a couple of days later, the floors were there again.

BaumgeistOne avatar Jan 13 '24 08:01 BaumgeistOne

Can you not just transform the z1 terrain at the same time? As far as I'm aware that field is purely for auto-roofs and shouldn't be relied upon in any situation where it's not necessary. Related issue where I discuss auto-roofs with PatrickLundell: #70603

Unfortunately not--spell-effect-based ter_transforms can't affect multiple Z-levels at once, and EoC-based ones can't be targeted at arbitrary areas of ground, only the caster or a monster or NPC target.

Standing-Storm avatar Jan 14 '24 22:01 Standing-Storm

Yikes :c Can you make a spell trigger two spells that transform 1 each or something gross to work around that?

Procyonae avatar Jan 14 '24 23:01 Procyonae

and EoC-based ones can't be targeted at arbitrary areas of ground

You can't use location_variable_adjust? https://github.com/CleverRaven/Cataclysm-DDA/issues/69193#issuecomment-1822489938

Additionally, check out how I assigned the var here: https://github.com/CleverRaven/Cataclysm-DDA/blob/74771e195489cf73125afc53c2f0710a3c3583c1/data/json/monsters/zed_lieutenant.json#L143-L154

What you are describing should be plenty doable, although maybe a bit unwieldy.

RenechCDDA avatar Mar 25 '24 09:03 RenechCDDA