Jump to content
Sign in to follow this  
Neutz

Lootable Sprites? Shelves Etc

Recommended Posts

Hey Guys

 

I' trying to make it so when my containers are looted they change to the empty state the same way that happens when you loot shelves/weapon cabinets.

 

Here is a picture explaining what i want to do, I have looked in the tile definitions and not found any way to change it the same way windows do when broken, so i'm assuming it might be in a .lua file

 

Anyone have an idea?

 

 

example.thumb.png.15dd64784662e745a9cb31208228626e.png

Edited by Neutralnz1

Share this post


Link to post
Share on other sites

I'm not familiar with the Lua side of PZ, however after a quick scan of the files I found the following code which looks like it would do what you desire.

 

ProjectZomboid\media\lua\server\Items\WorldFiller.lua

 

Contents:

Spoiler

-- THIS FILE WAS AUTOMATICALLY GENERATED BY TileZed
overlayMap = {}
overlayMap["appliances_refrigeration_01_16"] = {other = {"food_01_90", "food_01_94"}}
overlayMap["appliances_refrigeration_01_17"] = {other = {"food_01_91", "food_01_95"}}
overlayMap["appliances_refrigeration_01_18"] = {other = {"food_01_88", "food_01_92"}}
overlayMap["appliances_refrigeration_01_19"] = {other = {"food_01_89", "food_01_93"}}
overlayMap["appliances_refrigeration_01_22"] = {other = {"food_01_54", "food_01_62"}}
overlayMap["appliances_refrigeration_01_23"] = {other = {"food_01_55", "food_01_63"}}
overlayMap["appliances_refrigeration_01_40"] = {other = {"food_01_54", "food_01_62"}}
overlayMap["appliances_refrigeration_01_41"] = {other = {"food_01_55", "food_01_63"}}
overlayMap["carpentry_02_64"] = {other = {"books&misc_01_60", "books&misc_01_62"}}
overlayMap["carpentry_02_65"] = {other = {"books&misc_01_61", "books&misc_01_63"}}
overlayMap["carpentry_02_68"] = {other = {"books&misc_01_56", "books&misc_01_58"}}
overlayMap["carpentry_02_69"] = {other = {"books&misc_01_57", "books&misc_01_59"}}
overlayMap["furniture_shelving_01_0"] = {other = {"books&misc_01_0", "books&misc_01_1"}}
overlayMap["furniture_shelving_01_1"] = {other = {"books&misc_01_2", "books&misc_01_4"}}
overlayMap["furniture_shelving_01_2"] = {other = {"books&misc_01_3", "books&misc_01_5"}}
overlayMap["furniture_shelving_01_3"] = {other = {"books&misc_01_8", "books&misc_01_10"}}
overlayMap["furniture_shelving_01_4"] = {other = {"books&misc_01_9", "books&misc_01_11"}}
overlayMap["furniture_shelving_01_9"] = {other = {"books&misc_01_16", "books&misc_01_18"}}
overlayMap["furniture_shelving_01_10"] = {other = {"books&misc_01_17", "books&misc_01_19"}}
overlayMap["furniture_shelving_01_16"] = {other = {"books&misc_01_32", "books&misc_01_40"}}
overlayMap["furniture_shelving_01_17"] = {other = {"books&misc_01_33", "books&misc_01_41"}}
overlayMap["furniture_shelving_01_18"] = {other = {"books&misc_01_34", "books&misc_01_42"}}
overlayMap["furniture_shelving_01_19"] = {other = {"books&misc_01_35", "books&misc_01_43"}}
overlayMap["furniture_shelving_01_20"] = {other = {"books&misc_01_36", "books&misc_01_44"}}
overlayMap["furniture_shelving_01_21"] = {other = {"books&misc_01_37", "books&misc_01_45"}}
overlayMap["furniture_shelving_01_22"] = {other = {"books&misc_01_38", "books&misc_01_46"}}
overlayMap["furniture_shelving_01_23"] = {other = {"books&misc_01_39", "books&misc_01_47"}}
overlayMap["furniture_shelving_01_24"] = {other = {"books&misc_01_24", "books&misc_01_28"}}
overlayMap["furniture_shelving_01_25"] = {other = {"books&misc_01_25", "books&misc_01_29"}}
overlayMap["furniture_shelving_01_26"] = {other = {"books&misc_01_26", "books&misc_01_30"}}
overlayMap["furniture_shelving_01_27"] = {other = {"books&misc_01_27", "books&misc_01_31"}}
overlayMap["furniture_shelving_01_28"] = {other = {"books&misc_01_48", "books&misc_01_52"}}
overlayMap["furniture_shelving_01_29"] = {other = {"books&misc_01_49", "books&misc_01_53"}}
overlayMap["furniture_shelving_01_30"] = {other = {"books&misc_01_50", "books&misc_01_54"}}
overlayMap["furniture_shelving_01_31"] = {other = {"books&misc_01_51", "books&misc_01_55"}}
overlayMap["furniture_shelving_01_32"] = {other = {"books&misc_01_56", "books&misc_01_58"}}
overlayMap["furniture_shelving_01_33"] = {other = {"books&misc_01_57", "books&misc_01_59"}}
overlayMap["furniture_shelving_01_34"] = {other = {"books&misc_01_56", "books&misc_01_58"}}
overlayMap["furniture_shelving_01_35"] = {other = {"books&misc_01_57", "books&misc_01_59"}}
overlayMap["furniture_shelving_01_36"] = {other = {"books&misc_01_56", "books&misc_01_58"}}
overlayMap["furniture_shelving_01_37"] = {other = {"books&misc_01_57", "books&misc_01_59"}}
overlayMap["furniture_shelving_01_40"] = {other = {"books&misc_01_60", "books&misc_01_62"}}
overlayMap["furniture_shelving_01_41"] = {other = {"books&misc_01_61", "books&misc_01_63"}}
overlayMap["furniture_shelving_01_44"] = {other = {"books&misc_01_60", "books&misc_01_62"}}
overlayMap["furniture_shelving_01_45"] = {other = {"books&misc_01_61", "books&misc_01_63"}}
overlayMap["location_business_office_generic_01_7"] = {other = {"papernotices_01_9"}}
overlayMap["location_business_office_generic_01_15"] = {other = {"papernotices_01_8"}}
overlayMap["location_business_office_generic_01_36"] = {other = {"papernotices_01_4"}}
overlayMap["location_business_office_generic_01_37"] = {other = {"papernotices_01_5"}}
overlayMap["location_business_office_generic_01_38"] = {other = {"papernotices_01_6"}}
overlayMap["location_business_office_generic_01_39"] = {other = {"papernotices_01_7"}}
overlayMap["location_restaurant_pie_01_48"] = {other = {"food_01_24", "food_01_28"}}
overlayMap["location_restaurant_pie_01_49"] = {other = {"food_01_25", "food_01_29"}}
overlayMap["location_restaurant_pie_01_50"] = {other = {"food_01_26", "food_01_30"}}
overlayMap["location_restaurant_pie_01_51"] = {other = {"food_01_27", "food_01_31"}}
overlayMap["location_restaurant_seahorse_01_56"] = {other = {"food_01_26", "food_01_30"}}
overlayMap["location_restaurant_seahorse_01_57"] = {other = {"food_01_27", "food_01_31"}}
overlayMap["location_restaurant_seahorse_01_58"] = {other = {"food_01_24", "food_01_28"}}
overlayMap["location_restaurant_seahorse_01_59"] = {other = {"food_01_25", "food_01_29"}}
overlayMap["location_shop_fossoil_01_34"] = {other = {"books&misc_01_12", "books&misc_01_20"}}
overlayMap["location_shop_fossoil_01_35"] = {other = {"books&misc_01_13", "books&misc_01_21"}}
overlayMap["location_shop_fossoil_01_36"] = {other = {"books&misc_01_14", "books&misc_01_22"}}
overlayMap["location_shop_fossoil_01_37"] = {other = {"books&misc_01_15", "books&misc_01_23"}}
overlayMap["location_shop_generic_01_0"] = {other = {"food_01_0", "food_01_2"}}
overlayMap["location_shop_generic_01_1"] = {other = {"food_01_1", "food_01_3"}}
overlayMap["location_shop_generic_01_8"] = {other = {"food_01_8", "food_01_16"}, pharmacy = {"books&misc_01_72", "books&misc_01_80"}}
overlayMap["location_shop_generic_01_9"] = {other = {"food_01_9", "food_01_17"}, pharmacy = {"books&misc_01_73", "books&misc_01_81"}}
overlayMap["location_shop_generic_01_10"] = {other = {"food_01_9", "food_01_17"}, pharmacy = {"books&misc_01_73", "books&misc_01_81"}}
overlayMap["location_shop_generic_01_11"] = {other = {"food_01_10", "food_01_18"}, pharmacy = {"books&misc_01_74", "books&misc_01_82"}}
overlayMap["location_shop_generic_01_12"] = {other = {"food_01_11", "food_01_19"}, pharmacy = {"books&misc_01_75", "books&misc_01_83"}}
overlayMap["location_shop_generic_01_13"] = {other = {"food_01_12", "food_01_20"}, pharmacy = {"books&misc_01_76", "books&misc_01_84"}}
overlayMap["location_shop_generic_01_14"] = {other = {"food_01_12", "food_01_20"}, pharmacy = {"books&misc_01_76", "books&misc_01_84"}}
overlayMap["location_shop_generic_01_15"] = {other = {"food_01_13", "food_01_21"}, pharmacy = {"books&misc_01_77", "books&misc_01_85"}}
overlayMap["location_shop_generic_01_24"] = {other = {"books&misc_01_12", "books&misc_01_20"}}
overlayMap["location_shop_generic_01_25"] = {other = {"books&misc_01_13", "books&misc_01_21"}}
overlayMap["location_shop_generic_01_26"] = {other = {"books&misc_01_14", "books&misc_01_22"}}
overlayMap["location_shop_generic_01_27"] = {other = {"books&misc_01_15", "books&misc_01_23"} }
overlayMap["location_shop_generic_01_28"] = {other = {"books&misc_01_104", "books&misc_01_108"} }
overlayMap["location_shop_generic_01_29"] = {other = {"books&misc_01_105", "books&misc_01_109"} }
overlayMap["location_shop_generic_01_30"] = {other = {"books&misc_01_106", "books&misc_01_110"} }
overlayMap["location_shop_generic_01_31"] = {other = {"books&misc_01_107", "books&misc_01_111"} }
overlayMap["location_shop_generic_01_32"] = {other = {"food_01_24", "food_01_28"}}
overlayMap["location_shop_generic_01_33"] = {other = {"food_01_25", "food_01_29"}}
overlayMap["location_shop_generic_01_34"] = {other = {"food_01_26", "food_01_30"}}
overlayMap["location_shop_generic_01_35"] = {other = {"food_01_27", "food_01_31"}}
overlayMap["location_shop_generic_01_36"] = {other = {"clothing_01_0", "clothing_01_4"}}
overlayMap["location_shop_generic_01_37"] = {other = {"clothing_01_1", "clothing_01_5"}}
overlayMap["location_shop_generic_01_38"] = {other = {"clothing_01_2", "clothing_01_6"}}
overlayMap["location_shop_generic_01_39"] = {other = {"clothing_01_3", "clothing_01_7"}}
overlayMap["location_shop_generic_01_40"] = {clothesstore = {"clothing_01_8", "clothing_01_16"}, departmentstore = {"clothing_01_8", "clothing_01_16"}, generalstore = {"clothing_01_8", "clothing_01_16"}}
overlayMap["location_shop_generic_01_41"] = {clothesstore = {"clothing_01_9", "clothing_01_17"}, departmentstore = {"clothing_01_9", "clothing_01_17"}, generalstore = {"clothing_01_9", "clothing_01_17"}}
overlayMap["location_shop_generic_01_46"] = {clothesstore = {"clothing_01_12", "clothing_01_20"}, departmentstore = {"clothing_01_12", "clothing_01_20"}, generalstore = {"clothing_01_12", "clothing_01_20"}}
overlayMap["location_shop_generic_01_47"] = {clothesstore = {"clothing_01_13", "clothing_01_21"}, departmentstore = {"clothing_01_13", "clothing_01_21"}, generalstore = {"clothing_01_13", "clothing_01_21"}}
overlayMap["location_shop_generic_01_48"] = {other = {"clothing_01_24", "clothing_01_28"}}
overlayMap["location_shop_generic_01_49"] = {other = {"clothing_01_25", "clothing_01_29"}}
overlayMap["location_shop_generic_01_50"] = {other = {"clothing_01_26", "clothing_01_30"}}
overlayMap["location_shop_generic_01_51"] = {other = {"clothing_01_27", "clothing_01_31"}}
overlayMap["location_shop_generic_01_52"] = {other = {"clothing_01_38", "clothing_01_39"}}
overlayMap["location_shop_generic_01_56"] = {clothesstore = {"clothing_01_32", "clothing_01_40"}, clothingstore = {"clothing_01_32", "clothing_01_40"}, generalstore = {"clothing_01_32", "clothing_01_40"}}
overlayMap["location_shop_generic_01_57"] = {clothesstore = {"clothing_01_33", "clothing_01_41"}, generalstore = {"clothing_01_33", "clothing_01_41"}}
overlayMap["location_shop_generic_01_58"] = {clothesstore = {"clothing_01_34", "clothing_01_42"}, generalstore = {"clothing_01_34", "clothing_01_42"}}
overlayMap["location_shop_generic_01_59"] = {clothesstore = {"clothing_01_35", "clothing_01_43"}, generalstore = {"clothing_01_35", "clothing_01_43"}}
overlayMap["location_shop_generic_01_60"] = {clothesstore = {"clothing_01_36", "clothing_01_44"}, generalstore = {"clothing_01_36", "clothing_01_44"}}
overlayMap["location_shop_generic_01_61"] = {clothesstore = {"clothing_01_37", "clothing_01_45"}, generalstore = {"clothing_01_37", "clothing_01_45"}}
overlayMap["location_shop_generic_01_64"] = {other = {"food_01_48", "food_01_56"}}
overlayMap["location_shop_generic_01_65"] = {other = {"food_01_49", "food_01_57"}}
overlayMap["location_shop_generic_01_66"] = {other = {"food_01_50", "food_01_58"}}
overlayMap["location_shop_generic_01_67"] = {other = {"food_01_51", "food_01_59"}}
overlayMap["location_shop_generic_01_68"] = {other = {"food_01_52", "food_01_60"}}
overlayMap["location_shop_generic_01_69"] = {other = {"food_01_53", "food_01_61"}}
overlayMap["location_shop_generic_01_72"] = {other = {"books&misc_01_64", "books&misc_01_68"}}
overlayMap["location_shop_generic_01_73"] = {other = {"books&misc_01_65", "books&misc_01_69"}}
overlayMap["location_shop_generic_01_74"] = {other = {"books&misc_01_66", "books&misc_01_70"}}
overlayMap["location_shop_generic_01_75"] = {other = {"books&misc_01_67", "books&misc_01_71"}}
overlayMap["location_shop_generic_01_80"] = {other = {"food_01_72", "food_01_80"}}
overlayMap["location_shop_generic_01_81"] = {other = {"food_01_73", "food_01_81"}}
overlayMap["location_shop_generic_01_82"] = {other = {"food_01_74", "food_01_82"}}
overlayMap["location_shop_generic_01_83"] = {other = {"food_01_75", "food_01_83"}}
overlayMap["location_shop_generic_01_84"] = {other = {"food_01_76", "food_01_84"}}
overlayMap["location_shop_generic_01_85"] = {other = {"food_01_77", "food_01_85"}}
overlayMap["location_shop_generic_01_86"] = {other = {"clothing_01_48", "clothing_01_50"}}
overlayMap["location_shop_generic_01_87"] = {other = {"clothing_01_49", "clothing_01_51"}}
overlayMap["location_shop_generic_01_88"] = {other = {"food_01_32", "food_01_36"}}
overlayMap["location_shop_generic_01_89"] = {other = {"food_01_33", "food_01_37"}}
overlayMap["location_shop_generic_01_90"] = {other = {"food_01_34", "food_01_38"}}
overlayMap["location_shop_generic_01_91"] = {other = {"food_01_35", "food_01_39"}}
overlayMap["location_shop_generic_01_92"] = {other = {"food_01_40", "food_01_44"}}
overlayMap["location_shop_generic_01_93"] = {other = {"food_01_41", "food_01_45"}}
overlayMap["location_shop_generic_01_94"] = {other = {"food_01_42", "food_01_46"}}
overlayMap["location_shop_generic_01_95"] = {other = {"food_01_43", "food_01_47"}}
overlayMap["location_shop_generic_01_96"] = {gunstore = {"weapons_01_0", "weapons_01_8"}, other = {"books&misc_01_88", "books&misc_01_96"}}
overlayMap["location_shop_generic_01_97"] = {gunstore = {"weapons_01_1", "weapons_01_9"}, other = {"books&misc_01_89", "books&misc_01_97"}}
overlayMap["location_shop_generic_01_98"] = {gunstore = {"weapons_01_2", "weapons_01_10"}, other = {"books&misc_01_90", "books&misc_01_98"}}
overlayMap["location_shop_generic_01_99"] = {gunstore = {"weapons_01_3", "weapons_01_11"}, other = {"books&misc_01_91", "books&misc_01_99"}}
overlayMap["location_shop_generic_01_100"] = {gunstore = {"weapons_01_4", "weapons_01_12"}, other = {"books&misc_01_92", "books&misc_01_100"}}
overlayMap["location_shop_generic_01_101"] = {gunstore = {"weapons_01_5", "weapons_01_13"}, other = {"books&misc_01_93", "books&misc_01_101"}}
overlayMap["location_shop_generic_01_102"] = {gunstore = {"weapons_01_6", "weapons_01_14"}, other = {"books&misc_01_94", "books&misc_01_102"}}
overlayMap["location_shop_generic_01_103"] = {gunstore = {"weapons_01_7", "weapons_01_15"}, other = {"books&misc_01_95", "books&misc_01_103"}}
overlayMap["location_shop_greenes_01_24"] = {other = {"food_01_32", "food_01_36"}}
overlayMap["location_shop_greenes_01_25"] = {other = {"food_01_33", "food_01_37"}}
overlayMap["location_shop_greenes_01_26"] = {other = {"food_01_34", "food_01_38"}}
overlayMap["location_shop_greenes_01_27"] = {other = {"food_01_35", "food_01_39"}}
overlayMap["location_shop_greenes_01_28"] = {other = {"food_01_40", "food_01_44"}}
overlayMap["location_shop_greenes_01_29"] = {other = {"food_01_41", "food_01_45"}}
overlayMap["location_shop_greenes_01_30"] = {other = {"food_01_42", "food_01_46"}}
overlayMap["location_shop_greenes_01_31"] = {other = {"food_01_43", "food_01_47"}}
overlayMap["location_shop_greenes_01_56"] = {other = {"food_01_8", "food_01_16"}}
overlayMap["location_shop_greenes_01_57"] = {other = {"food_01_16", "food_01_17"}}
overlayMap["location_shop_greenes_01_58"] = {other = {"food_01_16", "food_01_17"}}
overlayMap["location_shop_greenes_01_59"] = {other = {"food_01_10", "food_01_18"}}
overlayMap["location_shop_greenes_01_60"] = {other = {"food_01_11", "food_01_19"}}
overlayMap["location_shop_greenes_01_61"] = {other = {"food_01_12", "food_01_20"}}
overlayMap["location_shop_greenes_01_62"] = {other = {"food_01_12", "food_01_20"}}
overlayMap["location_shop_greenes_01_63"] = {other = {"food_01_13", "food_01_21"}}
overlayMap["location_shop_zippee_01_24"] = {other = {"books&misc_01_12", "books&misc_01_20"}}
overlayMap["location_shop_zippee_01_25"] = {other = {"books&misc_01_13", "books&misc_01_21"}}
overlayMap["location_shop_zippee_01_26"] = {other = {"books&misc_01_14", "books&misc_01_22"}}
overlayMap["location_shop_zippee_01_27"] = {other = {"books&misc_01_15", "books&misc_01_23"}}
overlayMap["trashcontainers_01_17"] = {other = {"trash&junk_01_0", "trash&junk_01_1"} }
overlayMap["location_restaurant_bar_01_29"] = {other = {"food_01_78", "food_01_86"} }
overlayMap["location_restaurant_bar_01_30"] = {other = {"food_01_78", "food_01_86"} }
overlayMap["location_restaurant_bar_01_31"] = {other = {"food_01_78", "food_01_86"} }
overlayMap["location_restaurant_bar_01_37"] = {other = {"food_01_79", "food_01_87"} }
overlayMap["location_restaurant_bar_01_38"] = {other = {"food_01_79", "food_01_87"} }
overlayMap["location_restaurant_bar_01_39"] = {other = {"food_01_79", "food_01_87"} }

 

I'll use this line as an example: overlayMap["location_shop_generic_01_103"] = {gunstore = {"weapons_01_7", "weapons_01_15"}, other = {"books&misc_01_95", "books&misc_01_103"}}

 

"location_shop_generic_01_103" would be the container/shelves/etc.

"gunstore" is the room definition.

"weapons_01_7", "weapons_01_15" represent the North and West facing tiles with 'stuff' on them (you need both, the engine will pick which one it needs).

 

Edit: Optionally you can have multiple room definitions, as per: other = {"books&misc_01_95", "books&misc_01_103"}

 

List of room definitions:

 

Edited by Rekkie

Share this post


Link to post
Share on other sites

Thanks dude, Exactly what i was looking for, Can't believe i didn't find it myself though, Swear i looked everywhere.

 

That Lua code makes enough sense from working with the sprites, I should be able to make them work once i get the chance.

 

I'll have a play with it and update when i get it working :)

Edited by Neutz

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...