Jump to content


  • Posts

  • Joined

  • Last visited

smajt's Achievements

  1. Someone got a new tilesets to worlded,buildinged,tiled ? i want to use ATM's from the game etc.
  2. Hi... again... so after a long hours of trying to make corpse removal i got to the point that i remove corpses but only on server side (after i respawn i dont see corpses, but everyone else sees it) For testing purpouses I make that OnPlayerDeath event on server side and it worked then, but thats not what i need. I need it strict client -> server. Here im sending player object to the server function PlayerDataCollector.OnPlayerDeath(player) if PlayerDataCollector.isReviving then debugPrint("OnPlayerDeath - Player died while reviving. Skipping.") sendClientCommand("RevivingClient", "isReviving", { true }) return end sendClientCommand("RevivingClient", "isReviving", { false }) PlayerDataCollector.isReviving = true end Here im receiving it on the server and im putting player square to the array function commandModule.RevivingClient.isReviving(player, args) if player ~= nil then if args[1] == true then debugPrint("RemovePlayersServer - OnPlayerDeath - Putting square to the alt list.") altDeathSquares[#altDeathSquares+1] = player:getSquare() elseif args[1] == false then debugPrint("RemovePlayersServer - OnPlayerDeath - Putting square to the list.") deathSquares[#deathSquares+1] = player:getSquare() end else debugPrint("RemovePlayersServer - isReviving - Player object is null.") end end Here im executing checks on the squares to see if there is a body function OnTick(ticks) checkDeathSquares(deathSquares, bodyIds) checkDeathSquares(altDeathSquares, altBodyIds) clearDeadCorpses(bodyIds, false) clearDeadCorpses(altBodyIds, true) end function checkDeathSquares(squares, bodyids) for key, square in pairs(squares) do local bodies = square:getDeadBodys() if bodies == nil or bodies:size() == 0 then return end for i=0, bodies:size() - 1 do local body = bodies:get(i) bodyids[body:getObjectID()] = body end squares[key] = nil end end Here im deleting corpses and dropping player items on the ground function clearDeadCorpses(bodyids, fullclear) for objectId, body in pairs(bodyids) do local bodysquare = body:getSquare() if not fullclear then local bodyinv = body:getContainer() local items = bodyinv:getItems() local itemsarray = {} if items then for i=1, items:size() do local item = items:get(i-1) table.insert(itemsarray, item) end end for i=1,#itemsarray do bodysquare:AddWorldInventoryItem(itemsarray[i], ZombRandFloat(0, 0.99), ZombRandFloat(0, 0.99), 0); bodyinv:Remove(itemsarray[i]) end end bodysquare:removeCorpse(body, false) bodyids[objectId] = nil end end Unfortunately the lack of modding documentation with examples makes it more difficult to understand the problem maybe someone more experienced with project zomboid modding could help me
  3. Hi, im trying to delete player corpses after they die. i tried many ways to delete player corpses but it only disappeared to the time i respawned. now im trying something like this function RemovePlayers(_object) local corpse = _object if corpse and instanceof(corpse, "IsoDeadBody") then local corpseinv=corpse:getContainer() local items=corpseinv:getItems() local corsquare=corpse:getSquare() local itemsarrey={} if items then for i=1,items:size() do local item = items:get(i-1) table.insert(itemsarrey,item) end end for i=1,#itemsarrey do corsquare:AddWorldInventoryItem(itemsarrey[i], ZombRandFloat(0, 0.99), ZombRandFloat(0, 0.99), 0); corpseinv:Remove(itemsarrey[i]) end corsquare:removeCorpse(corpse, false) end end Events.OnContainerUpdate.Add(RemovePlayers) before i was trying to do it in onPlayerDeath event but then it didnt find player body.
  4. Hi again, is there any way i can cancel player death? now im trying to heal player when event starts but its not working,
  5. Hi, im trying to get clickedPlayer from OnFillWorldObjectContextMenu. function CCCAdminMenu.CurrentTargets(worldobjects, subMenuObject) local NoPlayer local clickedPlayer = worldobjects.clickedPlayer if instanceof(clickedPlayer, "IsoPlayer") then local clickedPlayer = obj local clickedPlayerName = clickedPlayer.Forname .. " " .. clickedPlayer.Surname TargetName = subMenuObject:addOption(getText("UI_3CRP_Target_Name", clickedPlayerName), worldobjects, nil) TargetName.notAvailable = true NoPlayer = 0 else NoPlayer = 1 end end Now im trying something like this but before that i was trying to use for loop to check if in worldobjects is any instanceof isoplayer is anyone have an idea how i can get that to work ?
  6. in your map.info set lots=name_of_your_map or just remove lots=muldraugh, ky
  7. require "Items/ItemPicker" require "Items/SuburbsDistributions" require "Items/ProceduralDistributions" require "Vehicles/VehicleDistributions" local function RemoveLoot (name) local cache = {} local function patch(t) for i=#t,1,-1 do if t[i] == name then table.remove(t,i) table.remove(t,i) end end end for room,r in ipairs(SuburbsDistributions) do for container,c in pairs(r) do if c.items and not cache[c.items] then cache[c.items] = true patch(c.items) end end end for proc,p in ipairs(ProceduralDistributions.list) do if p.items and not cache[p.items] then cache[p.items] = true patch(p.items) end if p.junk and not cache[p.junk] then cache[p.junk] = true patch(p.junk) end end for vehicle,p in pairs(VehicleDistributions) do if p.items and not cache[p.items] then cache[p.items] = true patch(p.items) end if p.junk and not cache[p.junk] then cache[p.junk] = true patch(p.junk) end end end RemoveLoot('LouisvilleMap1') RemoveLoot('LouisvilleMap2') RemoveLoot('LouisvilleMap3') RemoveLoot('LouisvilleMap4') RemoveLoot('LouisvilleMap5') RemoveLoot('LouisvilleMap6') RemoveLoot('LouisvilleMap7') RemoveLoot('LouisvilleMap8') RemoveLoot('LouisvilleMap9') RemoveLoot('MuldraughMap') RemoveLoot('WestpointMap') RemoveLoot('MarchRidgeMap') RemoveLoot('RosewoodMap') RemoveLoot('RiversideMap') still not working
  8. require "Items/ProceduralDistributions" require "Items/SuburbsDistributions" for key, x in pairs(ProceduralDistributions.list) do if x == nil then return end for index, y in ipairs(x.items) do if y == nil then return end if y == "LouisvilleMap1" or y == "LouisvilleMap2" or y == "LouisvilleMap3" or y == "LouisvilleMap4" or y == "LouisvilleMap5" or y == "LouisvilleMap6" or y == "LouisvilleMap7" or y == "LouisvilleMap8" or y == "LouisvilleMap9" or y == "MuldraughMap" or y == "WestpointMap" or y == "MarchRidgeMap" or y == "RosewoodMap" or y == "RiversideMap" then table.remove(ProceduralDistributions.list[x].items, index) table.remove(ProceduralDistributions.list[x].items, + 1) end end end for index, x in ipairs(SuburbsDistributions["all"]["inventoryfemale"].items) do if y == nil then return end if y == "LouisvilleMap1" or y == "LouisvilleMap2" or y == "LouisvilleMap3" or y == "LouisvilleMap4" or y == "LouisvilleMap5" or y == "LouisvilleMap6" or y == "LouisvilleMap7" or y == "LouisvilleMap8" or y == "LouisvilleMap9" or y == "MuldraughMap" or y == "WestpointMap" or y == "MarchRidgeMap" or y == "RosewoodMap" or y == "RiversideMap" then table.remove(x.items, index) table.remove(x.items, index + 1) end end for index, x in ipairs(SuburbsDistributions["Bag_SurvivorBag"].items) do if y == nil then return end if y == "LouisvilleMap1" or y == "LouisvilleMap2" or y == "LouisvilleMap3" or y == "LouisvilleMap4" or y == "LouisvilleMap5" or y == "LouisvilleMap6" or y == "LouisvilleMap7" or y == "LouisvilleMap8" or y == "LouisvilleMap9" or y == "MuldraughMap" or y == "WestpointMap" or y == "MarchRidgeMap" or y == "RosewoodMap" or y == "RiversideMap" then table.remove(x.items, index) table.remove(x.items, index + 1) end end So im trying to remove all maps from loot tables. code that i shared is not working. if someone could write me an example or give me some links to forum posts or docs about it.
  9. Solution to my problem: if someone have the same problem as I and your doing ur map cell by cell i recommend to make checkerboard with the size of ur map mine is 12x12 and im compiling all the cell zombiemaps into one i think its the easiest way to solve my problem. remember that u need to put black background before the checkerboard layer
  10. ok i know this but is there a method to make zombie spawn only for one cell? edit: i mean to make zombie spawns cell by cell
  11. Hi, im creating map and i want to add zombies to it. i created a white scale map for zombies spawns and i tried to insert it into one cell. (map is 12x12 cells) as u already know from the title its not working. (image is 300x300 px cause when i tried to do 30x30px, worlded responds with an error) i used: file -> Generate Lots -> Selected Cells Only
  • Create New...