Jump to content

TungstenX

Member
  • Posts

    15
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

TungstenX's Achievements

  1. Good day, My goal is to try and redo the cooking menu. It really sucks. For example, when you select "stew", you'll get multiple entries for the same ingredients. Making it tedious to scroll down to find the item you want to add. I was thinking that the first try would be to collate the items, e.g. rather than have 10 entries for Tomato Paste, we will have one entry, showing the stats such as qty, and other main factor/properties. The question is how do I intercept, for example, the "stew's" sub menu to collate all options/items? I've started to look at it in the following way: local function testPreFill(playerID, context, items) print("***### Pre Fill ###***") print("***### Item ###***") items = ISInventoryPane.getActualItems(items) for _,item in ipairs(items) do print("\t(" .. _ .. "): ", tostring(item:getType())) local tags = item:getTags() local size = tags:size() for i = 0, size - 1 do local tag = tags:get(i) print("\t\t ", tag) end end print("***### Context ###***") for i,v in ipairs(context) do print("\t(" .. i .. "): ", tostring(v)) end print("***###___###***") end Events.OnPreFillInventoryObjectContextMenu.Add(testPreFill)
  2. I want to mod the (church) lectern/stand. I would like to reuse the model (or sprite). The idea is to have it as a single book container. It will display a lectern with an open book (maybe reuse as well) on it when it contains a book or just the normal lectern if it is empty. Side question: Is it possible to change all existing lecterns behaviour like this or can it only be a new item/world object?
  3. I had such a giggle! I found a prepper's house/cabin in a suburb. Every single container is stuff to the limit with toilet paper rolls. The other thing that put a smile on my face: I've found and killed 2 Jason Voorhees zombies. I ran around with said Jason's outfit for a bit. (Till I was ambushed by a bunch of deadheads in a service corridor at the Crossing's Mall - thanx for the heart attack)
  4. Just want to thank the sadist that came up with the idea of house alarms!
  5. Define pancakes. What we call pancakes the rest of the world calls crêpes. What the USA calls pancakes, we call flap jacks. And we call what we call crumpets, the USA calls flap jacks. Just as you think Waffles have been spares this confusion... You get 16 of them, apparently: https://www.tastingtable.com/1035424/types-of-waffles-explained/
  6. Good day, Had a quick search but couldn't find a mod that makes selecting ingredients more streamline. The vanilla menu will list, for instance, 10 entries for tomato paste (in the sub menu of making a stew), etc. I tried search for a radial menu for cooking but got no joy. (Mind you, I might have given up to quickly?)
  7. TungstenX

    Goodnight Mother

    Good day modders (not sure if that is a word), I've uploaded my mod called Goodnight Mother. This is my first attempt to write a mod for PZ. This add some paranormal activities to the game. Most of these activities happens when the player sleeps. Feed back is always welcome: name=Goodnight Mother poster=poster_2.png description=THIS IS HOW YOU WENT INSANE id=GoodnightMother modversion=0.11 authors=TungstenX versionMin=41.56 pzversion=41.56 https://steamcommunity.com/sharedfiles/filedetails/?id=3184804824
  8. I struggled a lot with this one. I wanted a Samara-type zombie to appear when xyz happens. Here is the code that I got to work, the explanation is in the code comments: function spawnSamara(x, y, z) -- Regex to do string starts with local pattern = "^Base.Dress" -- I've battled with createZombie for a long time. It either dress the zombie in a random outfit or no outfit. -- The dressInClothingItem, dressInNamedOutfit, dressInPersistentOutfitID didn't work -- Look in projectzombie/media/clothing/clothing.xml for outfit name. E.g. <m_Name>Classy</m_Name> -- Change of female, last parameter, int 0 to 100 local zombies = addZombiesInOutfit(x, y, z, 1, "Classy", 100) local samara = zombies:get(0) samara:setDir(IsoDirections.W) -- Figure out initial direction samara:setCrawlerType(1) -- (0, 1, 2) 0 Walk, 1 and 2 crawl? samara:setCrawler(true) -- start off crawler samara:setBecomeCrawler(true) -- overkill? samara:setCanWalk(false) -- keep crawling, else she will stand up -- Change appearance local humanVisual = samara:getHumanVisual() --Hair humanVisual:setHairColor(ImmutableColor.black) humanVisual:setHairModel("Long2") -- Maybe someone can make a Samara hair model, wink wink --Skin humanVisual:setSkinColor(ImmutableColor.white) humanVisual:removeBlood() -- Remove initial dirt and add specific dirt. Amount of dirt 0.0 to 1.0 humanVisual:removeDirt() humanVisual:setDirt(BloodBodyPartType.Foot_L, 1.0) humanVisual:setDirt(BloodBodyPartType.Foot_R, 1.0) humanVisual:setDirt(BloodBodyPartType.ForeArm_L, 1.0) humanVisual:setDirt(BloodBodyPartType.ForeArm_R, 1.0) humanVisual:setDirt(BloodBodyPartType.Hand_L, 1.0) humanVisual:setDirt(BloodBodyPartType.Hand_R, 1.0) humanVisual:setDirt(BloodBodyPartType.Neck, 1.0) humanVisual:setDirt(BloodBodyPartType.LowerLeg_L, 1.0) humanVisual:setDirt(BloodBodyPartType.LowerLeg_L, 1.0) humanVisual:setDirt(BloodBodyPartType.LowerLeg_R, 1.0) --Remove all decals such as bandages, etc local itemVisuals = humanVisual:getBodyVisuals() itemVisuals:clear() -- Find the dress and remove all other clothing items local dressItem = nil local itemVisuals = samara:getItemVisuals() if itemVisuals then local size = itemVisuals:size() for i = size - 1, 0, -1 do -- The dress is usually one of the last items, thus go in reverse list order local itemVisual = itemVisuals:get(i) if string.find(itemVisual:getItemType(), pattern) then dressItem = itemVisual -- Don't waste time with rest break end end if dressItem then -- Fastest way to clear an ArrayList itemVisuals:clear() -- Make dress white dressItem:setHue(0.00) dressItem:setTint(ImmutableColor.white) dressItem:removeBlood() -- Do the dirt bit for the dress dressItem:removeDirt() dressItem:setDirt(BloodBodyPartType.UpperArm_L, 1.0) dressItem:setDirt(BloodBodyPartType.UpperArm_R, 1.0) dressItem:setDirt(BloodBodyPartType.ForeArm_L, 1.0) dressItem:setDirt(BloodBodyPartType.ForeArm_R, 1.0) dressItem:setDirt(BloodBodyPartType.Torso_Lower, 1.0) dressItem:setDirt(BloodBodyPartType.Neck, 1.0) dressItem:setDirt(BloodBodyPartType.UpperLeg_L, 1.0) dressItem:setDirt(BloodBodyPartType.UpperLeg_L, 1.0) itemVisuals:add(dressItem) end end -- This did nothing --samara:addToWorld end I've removed a lot of my paranoid code; I don't trust return values not to be nil Hope this helps someone, someday
  9. Here is how the function evolved so far. It is not working properly, seem to only work once. I need to figure out how to dress it and change poses. Also having issue with sprite for mannequin. Currently I'm calling this method via a context menu to speed up the testing function spawn(x, y, z) local player = getPlayer() local modData = player:getModData() -- Check if mannequin was spawned before - Only one if modData and modData.manny then local gmsc = modData.manny if gmsc.spawned then -- already spawned return end end -- Where to put Manny local targetSquare = getSquare(x,y,z) -- TODO: figure out direction to face local facingDir = "E" -- Create a Mannequin as a Manny -- TODO: That sprite thingy local newMannequin = IsoMannequin.new(player:getCell(), targetSquare, getSprite("Base.MannequinScarecrow01")) newMannequin:setSquare(targetSquare) --TODO: Dress mannequin, change pose --update direction newMannequin:setDir(IsoDirections[facingDir]) -- This is not working, why? -- This throws an error --newMannequin:addToWorld() -- Copy and paste, no idea what it does for i = 1, newMannequin:getContainerCount() do newMannequin:getContainerByIndex(i - 1):setExplored(true); end -- always on top, not working --targetSquare:AddSpecialObject( newMannequin ) -- Not sure about this if isClient() then newMannequin:transmitCompleteItemToServer() end -- Jumping the hoops, not sure if all is needed? triggerEvent("OnObjectAdded", newMannequin) getTileOverlays():fixTableTopOverlays(targetSquare) targetSquare:RecalcProperties() targetSquare:RecalcAllWithNeighbours(true) triggerEvent("OnContainerUpdate") IsoGenerator.updateGenerator(targetSquare) -- Add to player's modData modData.manny = {} modData.manny.mannequinObject = newMannequin; modData.manny.spawned = true; end Is this approach correct? Is there a better way to do it? That sprite thingy?
  10. Here is how the function evolved so far: (There was a glitch and the stuff that was on the floor wasn't there when I started the game again - thus this must be verified carefully) Currently I'm calling this method via a context menu to speed up the testing function UndressAll(x, y, z) local player = getPlayer() local container = player:getInventory() local currentSquare = getSquare(x, y, z) local items = container:getItems() player:dropHandItems() -- Worn items local wornItems = player:getWornItems() local size = wornItems:size() for i = 0, size - 1, 1 do local wItem = wornItems:get(0) if wItem ~= nil then local item = wItem:getItem() currentSquare:AddWorldInventoryItem(item, 0, 0, 0) player:removeWornItem(item) container:Remove(item) wornItems:remove(item) end end items = container:getItems() size = items:size() for i = 0, size - 1, 1 do local item = items:get(0) if item ~= nil then local itemDisplayName = item:getDisplayName() currentSquare:AddWorldInventoryItem(item, 0, 0, 0) container:Remove(item) end end end Is this correct? Is there a better way to do this?
  11. The stupid game is bleeding into my rl. 1. The other day I was fixing my (real) bedside lamp and was left with a piece of electrical wire and a broken switch. I looked at it and wonder, for a second, if these are craftable materials to save of if I can throw it away. 2. I opened the cupboard in the kitchen, today, and my eye caught the tin food. I wondered what tuna and peas would actually taste like. I need to get out more...
  12. Good day, How do I get the spawn points, in single player, for the current loaded map? I found a spawnpoints.lua file in the map directory, with a function called SpawnPoints and saw there is a SpawnPoints java class but when I try the following, I get an error: require "SpawnPoints" print('SpawnPoints: ' .. SpawnPoints())
  13. Good day, I'm trying to "drop" all items in the player's inventory. The issue that I'm facing now is that the items are on the floor, the player's inventory shows empty but the attachment/equip dot is shown and you have to unequip the item before you can wear it. Also, the items are still shown on the player's model (as well as the floor). This is the current iteration of my code: local container = player:getInventory() player:dropHandItems() -- works well local items = container:getItems() for i = 0, items:size() -1, 1 do local item = items:get(i) currentSquare:AddWorldInventoryItem(item, 0, 0, 0) -- Put on floor if item:isEquipped() then -- unequip player:removeAttachedItem(item) else player:getInventory():DoRemoveItem(item) -- :clear() didn't work end end 1. Is my approach correct? (I can't find a "drop" function) 2. How do I unequip (clothing, bags, etc) and remove item from the player's inventory 3. How do I remove non-wearing items such as water bottles, etc.
  14. Thank you @Hugo Qwerty Will have a look
  15. Good day, I'm making a mod and would like to spawn a mannequin or corpse when player does xyz. I've looked at a few solution but it is not quit what I'm looking for. E.g. the solution (AddWorldInventoryItem) in the following topic will show the "icon" of the corpse, i.e. Base.CorpseMale (https://pzwiki.net/wiki/PZwiki:Item_List#Corpse) Is there a way to spawn the "model" of a mannequin or a corpse immediate given the player's coordinates? In other words, the mannequin will appear next to the player when the player does xyz.
×
×
  • Create New...