[Lua]: Degrade Buildings (Last updated on: 2018-06-19)

Description:

Walls have a chance to collapse, windows and doors can be damaged when building is generated. Also adds some graffiti to the walls.

This mod is WIP and probably rather unbalanced. All, but several buildings from \data\json\mapgen were updated. I will update more in future versions.

Warning: Please be aware that additional lua mapgen is rather slow, especially when logging is enabled.

Current version:

Date Version Description Download Link
2018-06-19 Latest Modified by @JT1 (see this post for details) Dropbox

Older versions:

Date Version Description Download Link
2017-10-20 Release 3 Without logging and profiler (Faster) Dropbox
2017-09-28 Release 2 Without logging and profiler (Faster) Dropbox
2017-08-27 Release 1 Wiithout logging and profiler (Faster) Dropbox
2017-08-03 Initial Without logging and profiler (Faster) Dropbox
2017-08-03 Initial With logging and profiler (Slower) Dropbox

Technical info:

  • Mod utilizes LUA functionality in overmap mapgen (see https://github.com/CleverRaven/Cataclysm-DDA/blob/master/doc/MAPGEN.md#25-lua).
  • You can find mod logs in \data\mods\ZSLua_DegradeBuildings\lua\ (ZSLua_DegradeBuildings.log and mapgen_degrade_building.report).
  • One can use \data\mods\ZSLua_DegradeBuildings\lua_tools\InjectMapgenJson.lua to process json-files with mapgens from other mods.

Additional info:

Please also check dda-lua mod. Degrade Buildings mod will be eventually merged there.

Fucking sick nasty, can’t wait to try it tonight

So lua is still in the game. I wonder why stats through skills 2 isn’t working then.

StatsThroughSkills mod shipped with the game is working good. Is you version of the game compiled with lua support?

Getting this error. Tried it in an existing world and a new one

[quote=“RipRoarinBoogerPenis, post:5, topic:14081”]Getting this error. Tried it in an existing world and a new one

http://imagebucket.net/j649wmeqhxh1/fug.png[/quote]
You have probably some old version of CDDA which does not include Necropolis yet. Do you know version number?

From a couple days ago, necropolis is in but I haven’t run into any in this current world gen. Maybe it didn’t generate one and thats why I get the error? If thats the case I don’t know why it would spit me out to the main menu.

The issue is you game cannot find item group energy_weapon_armory. It should be defined in \data\json\itemgroups\locations.json.

,
  {
    "id": "energy_weapon_armory",
    "type": "item_group",
    "subtype": "collection",
    "items":[
      { "group": "guns_energy", "prob": 50 },
      [ "plut_cell", 30 ],
      [ "adv_UPS_off", 20 ],
      [ "electrolaser_conversion", 5 ],
      [ "high_density_capacitor", 5 ],
      [ "beam_scatterer", 5 ]
    ]
  },

It is likely that you have some mod enabled which blacklists this item group.

Got it working, something is fucky with my energy weapon stuff for somereason but whatever.

Love the destroyed damaged buildings. Could use more variety in the graffitti. Is there any way to disable those lua callbacks? Made a character and had to wait till daytime to check things out and just get spammed with lua callbacks.

Really excited about this, how can I add more to the graffitti?

StatsThroughSkills mod shipped with the game is working good. Is you version of the game compiled with lua support?[/quote]
That is the basic stats through skills which I don’t think uses lua. Basically the reason I don’t use that mod is as soon as stats update and if you start out with 0 skills then al your starting stats are dropped whereas stats through skills 2 I know doesn’t do that.

[quote=“RipRoarinBoogerPenis, post:9, topic:14081”]Got it working, something is fucky with my energy weapon stuff for somereason but whatever.

Love the destroyed damaged buildings. Could use more variety in the graffitti. Is there any way to disable those lua callbacks? Made a character and had to wait till daytime to check things out and just get spammed with lua callbacks.

Really excited about this, how can I add more to the graffitti?[/quote]
Graffiti strings are defined in the “\data\mods\ZSLua_DegradeBuildings\lua\MapGen.lua”. Search for this code and add more strings as necessary:

function MapGen.RandomGraffitiString ()

  local strings = {
    "LUA rules!",
    "LOOTED",
    "X",
    "muh fukaz!",
    "Beware of Zeds",
    "Hello, Kitty!",
    "* unreadable symbols *",
    "<color_ltred>PRAY!</color>",
    "<color_red>PRAY AND SPRAY!</color>"
  }

Lua callbacks are defined in “\data\mods\ZSLua_DegradeBuildings\main.lua”. They should be disabled in the NoLog version,s or either try use that version, remove callback functions or comment Log statements like this:

function MOD.on_new_player_created()
    --Log.Message("ZSLua_DegradeBuildings: main.lua: callback: on_new_player_created", true)
end

function MOD.on_skill_increased()
    --Log.Message("ZSLua_DegradeBuildings: main.lua: callback: on_skill_increased", true)
end

function MOD.on_minute_passed()
    --Log.Message("ZSLua_DegradeBuildings: main.lua: callback: on_minute_passed", true)
end

function MOD.on_day_passed()
    --Log.Message("ZSLua_DegradeBuildings: main.lua: callback: on_day_passed", true)
end

You can also omit second parameter of the function or set it to nil/false.

StatsThroughSkills mod shipped with the game is working good. Is you version of the game compiled with lua support?[/quote]
That is the basic stats through skills which I don’t think uses lua. Basically the reason I don’t use that mod is as soon as stats update and if you start out with 0 skills then al your starting stats are dropped whereas stats through skills 2 I know doesn’t do that.[/quote]
StatsThroughSkills shipped with the game uses lua. Somewhere in the future it will be recoded in c++, but that’s not yet true for today.

Hey, I have a problem with this mod. I have experimental 6675 and when the game generates the world, I have this error:


I installed the non-log version.

I don’t want to start the game without this mod, so I’ll wait patiently for help :slight_smile:

[quote=“Decipher4096, post:13, topic:14081”]Hey, I have a problem with this mod. I have experimental 6675 and when the game generates the world, I have this error:
I installed the non-log version.

I don’t want to start the game without this mod, so I’ll wait patiently for help :)[/quote]
Please download once again (same link). There was missing comment hyphen in Mapgen.lua.

Hey there, I’ve been having an issue starting a new game when the game tries to generate the map with this game loaded. For some reason, the forums won’t allow me to post links or attachments, so the next best thing is to provide a description of the error.
On the DEBUG line of the error, there is a message regarding an invalid overmap terrain flag “ALLOW_OVERRIDE”.
The function line states: bool main_menu::new_character_tab()
File is src/main_menu.cpp
Line 614

[quote=“fallout2077, post:15, topic:14081”]Hey there, I’ve been having an issue starting a new game when the game tries to generate the map with this game loaded. For some reason, the forums won’t allow me to post links or attachments, so the next best thing is to provide a description of the error.
On the DEBUG line of the error, there is a message regarding an invalid overmap terrain flag “ALLOW_OVERRIDE”.
The function line states: bool main_menu::new_character_tab()
File is src/main_menu.cpp
Line 614[/quote]
Should be fixed in new V1 version.

Yep, all’s well now. Thank you much!

Hey there, I’ve been having an issue starting a new game when the game tries to generate the map with this game loaded.
Could you please fix that?

Please try updated version:

this one works!
Thank you for your quick and polite response.