Jump to content

Hugo Qwerty

  • Posts

  • Joined

  • Last visited

Everything posted by Hugo Qwerty

  1. It happens in a few buildings I understand. I've seen it myself in the boat club in Riverside, it went away when I floored the whole area (but only after I left the area, and came back).
  2. This has been an issue for a while, and it's not just visual - the game thinks the blue area is outdoors.
  3. Hugo Qwerty

    Modding issue

    You might be able to do something using the OnEat value, this is how the game handles cigarettes, berries and mushrooms. See OnEat_Cigarettes and OnEat_WildFoodGeneric in /media/lua/server/recipecode.lua For exampe, create your own function, set it as the OnEat value of every food item - it will then get called when the item is eaten. Something like: if food:isRotten() then ... end
  4. For info, I think helmets do despawn, and so do boots last time I checked (I now edit the list in the Sandbox - after I lost a police vest to despawn). The list in the sandbox default includes "Base.Hat" but there are several hats that despawn, so I think the code is checking for any item that contains "Base.Hat" - which will include helmets as they have names like "Base.Hat_CrashHelmet". The same happens with shoes - "Base.Shoes" appears in the name of boots, e.g. Base.Shoes_ArmyBoots. The police vest I lost would have been "Base.Vest_BulletPolice", which matches "Base.Vest" in the sandbox list. I've also seen this happen to someone else on stream, they killed a couple of boxer zombies, went looking for a couple of mannequins to display the items and by the time they came back half of the items had gone, e.g. Base.Hat_BoxingRed.
  5. I think you can pick them up and move them, I'm fairly certain I've done that with some hay stacks.
  6. Just FYI, there is no remove function - it's Remove, or RemoveOneOf. There's also a DoRemoveItem. I don't know what the difference is between them. https://zomboid-javadoc.com/41.65/zombie/inventory/ItemContainer.html
  7. I've got the convoluted work around code written already, it's just automating it that I was struggling with. I could just create bespoke OnCreate functions that explicitly look up recipes by name (so 1 OnCreate for each food item, which then calls a generic calculate function and passes in the recipe name), but 1 recipe that could do it all without needing to do anything extra was my objective.
  8. Thanks for the reply. I'm trying to be clever... I'm trying to auto calculate the nutrition values of a food item using 1 generic OnCreate function. It's easy for simple food recipes - where it just takes whole items and combines them. However, when you start adding partial food, e.g. "Base.OilVegetable;1" the item available within OnCreate is the food item after the vegetable oil has been taken, and not the 1 hunger of vegetable oil actually taken from the bottle, i.e. if you take 1 hunger of oil from a full bottle the item passed into OnCreate is the almost full bottle - so you can't take the calories from it to calculate the total. However, if I have the recipe name (assuming it's unique) then I can determine how much vegetable oil the recipe specifies, then calculate the correct calories accordingly. Maybe if I create a dummy 'Written Recipe' item, put some modData on it as you've done in the example, then require that as an ingredient in the recipe, that should work. Or just use the result, as you suggest. FWIW, the convoluted version I wrote does seem to work... recipe Make Bowl of Cereal { Bowl, [Recipe.GetItemTypes.Cereal];5, [Recipe.GetItemTypes.Milk];2, Result:CerealBowl, Time:50.0, Category:Cooking, OnGiveXP:Recipe.OnGiveXP.Cooking3, OnCanPerform:Recipe.OnCanPerform.Hydrocraft.RememberThisRecipe, OnCreate: Recipe.OnCreate.Hydrocraft.CreateComplexFood, Override: true, } Thanks for the help. Hugo
  9. I've seen the same thing with a coffee machine in the railway yard outside of LV, it worked when I hooked up a generator, but when I brought the coffee machine home it did not work. Not recent, so I don't know if it's still an issue.
  10. What does the message say? If it says something about a file not matching the one on ther server, that happesn when you and the server aren't running the same version of PZ. It could be that the server hasn't updated to the latest release, or is running a beta build, for example.
  11. I've had something that might be related, I was using a vanilla sport car (Dash Elite, I think) to tow a Chevalier Dart but as soon as I moved into 2nd gear I started to slow down to the point where I was barely moving (and burning a LOT of gas). If I stopped and accelerated again it would be fine in 1st gear, but then slow again in 2nd gear. 41.71, single player, no vehicle mods.
  12. Does anyone know, for a given recipe X, is the OnCanPerform function in recipe X guaranteed to be the last OnCanPerform function called before the OnCreate function of recipe X? In other words, if PZ is calling OnCanPerform functions for all available recipes (?), is it guaranteed that the last OnCanPerform that runs before the player triggers OnCreate for a recipe will be be the OnCanPerform for that recipe? I'm trying to access a recipe name within an OnCreate function, and the only way I can think of is either storing the recipe in an OnCanPerform that stores the recipe name and returns true, or write a bespoke function for every OnCreate and hard-code the recipe name. It would be much easier if I could do the former.
  13. You can't plumb a sink that is outside. I think you can build a wall and door frame around it though - to make it inside - plumb the sink, then sledgehammer them away.
  14. Were they in your main inventory? I don't think PZ checks your bags for food when settings traps.
  15. The Desert Eagle is vanilla, although in game it is called D-E Pistol. The file giving you trouble is definitely from vanilla PZ, it's not Britas causing the problem.
  16. This usually happens when a server hasn't installed the latest version of a mod, or in this case, the base game itself - so everyone trying to connect has the latest version a file but the server has the old version, which means they don't match. The servers might just need to be restarted, or if you are on a beta you might need to switch to the main branch.
  17. Line 3030 of ISWorldObjectcontextMenu is: local barList = playerInv:getItemsFromType("Soap2", true) I don't know, but if you name your soap Soap2 as well - but put it in a different module - would that work? If the game is only checking Type - and not Full Type - maybe you could trick the game without editing the code.
  18. No, the weight is unrelated to the 'capacity'. So you will need to edit the UseDelta as well.
  19. Generator's don't emit heat, and using one indoors will probably kill you. You want an antique oven if you're cold.
  20. I was tinkering with some modding and couldn't get this to work, it seems it's a vanilla issue as I've seen it happen to vanilla Perch, When you cook an item that has RemoveUnhappinessWhenCooked = TRUE, the unhappiness is indeed removed - but if you quit and re-load the unhappiness is back. For example, a raw Perch is -20 happiness, cook it and it's +2 happiness (+2 is from from GoodHot = true, I think), quit and re-load and it reverts to -18 happiness (so the game remembers the +2 bonus, but not the removal of the -20 debuff to happiness). Tested on single player, 41.68.
  21. I've no idea, but you might want to ask on the PZ Discord (in the #modding channel), or perhaps on the Filibuster Rhymes Discord.
  22. No problem. You need to kill the zombie inside the house for them to have a chance of dropping a key.
  23. 1) Hit it with a weapon, might take quite a few hits. If you lure a zombie into your house and then kill them they might have a house key - it is always the key to the building they are in when they died. 2) Fridges and freezers just slow down the rotting timer (fride 5x slower, freezer 25x slower IIRC). 3) Mods, there are lots on the Steam workshop to speed this up.
  24. I think you just want: SuburbsDistributions["Paperbag_Jays"], without the ["all"]. If that doesn't fix it, post the error message you're getting.
  25. On possible way is to use the OnEat proprty: For example, vanilla cigarettes uses: OnEat = OnEat_Cigarettes, OnEat_Cigarettes is a function that deals with happiness / stress changes from smoking. You could write your own function to just add the two items to the player's inventory, although you might need to check that the food has been completely consumed to prevent the player getting the items every time they drink 1/4 of it. Alternatively, you could create a 'TumblerAndStraw' item and return that from ReplaceOnUse, and use that in the create recipe (and create a recipe to to make a TumblerAndStraw from the two items).
  • Create New...