Forum > Modding Help

Developing a New Friut Type

(1/1)

JDboy:
Being from Oregon where grass seed is a common sight in several areas of the state, I am trying to develop a new fruit type for fescue grass and perhaps ryegrass if I can figure our fescue first. I would like to design this new fruit type so that it is a separate ZIP file and NOT baked into any particular map, but able to be added to any map simply by being in the mods folder and active in the savegame. Of course I also plan on making a placeable sellpoint or two for the new fruit type baked into the fruit type ZIP.

Some important background information for those of you not familiar with grass seed production: To harvest grass seed the grass (when ripe) is cut using a swather/windrower and left to finish drying for about a week before running it through the combine as grass stems are quite green when the seed is ready. The combine then threshes the seed and either drops straw to be baled or chops and spreads it on the field (like wheat). Following harvest, it regrows the next year and produces another crop. Fescue is normally able to be left in the ground for 5-7 years before yield drops to the point of needing ripped out. There are of course outliers to this rule of thumb as one field I have worked has been fescue for the last 20+ years and maintains a good and steady yield.

That all being said, this fruit type needs to regrow like sugarcane, look like the ingame grass (with the exception of the ripe stage), dry using the seasons mod like dryGrass into hay, and leave straw behind the combine like wheat. Does anyone have tutorials which might be applicable to this project? I imagine there will be a need for at least a little LUA scripting (which I don't currently understand much of) for having the game automatically add the fruit type to swathers (mowers), combines, and trailers. I plan on editing the MacDon PW8 for a header to harvest the seed in the same way as canola is combined. Thanks for any help in advance!

-JD

alfalfa6945:
The Teaser:


--- Quote ---Being from Oregon
--- End quote ---

The Pleaser:


--- Quote ---where grass seed is a common sight in several areas of the state
--- End quote ---

The Shocker:


--- Quote ---I am trying to develop a new fruit type for fescue grass and perhaps ryegrass if I can figure our fescue first.
--- End quote ---

The Showstopper:


--- Quote ---I would like to design this new fruit type so that it is a separate ZIP file and NOT baked into any particular map, but able to be added to any map simply by being in the mods folder and active in the savegame.
--- End quote ---

The foliageType has to be defined in the map itself, it's not something you add in via script/mod. That said... When faced with a wall, you still have options; go through, go over, go around. You can, in fact, do grass seed without adding the foliageType to a map while still maintaining the things you wanted out of it. But it's nicer/easier to just have that foliageType added instead. And less Lua involved ;)

JDboy:

--- Quote from: alfalfa6945 on March 23, 2021, 06:51:22 PM ---The Teaser:

The Pleaser:

The Shocker:

The Showstopper:

--- End quote ---

You sir, are hilariously funny. That was good. ;D


--- Quote ---The foliageType has to be defined in the map itself, it's not something you add in via script/mod. That said... When faced with a wall, you still have options; go through, go over, go around. You can, in fact, do grass seed without adding the foliageType to a map while still maintaining the things you wanted out of it. But it's nicer/easier to just have that foliageType added instead. And less Lua involved ;)

--- End quote ---

I see. So If I was to continue trying to make it a standalone ZIP so the crop could be utilized in any map without prepwork, I would (at the very least) need a LUA telling the game to add "fescue" to the map as a foliageType? Aside from also adding it to the equipment, is there anything else which LUAs would have to do? I have not messed with adding fruits before, so perhaps I ought to study up on that first instead of behaving like a newbie.  ::)

Thanks Alfalfa!

alfalfa6945:

--- Quote from: JDboy on March 24, 2021, 12:26:26 AM ---So If I was to continue trying to make it a standalone ZIP so the crop could be utilized in any map without prepwork, I would (at the very least) need a LUA telling the game to add "fescue" to the map as a foliageType?
--- End quote ---

This was the "Showstopper", your mod can't add a foliageType to a map that doesn't already have it - but that doesn't mean that your mod couldn't make changes to a foliageType that was already on a map (ie "grass").


--- Quote ---Aside from also adding it to the equipment, is there anything else which LUAs would have to do?
--- End quote ---

This would depend on how you're wanting to do things. In my own gaming I did a few minor changes to existing functions in certain specializations (ie cutter, combine, and mower). But as with anything, there's many ways to accomplish the same thing. The one thing you want to avoid is making your own mod break functionality of existing equipment/ways of doing things. If you make changes to a function in a specialization (ie cutter), that specialization should still function as normal when not being used for what your own mod needs from it. So if you needed to make change in a function in "cutter" to enable some feature of the "MacDon PW8" you're wanting to use, it had better not mess up the cutter specialization for when you want to put a header on a combine and do some work ;)

You do learn quite a bit by just planning things out (like what you described your mod needing to accomplish), and then going through and seeing what it would take to make it happen. A lot of reading, a lot of testing, a lot of hair pulling for tiny changes that you made in another mod that negatively affected your current mod but spent hours trying to figure out why your current code isn't working as you know it should. Fun times... :D

You're not asking stupid questions, they're legit, but I thought I'd stop you on the whole adding foliageTypes to map via a mod and save you some valuable time ;)

JDboy:

--- Quote from: alfalfa6945 on March 24, 2021, 10:41:41 PM ---This was the "Showstopper", your mod can't add a foliageType to a map that doesn't already have it - but that doesn't mean that your mod couldn't make changes to a foliageType that was already on a map (ie "grass").
--- End quote ---

Ahh, I see... Was chatting with Mike on TS last night and came to that same realization after looking at and talking about how MaizePlus worked. If I understood correctly, I'd have to make the map "Fescue Ready" by adding the foliageType even if I wanted to keep the files for the crop in it's own ZIP. Realizing that now, I'll probably stick with simply trying to put it in the map and perhaps making a modder's kit or something for adding it to other maps.


--- Quote ---This would depend on how you're wanting to do things. In my own gaming I did a few minor changes to existing functions in certain specializations (ie cutter, combine, and mower). But as with anything, there's many ways to accomplish the same thing. The one thing you want to avoid is making your own mod break functionality of existing equipment/ways of doing things. If you make changes to a function in a specialization (ie cutter), that specialization should still function as normal when not being used for what your own mod needs from it. So if you needed to make change in a function in "cutter" to enable some feature of the "MacDon PW8" you're wanting to use, it had better not mess up the cutter specialization for when you want to put a header on a combine and do some work ;)

You do learn quite a bit by just planning things out (like what you described your mod needing to accomplish), and then going through and seeing what it would take to make it happen. A lot of reading, a lot of testing, a lot of hair pulling for tiny changes that you made in another mod that negatively affected your current mod but spent hours trying to figure out why your current code isn't working as you know it should. Fun times... :D

You're not asking stupid questions, they're legit, but I thought I'd stop you on the whole adding foliageTypes to map via a mod and save you some valuable time ;)

--- End quote ---
Yup, I understand what you're getting at. Thanks for the help, man! I appreciate it!  :D (y)

Navigation

[0] Message Index

There was an error while thanking
Thanking...
Go to full version