Looking for some advice on how tree drop rates work

So, after doing some research, I found a species of coffee tree that survives in Eastern Canada. Since new england is not that different from Eastern Canada in terms of climate, it seems like it would be a good fit. The variety is the Kent tree(See here: https://www.greenbarnnursery.ca/products/black-locust) which provides roastable bean pods as well as leaves that can be used to brew tea(here is a sample product: https://www.wizemonkey.com/pages/coffee-leaf).

Adding these seems like a fairly straight-forward task, however I canā€™t quite figure out how to get multiple drops out of a harvest option for a tree. Any advice? Iā€™d perfer not to take the ā€˜seedā€™ route, as it is a tree.

Thank you!

1 Like

apples trees and blueberry bushes both use harvest_ter_nectar as their examine_action, and t_shrub_blueberry defines the harvest as:

"harvest_by_season" : [
    {
        "seasons": [ "summer" ],
        "entries": [
            {
                "drop": "blueberries",
                "base_num": [ 2, 5 ],
                "scaled_num": [ 0, 0.5 ]
            },
            {
                "drop": "seed_blueberries",
                "base_num": [ 1, 2 ],
                "scaled_num": [ 0, 0.25 ]
            }
        ]
    }
]

it looks like you want a list [] of an object {} with fields ā€œseasonsā€ (which is a list [] of string season names) and ā€œentriesā€.
ā€œentriesā€ is a list [] of objects {}, with each object having fields ā€œdropā€, ā€œbase_numā€, and ā€œscaled_numā€. drop is a string of the item id that the player should get when harvesting the tree.

what are you defining for your harvest_by_season?

So, here is my JSON for the coffee tree:

{
    "type" : "terrain",
    "id" : "t_tree_coffee",
    "name": "coffee tree",
    "description": "This is 'gymnocladus dioicus', or the kent coffee tree, which produces roastable coffee pods and brewable leaves in the fall.  If you examined the branches more closely, you could probably find a few mature ones.  You could also cut it down with the right tools.",
    "symbol": "7",
    "color": [ "light_green", "light_green", "light_green_green", "brown" ], "//": "barren in winter, fruits in autumn",
    "move_cost": 0,
    "flags": ["FLAMMABLE_ASH", "NOITEM", "SUPPORTS_ROOF", "TREE", "REDUCE_SCENT"],
    "transforms_into": "t_tree_coffee_harvested",
    "examine_action": "harvest_ter_nectar",
    "harvest_by_season" : [
        { "seasons": [ "autumn" ], "entries": [ { "drop": "coffee_pod", "base_num": [ 2, 5 ], "scaled_num": [ 0, 0.5 ] } ] }
    ],
    "bash": {
        "str_min": 80, "str_max": 180,
        "sound": "crunch!",
        "sound_fail": "whack!",
        "ter_set": "t_dirt",
        "items": [
            { "item": "stick_long", "count": [3, 10] },
            { "item": "splinter", "count": [10, 25] }
        ]
    }
}

I get a guarenteed drop of at least 4 coffee pods, but in all my tests Iā€™m yet to get a drop of tea leaves, and they should be dropping in equal parts. Am I doing something wrong here?

AAAAAGH. I forgot to save the file in notepad++. Well, that explains that.

 "harvest_by_season" : [
        { "seasons": [ "autumn" ], "entries": [
             { "drop": "coffee_pod", "base_num": [ 2, 5 ], "scaled_num": [ 0, 0.5 ] }
        ] }
    ],

I donā€™t see tea_raw in the drop at all. It should be:

 "harvest_by_season" : [
        { "seasons": [ "autumn" ], "entries": [
             { "drop": "tea_raw", "base_num": [ 2, 5 ], "scaled_num": [ 0, 0.5 ] },
             { "drop": "coffee_pod", "base_num": [ 2, 5 ], "scaled_num": [ 0, 0.5 ] }
        ] }
    ],

Also, I have it formatted wrong so itā€™s easier to see whatā€™s going on, so youā€™d want to reformat it correctly.
Finally, Iā€™m evangelizing the new ā€œlooks_likeā€ fields - if you add

"looks_like": "t_tree_plum",

then any tileset that doesnā€™t have a tile for t_tree_coffee will use the tile for t_tree_plum to represent the coffee tree. Itā€™s not a perfect solution to the issue of missing tiles, but itā€™s the reason why all the new dog variants use the dog tile on Chesthole, even though Chesthole hasnā€™t been updated since long before the dog variants were added.

1 Like

Sorry for the slow reply - I have updated the PR. When I made the first save, I had not completed the harvest_by_season field - I updated it with tea, merged the commit, and then tested the JSON(Forgetting to save the file). It wasn;t till after I saw it here that I realized the dumb mistake. :stuck_out_tongue:

Thank you! The PR uses looks_like on a code review suggestion both for the new seed pod and the trees.