Jump to content

excon

Member
  • Posts

    41
  • Joined

  • Last visited

Recent Profile Visitors

325 profile views

excon's Achievements

  1. Hi i am trying to get a cooker going with a near campfire recipe sadly that will also work if the campfire is off i added a Heat:-0.22, to look for a heatsource but that doesn't work also maybe something like a test for rotten item just for a fire call ? the pot has Type = Food, IsCookable = true, recipe has NearItem:Campfire, Heat:-0.22, CanBeDoneFromFloor:true,
  2. function TastySoup_OnGrab (a, b, c, d, result) player = getPlayer(); cookinglevel = player:getPerkLevel(Perks.Cooking); if cookinglevel == 0 then result:setName("Watery Soup"); result:setHungChange(result:getHungChange()*0.7); end if cookinglevel == 1 then result:setName("Okay Soup"); end if cookinglevel == 2 then result:setName("Nice Soup"); result:setHungChange(result:getHungChange()*1.1); end if cookinglevel == 3 then result:setName("Tasty Soup"); result:setHungChange(result:getHungChange()*1.3); end if cookinglevel == 4 then result:setName("Delicious Soup"); result:setHungChange(result:getHungChange()*1.5); end if cookinglevel == 5 then result:setName("Gourmet Soup"); result:setHungChange(result:getHungChange()*2); end end
  3. are you 100% sure the function call runs via a print statement or no error in the log ? when that is confirmed check the syntax
  4. anyone an idea how to acomplish this: - create a useage table of the item - disable feature of an item after usage is hi - create the chance of malfunction after usage is very hi any pointers be great
  5. i would like a random chance to have an item cause a fire on use or explosion. what is the best way to achieve this i have seen wear at weapons and tools
  6. Hi Patrick gives a great overview of how mods work in general use this as your entry into the rabbit hole (not affiliated just how i got started ) start with that and read below https://pzwiki.net/wiki/Modding
  7. @op you should look at 7daysto die that has 90% of the items you described
  8. guidance and sample records distri car parts 0.2 or book rarity by lvl 1-5 for: 6,4,2,1,0.5 available areas car: GloveBox TrunkStandard TrunkHeavy TrunkSports DriverSeat Seat PoliceTruckBed PoliceGloveBox RangerTruckBed RangerGloveBox FireTruckBed FireGloveBox FossoilTruckBed FossoilGloveBox PostalTruckBed PostalGloveBox AmbulanceTruckBed AmbulanceGloveBox needed distri require 'Items/SuburbsDistributions' require 'Vehicles/VehicleDistributions' require 'Items/ProceduralDistributions' require 'Items/SuburbsDistributions' syntax table.insert(ProceduralDistributions.list["GarageMechanics"].items, "Base.muffler"); table.insert(ProceduralDistributions.list["GarageMechanics"].items, 0.2);
  9. Hi iam working on a distribution table for my mods ites but i see vastly different values regarding the spread table.insert(ProceduralDistributions["list"]["BedroomDresser"].items, 0.0001); and another one had table.insert(ProceduralDistributions["list"]["PlankStashMagazine"].items, 30); can some one explain to me the probability behind those values ? Thank you
  10. function Recipe.OnCreate.DoubbleFilledReturn(items, result, player) bottleChance = ZombRand(1,4) -- for every item that activates via the recipe the loop goes for i=0, items:size()-1 do local item = items:get(i) local itemDisplayName = item:getDisplayName() local itemName = item:getName() -- whiskey if itemDisplayName == getText("Whiskey Bottle filled with Spirit") then --WorkItemName = itemDisplayName player:getInventory():Remove("WhiskeyRefill") if bottleChance== 1 then player:getInventory():AddItem("Base.brokenglass_1_0") bottleChance = 2 elseif bottleChance == 2 then player:getInventory():AddItem("Base.WhiskeyEmpty") elseif bottleChance == 3 then player:getInventory():AddItem("Base.WhiskeyEmpty") end end --same pattern for all other drinks below end this is how i solved it - not pretty cause i need the same block for all drink/refills and id rather just fork out the variable and use the creator as prototype. I also have the issue that i cannot get elseif bottleChance > 1 then to work any help is apprciated on this and the get item via variable name issue, TY! ps local itemName = item:getName() did nothing for me ?
  11. biggest issue is how do i set the var takeMe or returnMe so i can point to the item as variable in here player:getInventory():AddItem("returnMe") they are global so i do not get why they do not get fetched
  12. function Recipe.OnCreate.DoubbleFilledReturn(items, result, player) bottleReturn = ZombRand(1,4); for i=0, items:size()-1 do local item = items:get(i) local itemDisplayName = item:getDisplayName() local itemName = item:getName() --get Display name and return bottle if itemDisplayName == getText("WhiskeyBottle filled with Spirit") then WorkItemName = itemDisplayName returnMe = Base.WhiskeyEmpty takeMe = WhiskeyRefill --player:getInventory():AddItem("Base.WhiskeyEmpty") --player:getInventory():Remove("WhiskeyRefill") end if bottleReturn==1 then player:getInventory():AddItem("returnMe") player:getInventory():AddItem("returnMe") player:getInventory():AddItem("returnMe") player:getInventory():Remove("takeMe") player:getInventory():Remove("takeMe") player:getInventory():Remove("takeMe") elseif bottleReturn==2 then player:getInventory():AddItem("returnMe") player:getInventory():AddItem("returnMe") player:getInventory():AddItem("returnMe") player:getInventory():Remove("takeMe") player:getInventory():Remove("takeMe") player:getInventory():Remove("takeMe") elseif bottleReturn==3 then player:getInventory():AddItem("returnMe") player:getInventory():AddItem("returnMe") --player:getInventory():AddItem("returnMe") player:getInventory():AddItem("Base.brokenglass_1_0") player:getInventory():Remove("takeMe") player:getInventory():Remove("takeMe") player:getInventory():Remove("takeMe") end end end so i have it that far 3 bottles or refill go in if refill is whiskey remove refill full add refill emtpy but the bottom part is my issue where i basically add a randomization and chance to receive a broken glass instead of the item im sure its some dumb sytanx error
  13. for i=0, items:size()-1 do local item = items:get(i) local itemDisplayName = item:getDisplayName() local itemName = item:getName() -- Is "IGUI_WorkItem1" the "itemDisplayName" for the "item" at items:get(i)? if itemDisplayName == getText("IGUI_WorkItem1") then WorkItemName = itemDisplayName -- Store item display name into WorkItemName end -- Is "IGUI_WorkItem1" the "itemName" for the "item" at items:get(i)? if itemName == getText("IGUI_WorkItem1") then WorkItemName = itemName -- Store item name into WorkItemName end end this allows for two ways to loop through the items used to trigger with your example i was able to search better
  14. player:getInventory if Base.BeerBottle == true do player:getInventory():AddItem("Base.BeerBottleEmpty") basically i need to check what item the player has in the inventory or uses to start a recipe and then add the empty version of those items back into his inventory what syntax is the txt files in is that also lua ? TY !
×
×
  • Create New...