Jump to content

Farming modding - things required to seed a plant


hrot

Recommended Posts

So i would like to change in my mod how potatoes works in farming.

I already removed from spawning any potatoes seeds and bags of seeds.

Now i have problem how to change this line:

farming_vegetableconf.props["Potatoes"].seedsRequired = 4;

How to change it to require just farming.Potato item not seeds?

I want to remove potato seeds from game and changing seeding potatoes to require potatoes only.

 

Can anyone explain how to change it? I know nothing about coding in lua.

Maybe i need to edit some other lines / functions in other files etc?

Thanks in advance.

Link to comment
Share on other sites

Well, I'm not too into farming mods but the item that is used as seed is defined in media\lua\server\farming_vegetableconf.lua

Code:

-- Potatos (16 to 20 weeks to grow)farming_vegetableconf.props["Potatoes"] = {};farming_vegetableconf.props["Potatoes"].seedsRequired = 4;farming_vegetableconf.props["Potatoes"].texture = "tileThuztorFarming1_potatoMature";farming_vegetableconf.props["Potatoes"].waterLvl = 65;farming_vegetableconf.props["Potatoes"].timeToGrow = ZombRand(89, 103);farming_vegetableconf.props["Potatoes"].minVeg = 3;farming_vegetableconf.props["Potatoes"].maxVeg = 4;farming_vegetableconf.props["Potatoes"].minVegAutorized = 5;farming_vegetableconf.props["Potatoes"].maxVegAutorized = 9;farming_vegetableconf.props["Potatoes"].vegetableName = "farming.Potato";farming_vegetableconf.props["Potatoes"].seedName = "farming.PotatoSeed";farming_vegetableconf.props["Potatoes"].seedPerVeg = 3;

Specifically this line:

farming_vegetableconf.props["Potatoes"].seedName = "farming.PotatoSeed";

You'd have to change it to:
farming_vegetableconf.props["Potatoes"].seedName = "farming.Potato";

Link to comment
Share on other sites

I edited it earlier like that.

That's my code

-- Potatos (16 to 20 weeks to grow)farming_vegetableconf.props["Potatoes"] = {};farming_vegetableconf.props["Potatoes"].seedsRequired = 4;farming_vegetableconf.props["Potatoes"].texture = "tileThuztorFarming1_potatoMature";farming_vegetableconf.props["Potatoes"].waterLvl = 65;farming_vegetableconf.props["Potatoes"].timeToGrow = ZombRand(350, 415);farming_vegetableconf.props["Potatoes"].minVeg = 14;farming_vegetableconf.props["Potatoes"].maxVeg = 20;farming_vegetableconf.props["Potatoes"].minVegAutorized = 10;farming_vegetableconf.props["Potatoes"].maxVegAutorized = 24;farming_vegetableconf.props["Potatoes"].vegetableName = "farming.Potato";farming_vegetableconf.props["Potatoes"].seedName = "farming.Potato";

but it's still requires seeds.

I think "seedName" line is only resposible for what you get after plant is fully grown, what type of seed you get.

Any ideas?

Link to comment
Share on other sites

Nope, the line I gave you is the only .lua file to even use farming.PotatoSeed I'm going to guess that seed type needed to be sowed is defined by taking the name of Vegetable and adding Seed to it. I have found nothing and I looked at all farming .lua code I could find.

Sorry.

Link to comment
Share on other sites

Hmm i found a way around that i think.

I just "removed" farming.Potato from game and replace it with farming.PotatoSeed and recreate properties of potatoes.

So now in game it works as i want. Only in code it's looks strange :D

 

It's look like this now in vegetableconf.lua

-- Potatos (16 to 20 weeks to grow)farming_vegetableconf.props["Potatoes"] = {};farming_vegetableconf.props["Potatoes"].seedsRequired = 4;farming_vegetableconf.props["Potatoes"].texture = "tileThuztorFarming1_potatoMature";farming_vegetableconf.props["Potatoes"].waterLvl = 65;farming_vegetableconf.props["Potatoes"].timeToGrow = ZombRand(350, 415);farming_vegetableconf.props["Potatoes"].minVeg = 14;farming_vegetableconf.props["Potatoes"].maxVeg = 20;farming_vegetableconf.props["Potatoes"].minVegAutorized = 10;farming_vegetableconf.props["Potatoes"].maxVegAutorized = 24;farming_vegetableconf.props["Potatoes"].vegetableName = "farming.PotatoSeed";
Link to comment
Share on other sites

Welp, I know It's a little late but I figured it out.

media\lua\client\Farming\ISUI\ISFarmingMenu.lua is the file where seed definitions are.
 

		if item:getType() == "PotatoSeed" or item:getType() == "PotatoSeed50" then			table.insert(seedsList.potatoSeed, item);		end

Change PotatoSeed to Potato like below:
 

		if item:getType() == "Potato" or item:getType() == "PotatoSeed50" then			table.insert(seedsList.potatoSeed, item);		end

And you can use potatoes as seeds.

Link to comment
Share on other sites

Thanks a lot. I will try it out now. I had some problem with my code.

 

edit:

 

With those changes in ISFarmingMenu.lua what farming_vegetableconf.lua code should look like:

Those lines especially:

farming_vegetableconf.props["Potatoes"].seedName = "farming.PotatoSeed";farming_vegetableconf.props["Potatoes"].seedPerVeg = 3;
Link to comment
Share on other sites

 

snip

 

farming_vegetableconf.props["Potatoes"].seedName = "farming.PotatoSeed"; like you earlier said it defines what item is being given to the character as a "Seed" when the plant is at the stage of growth when it gives seeds. If you change it to farming.Potato it will just give extra potatoes later on in it's growth cycle.

seedPerVeg is kind of self explanatory, 1 potato = 3 potatoSeed so I think if you change it to 0 there will be no extra anything.

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...