Foundation

Berry Basket for Foundation

Released (updated ago). Ranked 160 of 298 with 2,113 (0 today) downloads

Published by GarranPlum (mod ID: 1103617)

berrybasket_cover_1280x720.png

Berry Basket by Garran Plum

Berry Basket

A high-output berry producer you can place anywhere. No building, zones, or cost requirements.


Why I Created This Mod

This is the first game mod I've ever written. I combined ideas from @junkets's Berry Farm, @Batyushki's Aladdin's Lamp and @RainsinMuff1n's Fantasy Decorations, to make a unique building:

  • Berry Basket produces a large but reasonable number of berries, rather than an infinite count. Shows more realistic numbers in toolbar.
  • No building is required. The basket can be placed anywhere.
  • When clicked, the basket shows production stats directly, without clicking the building parts list.
  • A new Berry Picker job is created with two worker spots for the basket. Berry Pickers and Foragers tend to the basket.
  • Transporters pick up and carry berries to the granary from the same basket.

For a "monument" style version of this mod which produces fish and contains other décor parts, try my Barrel O'Fish.

Changing The Basket Graphic

The Berry Basket 3D model PREFAB_BASKET_BERRIES_PART comes from Fantasy Decorations. You can change it to another prefab in that mod (or any other prefab), by modifying the value PREFAB_BASKET_BERRIES_PART both places that it appears in berryBasket.lua (see both code boxes below):


-- BUILDING PART Berries
berryBasket:register({
	DataType = "BUILDING_PART",
	Id = "BUILDING_PART_BERRIES",
	Name = "BUILDING_PART_BERRIES_NAME",
        AssetBuildingFunction = "BUILDING_FUNCTION_BERRY_PRODUCER",  
	ConstructorData = {
		DataType = "BUILDING_CONSTRUCTOR_DEFAULT",
		CoreObjectPrefab =  "PREFAB_BASKET_BERRIES_PART"
	}
}}


Changing The Berry Production Behavior

You can change the rate of berry production and picking by modifying the values in this section of berryBasket.lua:

-- RESOURCE CONTAINER Berries
berryBasket:registerPrefabComponent("PREFAB_BASKET_BERRIES_PART", {
    DataType = "COMP_RESOURCE_CONTAINER",
    ResourceData = "BERRIES",
    IsReplenishable = true,
    ReplenishDurationInDays = 7,
    ReplenishQuantity = 10,
    ResourceValue = 5.0, -- How many to pick each time?
    AvailableQuantity = 50, -- Maximum storage.
    Radius = .55, -- Villager stands this far away to pick.
    IsDestroyWhenEmpty = false
})


Eliminating Dependencies

You can remove the Fantasy Decorations dependency entirely by specifying any of the built-in prefabs, like PREFAB_RESOURCE_BERRIES which will draw a standard berry bush instead of the basket. This change needs to made in both of the sections shown above (both places that PREFAB_BASKET_BERRIES_PART appears.


Credits & Acknowledgements

Thank you to @junkets, @Batyushki, and @RainsinMuff1n for your inspiration and examples. Starting from someone else's working code is a huge advantage and I recommend that approach for any new mod developers.


Future Directions

I'd like to create a monument version of this mod with a few more parts, like a table or crate to put the basket on. It also needs nodes to better place the workers around it. Finally, I plan to make other versions with different resources to help you keep your village stocked!

Thanks for checking it out... I welcome and enjoy your feedback!

-- GarranPlum

Releases

FilenameSizeVersionAddedOptions
berrybasket2.2.zip2.9mb2.0.0

berrybasket.4.zip3.03kb1.0.2

berrybasket.2.zip3.72kb1.0.1

berrybasket.zip3.6kb1.0.0

4 comments

Join the community or sign in with your gaming account to join the conversation:

DD
DuckDerply @duckderply

Hey, would like to try the mod, but I´m getting this error

"berryBasket.lua(14): BUILDING_BERRY_BASKET (in BUILDING): The property 'isEditable' doesn't exist, property's value will be ignored"

I have no idea how to fix it or what is causing it.

GarranPlum
GarranPlum @garranplum

Hi @DuckDerply! Thanks for letting me know. That is fixed in an upcoming release but it should not affect the game loading with the mod. Does it? You can also continue the conversation with me on my Discord, if you'd like. :-) Discord.gg

Grumblerbear
Grumblerbear @grumblerbear

good if compatable profession with wild-berries (https://foundation.mod.io/wild-berries)

GarranPlum
GarranPlum @garranplum

Hi, @Grumblerbear! Yes, it should not have any problems with any other mods. If you do have any troubles, please let me know here or on my Discord, if you'd like. :-) Discord.gg