Jump to content

Betcher

Member
  • Posts

    7
  • Joined

  • Last visited

Recent Profile Visitors

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

Betcher's Achievements

  1. I dont know why you would want multiple occupations but you can just get visual code studios, go to "Project Zomboid\media\lua\shared\NPCs\MainCreationMethods.lua" or just look up an occupation to get there, and edit and of the occupations to have the stats of both together. Like if you want burglar and axeman you can just copy burglar:addFreeTrait("Burglar"); to the lumberjack and change burglar:addfreetrait to lumberjack:addfreetrait
  2. Project Zomboid\media\lua\client\Items\SpawnItems.lua local SpawnItems = {}; function SpawnItems.OnNewGame(playerObj, square) -- spawn with a belt local belt = playerObj:getInventory():AddItem("Base.Belt2"); playerObj:setWornItem(belt:getBodyLocation(), belt); Personally I played around with the starter kit a bit and got errors alot. Due to that it starts with a spear inside instead of a bat despite the bat being in the code there so I would backup the whole file before playing around with it. local bag = playerObj:getInventory():FindAndReturn("Base.Bag_Schoolbag"); if not bag then bag = playerObj:getInventory():AddItem("Base.Bag_Schoolbag"); playerObj:getInventory():AddItem("Base.WaterBottleFull"); bag:getItemContainer():AddItem("Base.BaseballBat"); bag:getItemContainer():AddItem("Base.Hammer"); playerObj:getInventory():AddItem("Base.Crisps"); playerObj:setClothingItem_Back(bag); thats how it looks like with the things in the bag but the first part is to spawn for every game, this is for spawning with starter kit so just drag the starter kit stuff over and paste the stuff you want inside
  3. I want to help but I cant find what I want. Instead of having it not be consumed or having the page recount set, I want to find where the code is that makes the book disappear when finished and add a check for if its a book have it spawn another book after, that way you still have a book even if its not the same book. Im looking in Project Zomboid\media\lua\client\TimedActions\ISReadABook.lua and I cant find anything that would do that except maybe if self.item:getNumberOfPages() > 0 then local pagesRead = math.floor(self.item:getNumberOfPages() * self:getJobDelta()) self.item:setAlreadyReadPages(pagesRead); if self.item:getAlreadyReadPages() > self.item:getNumberOfPages() then self.item:setAlreadyReadPages(self.item:getNumberOfPages()); end self.character:setAlreadyReadPages(self.item:getFullType(), self.item:getAlreadyReadPages()) But I cant see where it links to to get rid of the book after. I tried searching the rest of the files but theres nothing I can find. I think the best bet if thats not possible is to make normal books not disappear like skill books then just make a recipe where you can turn 1 book into 1 book, the new book wouldnt hvae been read. You can just call the recipe reread book or something, but I cant think of a way to do that either without playing around for half an hour+ it seems like a simple addition of DisplayCategory = SkillBook, to the top line but I dont know what other changes that would cause like would you be able to read it again after regardless.
  4. Alright since I gave slightly worse info than I intended before Ill just spell it out I guess. First you find what kind of container you want to use to start the recipe, Im going to go with a cooking pot this time, and find a similar recipe that goes with it item PotOfStew { DisplayName = Pot of Stew, DisplayCategory = Food, Type = Food, Weight = 3, Icon = PotFull, BadCold = true, BadInMicrowave = true, CookingSound = BoilingFood, EatType = Pot, IsCookable = TRUE, ReplaceOnUse = Pot, MinutesToCook = 70, MinutesToBurn = 140, DaysFresh = 3, DaysTotallyRotten = 5, HungerChange = -40, ThirstChange = -40, UnhappyChange = -20, Calories = 310, Carbohydrates = 26.3, Lipids = 14.5, Proteins = 3.8, StaticModel = CookingPot, WorldStaticModel = CookingPotSoup_Ground, Tags = HasMetal, } The stew uses a cooking pot so you can just rename it and use all the stuff inside and change it how you like. Most of the nutrition only matters for what you put inside so I wouldnt change it. Youll notice ingredients have EvolvedRecipe = Soup:10;Stew:10;Burrito:10|Cooked, in them showing what they can be added to. This comes from evolvedrecipe Stew { BaseItem:WaterPot, MaxItems:6, ResultItem:PotOfStew, Cookable:true, Name:Prepare Stew, } in Project Zomboid\media\scripts\evolvedrecipes.txt. So youre going to need to make one of those for your new recipe. On the other hand you can keep it simple and just add a unique recipe at Project Zomboid\media\scripts\uniquerecipes.txt and skip al the custom stuff uniquerecipe Tomato Soup { BaseRecipeItem:PotOfSoup, Item:farming.Tomato, Item:farming.Tomato, Item:farming.Tomato, Item:farming.Tomato, Hapiness:15, Boredom:15, } As you can see all you need is to pick a base recipe, throw in the ingredients, and youll get a custom thing looking just like it with custom stats. You could add the endurance/stress/sickness mods form different food items into it the same way you can to boredom. It would probably be easier to do since youre going to be basically doing the exact same thing unless youre adding sprites into the mix. Just make a bunch of custom stuff like tuna sandwich or something instead of making a new base recipe that involves the same steps and items and sprite of a sandwich.
  5. I dont even know how you can change how long an hour is compared to in game or out of game, so if thats a mod they should have a folder for changing Project Zomboid\media\lua\shared\defines.lua and they probably didnt change it enough. Theres stuff in there for the base increase in hunger and thirst it looks like, but you might have to go into each individual drug and change that. I havnt the faintest where to look for that, maybe mess with the usedelta? It might be hard coded. Atleast you can fix the hunger and thirst though, should be as simple as dividing that number by how you divided the the amount of time that passed. At first I wanted to link it to a trait but I couldnt find the wording on how to effect those so I just went for the defines.
  6. Everything is in Project Zomboid\media\scripts\recipes.txt For more complex things there are interactions in Project Zomboid\media\lua\server\recipecode.lua but maybe keep it simple at first, PotOfSoupRecipe is what you can look up if you want more complex dishes to brute force the code to be similar. I recommend getting visual code studios and just using the search function for anything you need. You can mod things directly in there. If you want to publish a mod look at that above video all my own mods are for myself so personally I only know how to publish to githib for other people to download off there and merge to their own sets of things.
  7. doing a quick search, the path is Project Zomboid\media\lua\client\Hotbar\ISHotbarAttachDefinition.lua for what thigns attach to a belt. attachments = { -- list of possible item category and their modelAttachement group, the item category is defined in the item script Knife = "Belt Left Upside", -- defined in AttachedLocations.lua Hammer = "Belt Left", Is how its writen. There is a second thing below it fir the right side. What Im thinking is you check out how the walkie talkie works with Project Zomboid\media\lua\shared\NPCs\AttachedLocations.lua also being in there and see if you can brute force something similar. No idea if the light will stay on but I would look up the light codes after that and see if you can add the attached state in. personally I never use flashlights but I also go with normal night time so it might be good for those who do harder versions and dont use cateyes
×
×
  • Create New...