Author Topic: Adding a tree that can be harvested year round  (Read 308 times)

Offline Lazy_lizard

  • Zombie Food
  • *
  • Posts: 48
    • View Profile
Adding a tree that can be harvested year round
« on: July 28, 2016, 03:49:32 PM »
I'm trying to add juniper trees, which near as I can tell have berries in varying stages of ripeness year round, but omitting harvest_season in the terrains json definition seems to default to autumn.
Code: [Select]
[
    {
        "type" : "terrain",
        "id" : "t_tree_juniper",
        "name": "juniper tree",
        "symbol": "7",
        "color": [ "ltblue", "ltblue", "ltblue", "brown" ],
        "move_cost": 0,
        "flags": ["FLAMMABLE_ASH", "NOITEM", "SUPPORTS_ROOF", "TREE", "REDUCE_SCENT"],
        "harvestable": "juniper_berries",
        "examine_action": "harvest_tree_shrub",
        "transforms_into": "t_tree_juniper_harvested",
        "bash": {
            "str_min": 80, "str_max": 180,
            "sound": "crunch!",
            "sound_fail": "whack!",
            "ter_set": "t_dirt",
            "items": [
                { "item": "stick", "count": [3, 10] },
                { "item": "splinter", "count": [10, 25] }
            ]
        }
    },
    {
        "type" : "terrain",
        "id" : "t_tree_juniper_harvested",
        "name": "juniper tree",
        "symbol": "7",
        "color": [ "ltblue", "ltblue", "ltblue", "brown" ],
        "move_cost": 0,
        "flags": ["FLAMMABLE_ASH", "NOITEM", "SUPPORTS_ROOF", "TREE", "REDUCE_SCENT", "HARVESTED"],
        "harvestable": "juniper_berries",
        "examine_action": "harvest_tree_shrub",
        "transforms_into": "t_tree_juniper",
        "bash": {
            "str_min": 80, "str_max": 180,
            "sound": "crunch!",
            "sound_fail": "whack!",
            "ter_set": "t_dirt",
            "items": [
                { "item": "stick", "count": [3, 10] },
                { "item": "splinter", "count": [10, 25] }
            ]
        }
    }
]

Is there any way to get a tree to produce fruit in every season?

Offline pisskop

  • Survivor
  • ***
  • Posts: 3209
  • Closet Brute
    • View Profile
Re: Adding a tree that can be harvested year round
« Reply #1 on: July 28, 2016, 04:44:39 PM »
look at maple trees, apples, underbrush, blueberry bush.

shoud be a tag

Offline Lazy_lizard

  • Zombie Food
  • *
  • Posts: 48
    • View Profile
Re: Adding a tree that can be harvested year round
« Reply #2 on: July 29, 2016, 12:19:54 AM »
Can harvest_season accept multiple seasons or will that throw errors?

edit: that throws errors, never-mind.

EDIT, ROUND 2, FIGHT: looking at the all of the iexamine functions work lead me to believe that allowing a tree or under-brush terrain to be harvested year round and produce the same fruit would require source code tweaks. wild_veggies spawns items from the various associated item groups, harvest_tree_shrub calls on the harvest_season field (which can't accept multiple strings), basically junipers are to weird for the harvest mechanics as implemented.
« Last Edit: August 02, 2016, 06:50:18 PM by Lazy_lizard »

Offline Lazy_lizard

  • Zombie Food
  • *
  • Posts: 48
    • View Profile
Re: Adding a tree that can be harvested year round
« Reply #3 on: November 27, 2016, 07:24:01 AM »
As of the latest experimental version, what I was looking to do here is now possible. All thanks to Coolthulu for his/her/potato work in the new harvest mechanics.