Copy the script text (not the whole web page) into a "text" file in <DF>\hack\scripts called "candy_corrector.lua" (without the quotes). Then type "candy_corrector" (again without quotes) into the DFHack console window. Note that it will take the script quite some time to to run because it caused DF to perform quite time consuming data loading actions. The script should be run pre embark, i.e. at the screen showing the world, asking you where to embark. After the script has run you have to find your future location again as the data loading is prompted by moving the cursor over each world tile.
First off, thank you for your help and all your hard work on this.
I think I got the script to run once, but my memory could be wrong. Every attempt to run the script after the first time has generated this error:
...\Dwarf Fortress 0.47.04/hack/scripts/candy_corrector.lua:51: attempt to index a nil value (field 'features')
stack traceback:
...\Dwarf Fortress 0.47.04/hack/scripts/candy_corrector.lua:51: in global 'candy_corrector'
...\Dwarf Fortress 0.47.04/hack/scripts/candy_corrector.lua:78: in local 'script_code'
D:\DF\Dwarf Fortress 0.47.04\hack\lua\dfhack.lua:680: in function 'dfhack.run_script_with_env'
(...tail calls...)
I have tried installing the latest version of DFhack (I am using the LNP which has R2), but that broke TWBT and I still got the same error.
I re-downloaded the LNP and tried it again, got the same error.
I generated a world with 3 layers, I get the message that there are 3 layers and nothing needs to be done.
I generated two more worlds with 2 layers, both get the same error.
I deleted the candy_corrector.lua file, grabbed the text again from the website and made a new candy_corrector file, same error.
Not sure what else to try.
On a completely unrelated note, are there any other scripts that I should run in a normal game to fix bugs?