From 63f78c2b8e08c1ad9c7a732e06384440f07a56dd Mon Sep 17 00:00:00 2001 From: nathan Date: Thu, 18 Sep 2025 00:51:59 +0100 Subject: [PATCH] Added Project Files Added all files from the project and edited the readme.md --- README.md | 3 +- .../TrashAndCorpses_ISMoveableSpriteProps.lua | 33 ++++ .../X_ISMoveableSpriteProps_Pickup.lua.bak | 39 +++++ .../client/ScatteredTrashes_Hook_Client.lua | 34 ++++ ...scatteredTrash_distribution_definition.lua | 9 ++ .../media/lua/server/PA_Trash_ClientComms.lua | 31 ++++ .../camping/ScatteredTrash_CampingFuel.lua | 69 +++++++++ .../ScatteredTrash_ButtonIcons.lua | 11 ++ .../media/lua/shared/ScatteredTrashes.lua | 145 ++++++++++++++++++ .../lua/shared/ScatteredTrashes_Hook.lua | 13 ++ .../shared/TheGoodShit_SquareSpawnChecks.lua | 98 ++++++++++++ .../lua/shared/Translate/EN/IG_UI_EN.txt | 10 ++ .../media/lua/shared/trash_spawners.lua | 32 ++++ Random Corpses/media/scattered_trashes.tiles | Bin 0 -> 4997 bytes Random Corpses/media/textures/Trash.png | Bin 0 -> 4673 bytes Random Corpses/media/textures/TrashPaper.png | Bin 0 -> 4673 bytes Random Corpses/mod.info | 6 + 17 files changed, 531 insertions(+), 2 deletions(-) create mode 100644 Random Corpses/media/lua/client/Movables/TrashAndCorpses_ISMoveableSpriteProps.lua create mode 100644 Random Corpses/media/lua/client/Movables/X_ISMoveableSpriteProps_Pickup.lua.bak create mode 100644 Random Corpses/media/lua/client/ScatteredTrashes_Hook_Client.lua create mode 100644 Random Corpses/media/lua/server/Items/X_scatteredTrash_distribution_definition.lua create mode 100644 Random Corpses/media/lua/server/PA_Trash_ClientComms.lua create mode 100644 Random Corpses/media/lua/server/camping/ScatteredTrash_CampingFuel.lua create mode 100644 Random Corpses/media/lua/shared/Definitions/ScatteredTrash_ButtonIcons.lua create mode 100644 Random Corpses/media/lua/shared/ScatteredTrashes.lua create mode 100644 Random Corpses/media/lua/shared/ScatteredTrashes_Hook.lua create mode 100644 Random Corpses/media/lua/shared/TheGoodShit_SquareSpawnChecks.lua create mode 100644 Random Corpses/media/lua/shared/Translate/EN/IG_UI_EN.txt create mode 100644 Random Corpses/media/lua/shared/trash_spawners.lua create mode 100644 Random Corpses/media/scattered_trashes.tiles create mode 100644 Random Corpses/media/textures/Trash.png create mode 100644 Random Corpses/media/textures/TrashPaper.png create mode 100644 Random Corpses/mod.info diff --git a/README.md b/README.md index 25c00ba..443be0d 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,5 @@ To use this mod, extract the zip file to the '**mods**' your Project Zomboid dir Your newly created folder should be in the root of your '**mods**' folder. So it looks like ```bash - C:\Users\%username%\Zomboid\mods/Random Corpses + C:\Users\%username%\Zomboid\mods\Random Corpses ``` -(or whatever the foldername you extracted it to.) \ No newline at end of file diff --git a/Random Corpses/media/lua/client/Movables/TrashAndCorpses_ISMoveableSpriteProps.lua b/Random Corpses/media/lua/client/Movables/TrashAndCorpses_ISMoveableSpriteProps.lua new file mode 100644 index 0000000..05a9dac --- /dev/null +++ b/Random Corpses/media/lua/client/Movables/TrashAndCorpses_ISMoveableSpriteProps.lua @@ -0,0 +1,33 @@ +require "Movables/ISMovableSpriteProps" + + +function ISMoveableSpriteProps:instanceItem(_spriteNameOverride) + if self.isMoveable then + local item; + if self.customItem then + item = instanceItem(self.customItem); + else + if self.isMultiSprite then + item = instanceItem("Moveables.Moveable"); + else + item = instanceItem("Moveables."..self.spriteName); + end + --item = instanceItem("Moveables."..self.spriteName); --instanceItem("Moveables.Moveable"); + end + local spriteName = _spriteNameOverride or self.spriteName; + if self.type == "Window" then -- Some corrections + if not self.spriteProps:Is("SmashedTileOffset") or self.spriteProps:Val("SmashedTileOffset") == 0 then + return nil; -- cant instance broken windows + end + elseif self.type == "WindowObject" and self.isClosedState then + spriteName = self.sheetName .. tostring(self.spriteID+4); + end + if self.customItem then + item:setActualWeight(self.weight); + return item; + elseif item and item:ReadFromWorldSprite(spriteName) then + item:setActualWeight(self.weight); + return item; + end + end +end diff --git a/Random Corpses/media/lua/client/Movables/X_ISMoveableSpriteProps_Pickup.lua.bak b/Random Corpses/media/lua/client/Movables/X_ISMoveableSpriteProps_Pickup.lua.bak new file mode 100644 index 0000000..48e1418 --- /dev/null +++ b/Random Corpses/media/lua/client/Movables/X_ISMoveableSpriteProps_Pickup.lua.bak @@ -0,0 +1,39 @@ +require "Movables/ISMoveableSpriteProps" + +local old_ISMoveableSpriteProps_instanceItem = ISMoveableSpriteProps.instanceItem + +function ISMoveableSpriteProps:instanceItem(_spriteNameOverride) + --local spriteName = _spriteNameOverride or self.spriteName + if self.isMoveable then + local item; + if self.customItem then + item = instanceItem(self.customItem); + else + if self.isMultiSprite then + item = instanceItem("Moveables.Moveable"); + else + item = instanceItem("Moveables."..self.spriteName); + end + --item = instanceItem("Moveables."..self.spriteName); --instanceItem("Moveables.Moveable"); + end + local spriteName = _spriteNameOverride or self.spriteName; + if self.type == "Window" then -- Some corrections + if not self.spriteProps:Is("SmashedTileOffset") or self.spriteProps:Val("SmashedTileOffset") == 0 then + return nil; -- cant instance broken windows + end + elseif self.type == "WindowObject" and self.isClosedState then + spriteName = self.sheetName .. tostring(self.spriteID+4); + end + --print("SPRITE NAME - " .. tostring(spriteName)) + if item + + --and item:ReadFromWorldSprite(spriteName) + + then + item:setActualWeight(self.weight); + return item; + end + end +end + + diff --git a/Random Corpses/media/lua/client/ScatteredTrashes_Hook_Client.lua b/Random Corpses/media/lua/client/ScatteredTrashes_Hook_Client.lua new file mode 100644 index 0000000..d2bcc64 --- /dev/null +++ b/Random Corpses/media/lua/client/ScatteredTrashes_Hook_Client.lua @@ -0,0 +1,34 @@ + + +local function trashSquare_Hook(square) + --print("HOOK") + + local mData = square:getModData() + if mData.trashSquare then return end + if mData.specialSquare then return end + -- trashSquare(square) + -- if not isClient then + -- trashSquare(square) + -- else + -- local player = getPlayer() + -- -- print("Sending trash call to server! - " .. tostring(player)) + -- sendClientCommand( player, "PA_Trash", "Spawn", { + -- x = square:getX(), y = square:getY(), z = square:getZ() + -- }) + -- end + if isClient == true then + local player = getPlayer(0) + -- print("Sending trash call to server! - " .. tostring(player)) + sendClientCommand( player, "PA_Trash", "Spawn", { + x = square:getX(), y = square:getY(), z = square:getZ() + }) + return + end + trashSquare(square) + -- end + +end + + +Events.LoadGridsquare.Add(trashSquare_Hook) -- every time a grid square is loaded, checks for any vehicle spawn list entries + diff --git a/Random Corpses/media/lua/server/Items/X_scatteredTrash_distribution_definition.lua b/Random Corpses/media/lua/server/Items/X_scatteredTrash_distribution_definition.lua new file mode 100644 index 0000000..a843524 --- /dev/null +++ b/Random Corpses/media/lua/server/Items/X_scatteredTrash_distribution_definition.lua @@ -0,0 +1,9 @@ +require "Items/Distributions" +require "Items/ProceduralDistributions" +require "Vehicles/VehicleDistributions" + + +SuburbsDistributions["all"]["Trash"] = SuburbsDistributions["all"]["bin"] + +SuburbsDistributions["all"]["TrashPaper"] = SuburbsDistributions["all"]["filingcabinet"] + diff --git a/Random Corpses/media/lua/server/PA_Trash_ClientComms.lua b/Random Corpses/media/lua/server/PA_Trash_ClientComms.lua new file mode 100644 index 0000000..d602d9d --- /dev/null +++ b/Random Corpses/media/lua/server/PA_Trash_ClientComms.lua @@ -0,0 +1,31 @@ +-- this method was copied from the excellent Skateboard mod by Dislaik https://steamcommunity.com/sharedfiles/filedetails/?id=2728300240 +-- I considered making new code from scratch, albeit I would still be "copying their homework", but decided against, for the sake of ease of comprehension + conistency +if not isServer() then return end +local Commands = {} +Commands.PA_Trash = {} + +Commands.PA_Trash.Spawn = function(origin, args) + -- print("Trash command recieved " .. tostring(origin) .. " - " .. tostring(args)) + local cell = origin:getCell() + -- if not cell then print("No cell!") return end + + local x = args.x + local y = args.y + local z = args.z + -- print("Trash command recieved " .. tostring(origin) .. " - " .. tostring(cell) .. " - " .. tostring(args)) + -- print("Trash command recieved " .. tostring(x) .. " - " .. tostring(y) .. " - " .. tostring(z)) + local square = cell:getGridSquare(x, y, z) or cell:getOrCreateGridSquare( x, y, x) + -- local square = args.square + -- if not square then print("No square!") return end + -- print("Recieved trash call from client -" .. tostring(origin) .. " - " .. tostring(square)) + trashSquare(square) + +end + +local onClientCommand = function(module, command, player, args) + if Commands[module] and Commands[module][command] then + Commands[module][command](player, args) + end +end + +Events.OnClientCommand.Add(onClientCommand) diff --git a/Random Corpses/media/lua/server/camping/ScatteredTrash_CampingFuel.lua b/Random Corpses/media/lua/server/camping/ScatteredTrash_CampingFuel.lua new file mode 100644 index 0000000..d2947da --- /dev/null +++ b/Random Corpses/media/lua/server/camping/ScatteredTrash_CampingFuel.lua @@ -0,0 +1,69 @@ +require "Camping/camping_fuel" + +----------------------- Add Fuel for Campfire ----------------------- + + local i = 0 + + while i < 54 do + local trash = ("trash_01_" .. (tostring(i))) + campingFuelType[trash]= 15.0/60 + campingLightFireType[trash]= 15.0/60 + i = i +1 + + end + + + -- campingFuelType.trash_01_0 = 5.0/60 + -- campingFuelType["trash_01_0"] = 5.0/60 + -- campingFuelType.trash_01_1 = 5.0/60 + -- campingFuelType["trash_01_1"] = 5.0/60 + -- campingFuelType.trash_01_2 = 5.0/60 + -- campingFuelType["trash_01_2"] = 5.0/60 + -- campingFuelType.trash_01_3 = 5.0/60 + -- campingFuelType["trash_01_3"] = 5.0/60 + -- campingFuelType.trash_01_4 = 5.0/60 + -- campingFuelType["trash_01_4"] = 5.0/60 + -- campingFuelType.trash_01_5 = 5.0/60 + -- campingFuelType["trash_01_5"] = 5.0/60 + -- campingFuelType.trash_01_6 = 5.0/60 + -- campingFuelType["trash_01_6"] = 5.0/60 + -- campingFuelType.trash_01_7 = 5.0/60 + -- campingFuelType["trash_01_7"] = 5.0/60 + -- campingFuelType.trash_01_8 = 5.0/60 + -- campingFuelType["trash_01_8"] = 5.0/60 + -- campingFuelType.trash_01_9 = 5.0/60 + -- campingFuelType["trash_01_9"] = 5.0/60 + -- campingFuelType.trash_01_10 = 5.0/60 + -- campingFuelType["trash_01_10"] = 5.0/60 + -- campingFuelType.trash_01_11 = 5.0/60 + -- campingFuelType["trash_01_11"] = 5.0/60 + + +-- ----------------------- Add Starter for Campfire ----------------------- + + -- campingLightFireType.trash_01_0 = 5.0/60 + -- campingLightFireType["trash_01_0"] = 5.0/60 + -- campingLightFireType.trash_01_1 = 5.0/60 + -- campingLightFireType["trash_01_1"] = 5.0/60 + -- campingLightFireType.trash_01_2 = 5.0/60 + -- campingLightFireType["trash_01_2"] = 5.0/60 + -- campingLightFireType.trash_01_3 = 5.0/60 + -- campingLightFireType["trash_01_3"] = 5.0/60 + -- campingLightFireType.trash_01_4 = 5.0/60 + -- campingLightFireType["trash_01_4"] = 5.0/60 + -- campingLightFireType.trash_01_5 = 5.0/60 + -- campingLightFireType["trash_01_5"] = 5.0/60 + -- campingLightFireType.trash_01_6 = 5.0/60 + -- campingLightFireType["trash_01_7"] = 5.0/60 + -- campingLightFireType.trash_01_1 = 5.0/60 + -- campingLightFireType["trash_01_1"] = 5.0/60 + -- campingLightFireType.trash_01_1 = 5.0/60 + -- campingLightFireType["trash_01_1"] = 5.0/60 + -- campingLightFireType.trash_01_1 = 5.0/60 + -- campingLightFireType["trash_01_1"] = 5.0/60 + -- campingLightFireType.trash_01_1 = 5.0/60 + -- campingLightFireType["trash_01_1"] = 5.0/60 + -- campingLightFireType.trash_01_11 = 5.0/60 + -- campingLightFireType["trash_01_11"] = 5.0/60 + + diff --git a/Random Corpses/media/lua/shared/Definitions/ScatteredTrash_ButtonIcons.lua b/Random Corpses/media/lua/shared/Definitions/ScatteredTrash_ButtonIcons.lua new file mode 100644 index 0000000..9cfc9cc --- /dev/null +++ b/Random Corpses/media/lua/shared/Definitions/ScatteredTrash_ButtonIcons.lua @@ -0,0 +1,11 @@ +require "Definitions/ContainerButtonIcons" + +ContainerButtonIcons = ContainerButtonIcons or {} + +local t = {} + +t.Trash= getTexture("media/textures/Trash.png") +t.TrashPaper= getTexture("media/textures/TrashPaper.png") + +ContainerButtonIcons.Trash = t.Trash +ContainerButtonIcons.TrashPaper = t.TrashPaper \ No newline at end of file diff --git a/Random Corpses/media/lua/shared/ScatteredTrashes.lua b/Random Corpses/media/lua/shared/ScatteredTrashes.lua new file mode 100644 index 0000000..19d7bb6 --- /dev/null +++ b/Random Corpses/media/lua/shared/ScatteredTrashes.lua @@ -0,0 +1,145 @@ +-- local function hasWaterObject(square) + -- for i=0, square:getObjects():size()-1 do + -- local v = square:getObjects():get(i); + -- if instanceof(v, "IsoObject") and v:getSprite() and v:getSprite():getProperties() and v:getSprite():getProperties():Is(IsoFlagType.water) then + -- --print("Water Tile") + -- return true; + -- end + -- end +-- end + +function trashSquare(square) + -- print("SQUARE 1") + local mData = square:getModData() + if mData.trashSquare then return end + if mData.specialSquare then return end + mData.trashSquare = true + square:transmitModdata() + --if mData.trashSquare then return end + if ZombRand(0,5) ~= 0 then return end + if not square then return end + if checkBlockedSquare(square) == false then return false end + if mData.stashSquare then return end + if not square:getZone() then return end + --if square:hasFloor(false) then return end + if not square:getZone():getType() then return end + --if square:isVehicleIntersecting() then return end + --if not square:isNotBlocked(true) then return end + local zoneType = square:getZone():getType() + local vehicleZone = nil + if getVehicleZoneAt and getVehicleZoneAt(square:getX(), square:getY(), square:getZ()) then + vehicleZone = getVehicleZoneAt(square:getX(), square:getY(), square:getZ()) + end + -- print("SQUARE 2") + local cell = getCell() + + --if hasWaterObject(square) then return false end + + if not square:isOutside() then + + if square:getZ() > 0 and not square:hasFloor(true) then return end + + --if ZombRand(0,49)== 0 then + if ZombRand(0,10)== 0 then + local body = createRandomDeadBody(square, 200 ) + + if body and ZombRand(0,3) == 0 then -- used so that all spawned bodies are not on their backs + body:setFallOnFront(true) + end + mData.specialSquare = true + end + return + end + if square:getZ() > 0 and not square:hasFloor(true) then return end + local vehicleZoneType = nil + if vehicleZone and vehicleZone:getType() then vehicleZoneType = vehicleZone:getType() end + --if vehicleZone and vehicleZone:getName():contains("trafficjam") then + if vehicleZoneType and vehicleZoneType:contains("trafficjam") then + --if ZombRand(0,99)== 0 then + if ZombRand(0,20)== 0 then + --print("Crash Corpse") + local body = createRandomDeadBody(square, 200 ) + --if body then body:setSkeleton(true) end + if body and ZombRand(0,3) == 0 then -- used so that all spawned bodies are not on their rbacks + body:setFallOnFront(true) + end + mData.specialSquare = true + end + elseif vehicleZone then + + --if ZombRand(0,199)== 0 then + if ZombRand(0,40)== 0 then + --print("Car Corpse") + local body = createRandomDeadBody(square, 200 ) + if body and ZombRand(0,3) == 0 then -- used so that all spawned bodies are not on their rbacks + body:setFallOnFront(true) + end + mData.specialSquare = true + end + elseif zoneType =="Nav" then + + --if ZombRand(0,1999)== 0 then + if ZombRand(0,400)== 0 then + --print("Corpse Spawn") + local body = createRandomDeadBody(square, 200 ) + if body and ZombRand(0,3) == 0 then -- used so that all spawned bodies are not on their rbacks + body:setFallOnFront(true) + end + mData.specialSquare = true + end + elseif zoneType == "TownZone" or zoneType == "ZoneStory" or zoneType == "TrailerPark" then + + --if square:getZ() > 0 and ZombRand(0,3999)== 0 then + if square:getZ() > 0 and ZombRand(0,800)== 0 then + --print("Roof Corpse Spawn") + local body = createRandomDeadBody(square, 200 ) + --if body then body:setSkeleton(true) end + if body and ZombRand(0,3) == 0 then -- used so that all spawned bodies are not on their rbacks + body:setFallOnFront(true) + end + mData.specialSquare = true + -- end + --elseif square:getZ()==0 and ZombRand(0,399)== 0 then + elseif square:getZ()==0 and ZombRand(0,80)== 0 then + --print("Corpse Spawn") + local body = createRandomDeadBody(square, 200 ) + --if body then body:setSkeleton(true) end + if body and ZombRand(0,3) == 0 then -- used so that all spawned bodies are not on their rbacks + body:setFallOnFront(true) + end + mData.specialSquare = true + end + + elseif zoneType == "Vegitation" or zoneType == "Farm" then + + --if ZombRand(0,1999)== 0 then + if ZombRand(0,400)== 0 then + --print("Corpse Spawn") + local body = createRandomDeadBody(square, 200 ) + if body and ZombRand(0,3) == 0 then -- used so that all spawned bodies are not on their rbacks + body:setFallOnFront(true) + end + mData.specialSquare = true + end + elseif zoneType == "Forest" then + --if ZombRand(0,99999)== 0 then + if ZombRand(0,2000)== 0 then + --print("Corpse Spawn") + local body = createRandomDeadBody(square, 200 ) + if body and ZombRand(0,3) == 0 then -- used so that all spawned bodies are not on their rbacks + body:setFallOnFront(true) + end + mData.specialSquare = true + end + elseif zoneType == "DeepForest" then + if ZombRand(0,20000)== 0 then + --print("Corpse Spawn") + local body = createRandomDeadBody(square, 200 ) + if body and ZombRand(0,3) == 0 then -- used so that all spawned bodies are not on their rbacks + body:setFallOnFront(true) + end + mData.specialSquare = true + end + end + square:transmitModdata() +end diff --git a/Random Corpses/media/lua/shared/ScatteredTrashes_Hook.lua b/Random Corpses/media/lua/shared/ScatteredTrashes_Hook.lua new file mode 100644 index 0000000..7525369 --- /dev/null +++ b/Random Corpses/media/lua/shared/ScatteredTrashes_Hook.lua @@ -0,0 +1,13 @@ + + +-- local function trashSquare_Hook(square) + -- --print("HOOK") + -- if square:getModData().trashSquare then return end + -- if square:getModData().specialSquare then return end + -- trashSquare(square) + +-- end + + +-- Events.LoadGridsquare.Add(trashSquare_Hook) -- every time a grid square is loaded, checks for any vehicle spawn list entries + diff --git a/Random Corpses/media/lua/shared/TheGoodShit_SquareSpawnChecks.lua b/Random Corpses/media/lua/shared/TheGoodShit_SquareSpawnChecks.lua new file mode 100644 index 0000000..a97f47e --- /dev/null +++ b/Random Corpses/media/lua/shared/TheGoodShit_SquareSpawnChecks.lua @@ -0,0 +1,98 @@ +function checkDeadZone(square) + if not square then square = getPlayer():getSquare() end + if not square then print("Player Square Failure!") return false end + if (not square:getZone() and square:getZone():getType()) then return false end + if (not getVehicleZoneAt(square:getX(), square:getY(), square:getZ())) then return false end + if (not square:getRoom() and not square:getRoom():getName() ) then return false end +end + +function isFreeTile( _square ) + if not _square or _square:Is("BlocksPlacement") or _square:Is(IsoFlagType.canBeCut) or _square:Is("tree") then + return false; + end + return true; +end + +function hasWaterObject(square) + for i=0, square:getObjects():size()-1 do + local v = square:getObjects():get(i); + if instanceof(v, "IsoObject") and v:getSprite() and v:getSprite():getProperties() and v:getSprite():getProperties():Is(IsoFlagType.water) then + --print("Water Tile") + return true; + end + end +end + +function checkBlockedSquare(square) + if not square then square = getPlayer():getSquare() end + if not square then + --print("Player Square Failure!") + return false + end + if not isFreeTile(square) then + --print("Not Free Tile") + return false + end + if square:isVehicleIntersecting() then + --print("Vehicle Intersecting!") + return false + end + if hasWaterObject(square) then + --print("Water!") + return false + end + if square:HasStairs() then + --print("Stairs!") + return false + end + if not square:hasFloor(true) then + --print("No Floor!") + return false + end + local door = square:getDoor(true) or square:getDoor(false) or square:haveDoor() + if door then + --print("Door!") + return false + end + if square:Is("IsTable") then + --print("Table!") + return false + end + if square:Is("IsTableTop") then + --print("Is TableTop!") + return false + end + if square:isSolid() then + --print("Solid!") + return false + end + if square:isSolidTrans() then + --print("Solid Trans!") + return false + end + local cell = square:getCell() -- the cell wont change. no need to getWorld():getCell() every step of the loop + local x, y, z = square:getX(), square:getY(), square:getZ() + local square2 = cell:getGridSquare(x-1, y, z) + if square2 and square:getDoorFrameTo(square2) then + --print("Door Frame!") + return false + end + local square2 = cell:getGridSquare(x+1, y, z) + if square2 and square:getDoorFrameTo(square2) then + --print("Door Frame!") + return false + end + local square2 = cell:getGridSquare(x, y-1, z) + if square2 and square:getDoorFrameTo(square2) then + --print("Door Frame!") + return false + end + local square2 = cell:getGridSquare(x, y+1, z) + if square2 and square:getDoorFrameTo(square2 ) then + --print("Door Frame!") + return false + end + return true +end + + \ No newline at end of file diff --git a/Random Corpses/media/lua/shared/Translate/EN/IG_UI_EN.txt b/Random Corpses/media/lua/shared/Translate/EN/IG_UI_EN.txt new file mode 100644 index 0000000..14199c1 --- /dev/null +++ b/Random Corpses/media/lua/shared/Translate/EN/IG_UI_EN.txt @@ -0,0 +1,10 @@ +IGUI_EN = { + -- All the UI text used in game + -- InventoryPane + + IGUI_ContainerTitle_Trash = "Trash", + IGUI_ContainerTitle_TrashPaper = "Scattered Papers", + + + +} diff --git a/Random Corpses/media/lua/shared/trash_spawners.lua b/Random Corpses/media/lua/shared/trash_spawners.lua new file mode 100644 index 0000000..b609769 --- /dev/null +++ b/Random Corpses/media/lua/shared/trash_spawners.lua @@ -0,0 +1,32 @@ +require "ScatteredStashes" + +function scattered_trash(square) + local roll = ZombRand(0,51) + if roll > 12 then roll = roll + 3 end + local sprite_type = tostring("trash_01_" .. tostring(roll)) + if not sprite_type then return end + local newSprite = (IsoObject.new(getCell(), square, sprite_type)); + if not newSprite then + print("NO NEW SPRITE!") + return false + end + if newSprite and newSprite:getProperties() then + if newSprite:getProperties():Val("ContainerType") or newSprite:getProperties():Val("container") then + newSprite:createContainersFromSpriteProperties() --end + + end + end + newSprite:getModData().forage = false + square:getObjects():add(newSprite) + square:RecalcProperties() + square:getModData().specialSquare = true + + newSprite:transmitCompleteItemToServer() + newSprite:transmitCompleteItemToClients() + + + + + + return newSprite +end diff --git a/Random Corpses/media/scattered_trashes.tiles b/Random Corpses/media/scattered_trashes.tiles new file mode 100644 index 0000000000000000000000000000000000000000..cc2361ff0c765beafa18943b30093e4c154bb0aa GIT binary patch literal 4997 zcmeHKQEP)R5Oz?uazCbMY2RCf4IegSbo8;L_NG!bA*O@=`z4_Ep=nnX?A$JJ|CRmiJBTS)- zhh{EBb;-)a{{d#+4`~E*YWO!RttZmFP7;`&`6grnCD_eFShgzwacKJYU)2W9r53%f zC(?Rqu>^Bf0#Ek)oLdd1Kw%CqOm10>Iy#Lj%kaG~`h_`JpS|6i(sD{W4hi$BFzuub VwKx4np_2ex2ym#RH4pe7l5acZYlQ#+ literal 0 HcmV?d00001 diff --git a/Random Corpses/media/textures/Trash.png b/Random Corpses/media/textures/Trash.png new file mode 100644 index 0000000000000000000000000000000000000000..0b0ce6082ea3b3eb20095441eab3bca67185b986 GIT binary patch literal 4673 zcmeHJd2kd}8vnYdr@QCKB$H!upAeEj3|JfqNF*Af3<73B0zy!uhGShsNmzw|#pSLX zCClPc;l>y_id_norI5Iy9J)oa5Q2mw*JPL+b6=V1Yo>e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b$W*0HJ~)$RJWdfKow$iy;WlxpZTnIOP;fTHB6 zB!l4PMPRr9;9>wEqzfY80tbTM1?}Da5J1Rj!3;i+6F6BUbQ8ItOnwsM15&=z>)U~8 zAsQyH$$}YK3qub7>SMjjMT8{J^AHFGfTroeKoBZ}&tNbBw=Or>6httZrYUfHSyUMk zARa&v6(*@v4k8ss6JU1nph_5l;vzxd1@JQr_T2Ur z03DrO9ST$lAP4~nQ>!5*ITgCPJ0XZ1gd{CBJ!t6YI_~Ufnn9A3CN?@8Q27l8!0`bP zMF|BWA->?yV|GJluUpjWbU}qm>6C(CW;w16lY$2>UAS_dkjv3QA=z_ycPP7+C}Y}g zx1*!SA=Duwv|2!wHi$+@FNB6tsp2|142`ZHUwUQ=k#BQ&@YKX8w2C3;B80f(_A+2F z*$^4~K}N{HW-{6=4)3R|o7q1-HN~i62ZYFVg>ZS>o%>}-p#bKGU{6d;0>l9jQC2iX zBP0aSXf@!%&4{T<;PrU=&z))bA|*NLnw%sXvXWI;pT&VuNY~GB(1x5cYydD+F>+cB zjNiWpy{khJHZIT24XOwNj$3$O_qT&wD}%vC^h`;S7zhNLQ3fWORyYyiR4S!fhR7$w zN#N{CqnxE(FhJYD!P*9L^{LLtO!e1&H+@S;8K#gx#9G^Wf#rjsRw}^D0odGuc9M`* zPsmH$di|Ek5bBt%hy&MsK0tK6FAv-WbIM8~Yh>0S`3QobQRhl)@__zf0@whSRKguwq10^RwVkN3WC=cQ0c`jS~wPd@wF#{UAS C!1LDt literal 0 HcmV?d00001 diff --git a/Random Corpses/media/textures/TrashPaper.png b/Random Corpses/media/textures/TrashPaper.png new file mode 100644 index 0000000000000000000000000000000000000000..9caad5481b3a894ef904e5542172a1fb683ec2d1 GIT binary patch literal 4673 zcmeHI32;-_6}^Aa@+DcaErT!yF9K{+jLS^yff^`_FxU-t3}Fj60f(3+BoM%~B@hT; zcG|FqB_Tizfx?gkip%Oi2&64bC;_u$VT2bf$=bfPeCezA{fQlBpd^!-&UB`{nWy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zrb&17O5!7e!qW9&Ot5<6)(1wTF-wJ|l#$+<*dd0XwzgK}c`x>RJ35ZX z2uRdY9>MGNNpzC(!qV%B>*s}Ih7Bp(wI8GQo%MOW9*$F;Y2PmS8byO$CX<_y?mG&O zJ0I|Rfg%omY9IjU*)uJ9)X1D;218r|5frI&61g9%LxDYjlq<(6rBX!@Cr~dFHBo8i z`_*Pq7a4``Gf+5U$P=!9765XqO&cwkOc}jXl8r|b5|TOmE?|Uy$uMc>QgcBTNNJLO z;q~(0K6r3Dt8{VM6HXsLc(-zBC8nO=dCtK9IRo5Y_Codcg9iu= Nx!L&x4)hPG+o literal 0 HcmV?d00001 diff --git a/Random Corpses/mod.info b/Random Corpses/mod.info new file mode 100644 index 0000000..53b2660 --- /dev/null +++ b/Random Corpses/mod.info @@ -0,0 +1,6 @@ +name=Random Corpses +poster=poster.png +id=Random Corpses +description= +url= +tiledef=scattered_trashes 951 \ No newline at end of file