Hydromancerx Posted November 7, 2014 Share Posted November 7, 2014 How do you make new Foragable items? For instance if I wanted a Beetle to be revealed at Level 2 Foraging how would I do that? Link to comment Share on other sites More sharing options...
ORMtnMan Posted November 7, 2014 Share Posted November 7, 2014 In your main ProjectZomboid folder (found in your steamapps/common if you got it via steam. go to media/lus/client/TimedActions Open up the ISScavengeAction.lua and look at the structure there. I would highly advise against overriding this, because any small change to it would mean you need to redo it in your mod. instead add a new lua that hooks onto this action. call it like HydroScavange.lua or something then hook it onto the main function. (so don't forget to import) Link to comment Share on other sites More sharing options...
RobertJohnson Posted November 7, 2014 Share Posted November 7, 2014 Take a look into ScavengeDefinition.lua, you can add stuff inside the tables directly via another lua file, way easier and safe Link to comment Share on other sites More sharing options...
ORMtnMan Posted November 7, 2014 Share Posted November 7, 2014 Take a look into ScavengeDefinition.lua, you can add stuff inside the tables directly via another lua file, way easier and safe Yeah or you could do that which would operate like the distributions... >.> I knew that *ahem* Link to comment Share on other sites More sharing options...
Moose65 Posted November 7, 2014 Share Posted November 7, 2014 Take a look into ScavengeDefinition.lua, you can add stuff inside the tables directly via another lua file, way easier and safe You got me curious so I looked into this file. As an avid forager, I must say that I have NEVER looted a cockroach, and that is coming from someone who has leveled all the way to 5. Are they bugged or disabled? Also, please give us something new to find for those of us who did the horrific grind to 5 Edit: Now that I think about it, their probably conditionally based like worms (which are bugged, but they attempt to show up while its raining). I don't normally forage at night, so I'm gonna try that real quick. Edit Edit: So, after several nighttime foraging runs (10pm~2am), I have still been unsuccessful at finding the elusive cockroach. Link to comment Share on other sites More sharing options...
Hydromancerx Posted November 7, 2014 Author Share Posted November 7, 2014 Thanks guys. Here is the code for anyone else curious.---- Created by IntelliJ IDEA.-- User: RJ-- Date: 28/08/14-- Time: 14:55-- To change this template use File | Settings | File Templates.--scavenges = {};-- plants and other foodsscavenges.plants = {};-- Branches, stones..scavenges.forestGoods = {};-- plantslocal berriesBlack = {};berriesBlack.type = "Base.BerryBlack";berriesBlack.minCount = 2;berriesBlack.maxCount = 7;berriesBlack.skill = 1;local berriesBlue = {};berriesBlue.type = "Base.BerryBlue";berriesBlue.minCount = 2;berriesBlue.maxCount = 7;berriesBlue.skill = 1;local berries1 = {};berries1.type = "Base.BerryGeneric1";berries1.minCount = 2;berries1.maxCount = 8;berries1.skill = 0;local berries2 = {};berries2.type = "Base.BerryGeneric2";berries2.minCount = 2;berries2.maxCount = 7;berries2.skill = 1;local berries3 = {};berries3.type = "Base.BerryGeneric3";berries3.minCount = 2;berries3.maxCount = 8;berries3.skill = 0;local berries4 = {};berries4.type = "Base.BerryGeneric4";berries4.minCount = 2;berries4.maxCount = 8;berries4.skill = 0;local berries5 = {};berries5.type = "Base.BerryGeneric5";berries5.minCount = 2;berries5.maxCount = 7;berries5.skill = 1;local berriesIvy = {};berriesIvy.type = "Base.BerryPoisonIvy";berriesIvy.minCount = 2;berriesIvy.maxCount = 8;berriesIvy.skill = 1;local mushrooms1 = {};mushrooms1.type = "Base.MushroomGeneric1";mushrooms1.minCount = 1;mushrooms1.maxCount = 4;mushrooms1.skill = 2;local mushrooms2 = {};mushrooms2.type = "Base.MushroomGeneric2";mushrooms2.minCount = 1;mushrooms2.maxCount = 4;mushrooms2.skill = 2;local mushrooms3 = {};mushrooms3.type = "Base.MushroomGeneric3";mushrooms3.minCount = 1;mushrooms3.maxCount = 3;mushrooms3.skill = 3;local mushrooms4 = {};mushrooms4.type = "Base.MushroomGeneric4";mushrooms4.minCount = 1;mushrooms4.maxCount = 4;mushrooms4.skill = 2;local mushrooms5 = {};mushrooms5.type = "Base.MushroomGeneric5";mushrooms5.minCount = 1;mushrooms5.maxCount = 3;mushrooms5.skill = 3;local mushrooms6 = {};mushrooms6.type = "Base.MushroomGeneric6";mushrooms6.minCount = 1;mushrooms6.maxCount = 4;mushrooms6.skill = 2;local mushrooms7 = {};mushrooms7.type = "Base.MushroomGeneric7";mushrooms7.minCount = 1;mushrooms7.maxCount = 4;mushrooms7.skill = 2;local Violets = {};Violets.type = "Base.Violets";Violets.minCount = 2;Violets.maxCount = 5;Violets.skill = 0;local GrapeLeaves = {};GrapeLeaves.type = "Base.GrapeLeaves";GrapeLeaves.minCount = 1;GrapeLeaves.maxCount = 5;GrapeLeaves.skill = 1;local Rosehips = {};Rosehips.type = "Base.Rosehips";Rosehips.minCount = 1;Rosehips.maxCount = 4;Rosehips.skill = 2;local WildEggs = {};WildEggs.type = "Base.WildEggs";WildEggs.minCount = 1;WildEggs.maxCount = 3;WildEggs.skill = 4;local worms = {};worms.type = "Base.Worms";worms.minCount = 1;worms.maxCount = 2;worms.skill = 1;local Cricket = {};Cricket.type = "Base.Cricket";Cricket.minCount = 1;Cricket.maxCount = 2;Cricket.skill = 2;local Grasshopper = {};Grasshopper.type = "Base.Grasshopper";Grasshopper.minCount = 1;Grasshopper.maxCount = 2;Grasshopper.skill = 3;local Cockroach = {};Cockroach.type = "Base.Cockroach";Cockroach.minCount, Cockroach.maxCount = 1;Cockroach.skill = 3;-- forest goodslocal log = {};log.type = "Base.Log";log.minCount = 1;log.maxCount = 1;log.skill = 3;local branch = {};branch.type = "Base.TreeBranch";branch.minCount = 1;branch.maxCount = 3;branch.skill = 0;local sharpedStone = {};sharpedStone.type = "Base.SharpedStone";sharpedStone.minCount = 1;sharpedStone.maxCount = 1;sharpedStone.skill = 0;local stone = {};stone.type = "Base.Stone";stone.minCount = 1;stone.maxCount = 1;stone.skill = 0;local twigs = {};twigs.type = "Base.Twigs";twigs.minCount = 1;twigs.maxCount = 3;twigs.skill = 0;table.insert(scavenges.plants, berriesBlack);table.insert(scavenges.plants, berriesBlue);table.insert(scavenges.plants, berriesIvy);table.insert(scavenges.plants, berries1);table.insert(scavenges.plants, berries2);table.insert(scavenges.plants, berries3);table.insert(scavenges.plants, berries4);table.insert(scavenges.plants, berries5);table.insert(scavenges.plants, mushrooms1);table.insert(scavenges.plants, mushrooms2);table.insert(scavenges.plants, mushrooms3);table.insert(scavenges.plants, mushrooms4);table.insert(scavenges.plants, mushrooms5);table.insert(scavenges.plants, mushrooms6);table.insert(scavenges.plants, mushrooms7);table.insert(scavenges.plants, Cricket);table.insert(scavenges.plants, Grasshopper);table.insert(scavenges.plants, Cockroach);table.insert(scavenges.plants, worms);table.insert(scavenges.plants, GrapeLeaves);table.insert(scavenges.plants, Rosehips);table.insert(scavenges.plants, Violets);table.insert(scavenges.plants, WildEggs);table.insert(scavenges.forestGoods, log);table.insert(scavenges.forestGoods, branch);table.insert(scavenges.forestGoods, sharpedStone);table.insert(scavenges.forestGoods, stone);table.insert(scavenges.forestGoods, twigs); Link to comment Share on other sites More sharing options...
Hydromancerx Posted November 7, 2014 Author Share Posted November 7, 2014 Since this looks a bit different than the item distribution stuff how would one code that? Like this?require "Farming/ScavengeDefinition";getTexture("Item_Beetle.png");local Beetle = {};Beetle.type = "Hydrocraft.Beetle";Beetle.minCount = 1;Beetle.maxCount = 2;Beetle.skill = 2;table.insert(scavenges.plants, Beetle);Or am I missing something? EDIT: OMG! It worked!! I can't believe I got the code to work! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now