Configuration

This page contains all information you need to configure gfg_plants, if you have any questions feel free to reach out to us on our discord.

Config

Config = {
    language = "en",                  
    debug = false,
    enhancedDebug = false,
    interactionMethod = "target", 
    interactionDistance = 2,                   
    target = "ox_target",                            
    inventory = "ox_inventory",       
    targetWaitTime = 1000,                
    placePlantHelpNotification = true,
    canPlacePlantInWater = false,     
    canPlacePlantOnRoad = false,      
}

language

Language sets which Locale to use, you can find available locales in [gfg_plants/locale/], we will add more as they become available but feel free to add your own.

language = "en",

debug

Debug should only used in a development environment

Determines whether to send debug print statements to the client and server when using the script

Debug = false

enhancedDebug

Enhanced Debug should only used in a development environment

Determines whether to send enhanced debug print statements to the client and server when using the script

enhancedDebug = false,

interactionMethod

Determines the method in which players interact with a plant. Currently supported options are: "target", "textui", "3dtext".

interactionMethod = "target",

interactionDistance

Determines the distance from the plant that the interaction is activated.

interactionDistance = 2,

target

Determines wich target resource to use.

Currently supported options are"

  • "ox_target"

  • "qb_target"

target = "ox_target",

inventory

Setting inventory to "custom" will utilize the function in server/sv_customize.lua

Determines wich inventory resource to use.

Currently supported options are:

  • "ox_inventory"

  • "qb_inventory"

  • "custom"

inventory = "ox_inventory",

targetWaitTime

1000 is default but if you experience high resource usage you may need to increase this.

Determines how often the client checks for nearby plants to create a target for.

In Milliseconds

targetWaitTime = 1000,

canPlacePlantInWater

Your housing script may place certain shells under the map, in those cases the shell may be registered as "Underwater" if this is the case you may need to set this to false.

Determines if the player can place a plant while in or under water.

canPlacePlantInWater = false

canPlacePlantOnRoad

May or may not work on all roads.

Determines if the player can place a plant on a road

canPlacePlantOnRoad = false,

Config.Plant

Config.Plant = {
    placementKeys = {
        place = 22,
        cancel = 47,
        rotateRight = 175,
        rotatLeft = 174,
        rotateSpeed = 1.0
    }
}

placementKeys

Determines the keys used when placing a plant

  • place = This key is used to place the plant (Default: Space)

  • cancel = This key is used to cancel placement (Default: G)

  • rotateRight = This key is used to rotate the plant right (Default: Arrow Right)

  • rotateLeft = This key is used to rotate the plant right (Default: Arrow Left)

  • rotateSpeed = This Determines the speed that the plant is rotated.

placementKeys = {
    place = 22,
    cancel = 47,
    rotateRight = 175,
    rotatLeft = 174,
    rotateSpeed = 1.0
}

Config.Plants

This is the configuration section for each type of plant.

Any values related to health, water, or weed level can accept floats (number with a decimal place). However the more decimal places the float has, the higher the likelihood that issues could arise. We recommend to never go more than 2 decimal places (1.25).

Config.Plants = {    
    weed = {                                                    
        name = "Weed",                                          
        type = "weed",                                          
        seedItem = "weedseed",                                  
        deadPlantItem = 'deadweedplant',                        
        zone = {                                                
            enable = true,                                      
            zones = {                                           
            "Farm_Grapeseed_1", "Farm_Grapseed_2", "Farm_Grapeseed_3", "Farm_Grapeseed_ 4", 
            "Farm_Grapeseed_5", "Farm_Grapeseed_6", "Farm_Grapeseed_7", "Farm_Grapseed_8", 
            "Farm_Grapeseed_9", "Farm_Grapeseed_10", "Farm_Grapeseed_11", "Field_Grapeseed_1", 
            "Field_Grapeseed_2", "Field_Grapeseed_3", "Field_Grapeseed_4", "Field_Grapseed_5", 
            "Field_Grapseed_6"
            }
        },
        animation = {                                           
            dict = "amb@world_human_gardener_plant@male@idle_a",
            anim = "idle_b",                                    
        },
        plantSkillCheck = {                                     
            enable = true,                                      
            difficulty = {'easy', 'easy', 'easy', 'medium'},    
            keys = {'e'},                                       
            returnSeedOnFail = true                             
        },
        plantProgressBar = {                                    
            enable = true,                                      
            time = 1000,                                        
        },
        harvestSkillCheck = {                                   
            enable = true,                                      
            difficulty = {'easy', 'easy', 'easy', 'medium'},    
            keys = {'e'},                                       
            stillHarvestOnFail = false,                         
            healthLostOnFail = {                                
                enable = true,                                  
                amountMin = 2.5,                                
                amountMax = 5.0,                                
            }                                           
        },
        harvestProgressBar = {                                  
        enable = true,                                          
        time = 1000,                                            
        },
        growth = {
            time = 5,                                           
            canHarvestAt = 90,                                  
            rewards = {                                         
                [1] = { name = "cocaleaves", minAmount = 5, maxAmount = 10 }                                                                                     
            },
            props = {                                           
                { growthLevel = 0, prop = 'prop_weed_02' },
                {growthLevel = 90, prop = 'prop_weed_01'},
            }
        },
        ambientWaterDecay = {                                   
            enable = true,                                      
            min = 1.0,                                          
            max = 1.0,                                          
            removePlantWhen0 = true                             
        },
        watering = {                                            
            { label = "Water Bottle", itemName = "waterbottle", minAmount = 5.0, maxAmount = 10.0, time = 1000, remove = true, icon = 'bottle-water' },
            {label = "Watering Can", itemName = "wateringcan", minAmount = 10.0, maxAmount = 20.0, time = 2000, remove = false, icon = 'shower'},
        },
        wateringParticleEffects = {                             
            [1] = { enable = true, dict = 'core', effect = 'ent_amb_water_drips_lg', scale = 1.0, offset = {x = 0.0, y = 0.0, z = 0.0}, alpha = 100 },
        },
        ambientWeedGrowth = {                                   
            enable = true,                                      
            min = 1.0,                                          
            max = 1.0,                                          
            removePlantWhen100 = true                           
        },
        weeding = {                                             
            { label = "Weed Killer", itemName = "weedkiller", minAmount = 10, maxAmount = 20, time = 1500, remove = true, icon = 'biohazard' },
            {label = "Trowel", itemName = "trowel", minAmount = 10, maxAmount = 20, time = 3000, remove = false, icon = "trowel"},
        },
        weedingParticleEffects = {                              
            [1] = { enable = true, dict = 'core', effect = 'ent_dst_plant_leaves', scale = 0.7, offset = {x = 0.0, y = 0.0, z = -0.5}, alpha = 100 },
            [2] = {enable = true, dict = 'core', effect = 'ent_anim_gardener_plant', scale = 1.0, offset = {x = 0.0, y = 0.0, z = 0.0}, alpha = 100},
        },
        health = {                                              
            lowWaterHealthDecay = { enable = true, waterValue = 25, amountMin = 1.0, amountMax = 1.0, },
            highWeedHealthDecay = { enable = true, weedValue = 75, amountMin = 1.0, amountMax = 1.0, },
            goodStatusHealthRise = { enable = true, waterValue = 85, weedValue = 10, amountMin = 1.0, amountMax = 1.0, },
            removePlantWhen0 = true                             
        },
    },    
}

name

Determines the plants "Name" when opening the menu (i.e. "Weed Plant 1"), Can be whatever you choose and does not have to be unique.

name = "Weed", 

type

type needs to be unique, two or more plants CANNOT share the same type.

The plant type, usually set to a lowercase version of the name.

type = "weed",  

seedItem

multiple plants CANNOT share the same seed item.

The inventory item that represents this plant type.

tableItem = "weedseed",

deadPlantItem

The dead plant item that the player receives when they remove a dead or not fully grown plant.

deadPlantItem = 'deadweedplant',

zone

Determines the zones this plant can be planted in.

  • enable = If set to true, this plant can only be planted within the zones defined below, if false, can be planted anywhere.

  • zones = The names of the zones this plant can be planted in, zone names are defined in 'Config.Zones'.

        zone = {                                                
            enable = true,                                      
            zones = {                                           
            "Farm_Grapeseed_1", "Farm_Grapseed_2", 
            "Farm_Grapeseed_3", "Farm_Grapeseed_ 4", 
            "Farm_Grapeseed_5", "Farm_Grapeseed_6", 
            "Farm_Grapeseed_7", "Farm_Grapseed_8", 
            "Farm_Grapeseed_9", "Farm_Grapeseed_10", 
            "Farm_Grapeseed_11", "Field_Grapeseed_1", 
            "Field_Grapeseed_2", "Field_Grapeseed_3", 
            "Field_Grapeseed_4", "Field_Grapseed_5", 
            "Field_Grapseed_6"
            }
        },

animation

Animation that plays when interacting with the plant, a list of available animations can be found here (https://alexguirre.github.io/animations-list/).

  • dict = Dictionary that is used to determine the animation from the list given above. This would be the bigger text in the above link.

  • anim = Animation that is used within the dictionary determined from the list given above. This would be the smaller text in the above link.

        animation = {                                            
            dict = "amb@world_human_gardener_plant@male@idle_a", 
            anim = "idle_b",                                     
        },

plantSkillCheck

Skill check triggered when a player attempts to plant.

        plantSkillCheck = {                                     
            enable = true,                                      
            difficulty = {'easy', 'easy', 'easy', 'medium'},    
            keys = {'e'},                                       
            returnSeedOnFail = true                             
        },

plantProgressBar

Progress Bar that is used when the player is planting.

  • enable = if 'true' the progress bar will play while the plant is being planted.

  • time = Determines the time it takes for the progress bar to complete (in milliseconds).

        plantProgressBar = {                                    
            enable = true,                                      
            time = 1000,                                        
        },

harvestSkillCheck

If you plan on setting healthLostOnFail.enable to true, then stillHarvestOnFail needs to be set to 'false'

Skill check triggered when a player attempts to harvest.

  • enable = Determines whether the skill check will be used or not.

  • difficulty = Determines the difficulty of the skill check, information on how to customize this can be found here (https://overextended.github.io/docs/ox_lib/Interface/Client/skillcheck).

  • keys = Determines the keys used during the skill check, information on how to customize this can be found here (https://overextended.github.io/docs/ox_lib/Interface/Client/skillcheck).

  • stillHarvestOnFail = If 'true' the player will still harvest the plant if they fail the skill check. If 'false' the plant stays the same.

  • healthLostOnFail = The plant loses a random amount of health when the player fails the harvest skillcheck.

    • enable = if 'true' the plant loses health when they fail the skillcheck.

    • amountMin = Determines the minimum amount of health the plant will lose.

    • amountMax = Determines the maximum amount of health the plant will lose.

        harvestSkillCheck = {                                   
            enable = true,                                      
            difficulty = {'easy', 'easy', 'easy', 'medium'},    
            keys = {'e'},                                       
            stillHarvestOnFail = false,                         
            healthLostOnFail = {                                
                enable = true,                                  
                amountMin = 2.5,                                
                amountMax = 5.0,                                
            }                                           
        },

harvestProgressBar

Progress Bar that is used when the player is harvesting.

  • enable = if 'true' the progress bar will play while the plant is being harvested.

  • time = Determines the time it takes for the progress bar to complete (in milliseconds).

        harvestProgressBar = {                                  
                enable = true,                                          
                time = 1000,                                            
        },

growth

One prop in props.growthlevel must have a growth level of 0. This is the level that shows the the player first plants the plant.

For best practice there should be a growthLevel prop for the level that the plant can be harvested at.

All config options related to plant growth.

  • time = Determines how long it takes for a plant to fully grow (in minutes, minimum is 1).

  • canHarvestAt = Determines the growth level at which the plant can be harvested.

  • rewards = Determines what the player gets when the plant is finished growing and they harvest it. Can be multiple items (can used for byproducts from production). Will randomly give the player an amount between the minAmount and maxAmount.

    • name = the item name within your inventory system.

    • minAmount = the minimum amount of that item the player receives.

    • maxAmount = the maximum amount of that item the player receives.

  • props = Determines the props the plant uses when at different stages of growth

    • growthLevel = The level of growth this prop is used at. Should be between 0-100.

    • prop = The prop the plant uses when it hits the defined growth level.

        growth = {
            time = 5,                                           
            canHarvestAt = 90,                                  
            rewards = {                                         
                [1] = { name = "cocaleaves", minAmount = 5, maxAmount = 10 }                                                                                     
            },
            props = {                                           
                {growthLevel = 0, prop = 'prop_weed_02'},
                {growthLevel = 90, prop = 'prop_weed_01'},
            }
        },

ambientWaterDecay

Determines the amount of water the plant loses as time goes on.

  • enable = if 'true' the plant loses water level over time.

  • min = Determines the minimum amount water the plant loses every tick (1 minute).

  • max = Determines the maximum amount water the plant loses every tick (1 minute).

  • removePlantWhen0 = Determines if the plant gets removed when the water level hits 0.

        ambientWaterDecay = {                                   
            enable = true,                                      
            min = 1.0,                                          
            max = 1.0,                                          
            removePlantWhen0 = true                             
        },

watering

Determines the options the player can use to water this plant.

  • label = Determines the name of the item in the menu.

  • itemName = The item name the player needs when attempting to water the plant with this option.

  • minAmount = Determines the minimum amount of water this option applies to the plant.

  • maxAmount = Determines the maximum amount of water this option applies to the plant.

  • time = Determines how long the progress bar takes when using this option.

  • remove = If set to 'true' this item is removed when the player choses this option.

  • icon = Determines the icon used in the menu, you can find more icons here (https://fontawesome.com/search?m=free&o=r).

        watering = {                                            
            { 
                label = "Water Bottle", 
                itemName = "waterbottle", 
                minAmount = 5.0,               
                maxAmount = 10.0, 
                time = 1000, 
                remove = true, 
                icon = 'bottle-water' 
            },
            {label = "Watering Can", itemName = "wateringcan", minAmount = 10.0, maxAmount = 20.0, time = 2000, remove = false, icon = 'shower'},
        },

wateringParticleEffects

Particle effects the plant produces while being watered.

  • enable = If set to 'true' enables the particle effect.

  • dict = Determines the particle effect dictionary, A list of available dicts and anims can be found here (https://vespura.com/fivem/particle-list/).

  • anim = Determines the effect to be played, A list of available dicts and anims can be found here (https://vespura.com/fivem/particle-list/).

  • scale = Determines the effect scale.

  • offset = Determines the where to play the effect relative to the plant.

  • alpha = Determines the alpha of the effect (transparency).

        wateringParticleEffects = {                             
            [1] = { 
                enable = true, 
                dict = 'core',
                effect = 'ent_amb_water_drips_lg', 
                scale = 1.0, 
                offset = {x = 0.0, y = 0.0, z = 0.0}, 
                alpha = 100 },
        },

ambientWeedGrowth

Determines the amount of weeds the plant gains as time goes on.

  • enable = if 'true' the plant gains weeds level over time.

  • min = Determines the minimum amount weeds the plant gains every tick (1 minute).

  • max = Determines the maximum amount weeds the plant gains every tick (1 minute).

  • removePlantWhen100 = Determines if the plant gets removed when the weed level hits 100.

        ambientWeedGrowth = {                                   
            enable = true,                                      
            min = 1.0,                                          
            max = 1.0,                                          
            removePlantWhen100 = true                           
        },

weeding

Determines the options the player can use to remove weeds from this plant.

  • label = Determines the name of the item in the menu.

  • itemName = The item name the player needs when attempting to weed the plant with this option.

  • minAmount = Determines the minimum amount of weeds this option removes to the plant.

  • maxAmount = Determines the maximum amount of weeds this option removes to the plant.

  • time = Determines how long the progress bar takes when using this option.

  • remove = If set to 'true' this item is removed when the player choses this option.

  • icon = Determines the icon used in the menu, you can find more icons here (https://fontawesome.com/search?m=free&o=r).

        weeding = {                                             
            {
                label = "Weed Killer", 
                itemName = "weedkiller", 
                minAmount = 10, 
                maxAmount = 20, 
                time = 1500, 
                remove = true, 
                icon = 'biohazard'
            },
            {label = "Trowel", itemName = "trowel", minAmount = 10, maxAmount = 20, time = 3000, remove = false, icon = "trowel"},
        },

weedingParticleEffects

Particle effects the plant produces while weeds are being removed.

  • enable = If set to 'true' enables the particle effect.

  • dict = Determines the particle effect dictionary, A list of available dicts and anims can be found here (https://vespura.com/fivem/particle-list/).

  • anim = Determines the effect to be played, A list of available dicts and anims can be found here (https://vespura.com/fivem/particle-list/).

  • scale = Determines the effect scale.

  • offset = Determines the where to play the effect relative to the plant.

  • alpha = Determines the alpha of the effect (transparency).

        weedingParticleEffects = {                              
            [1] = {
                enable = true, 
                dict = 'core', 
                effect = 'ent_dst_plant_leaves', 
                scale = 0.7, 
                offset = {x = 0.0, y = 0.0, z = -0.5}, 
                alpha = 100},
            [2] = {enable = true, dict = 'core', effect = 'ent_anim_gardener_plant', scale = 1.0, offset = {x = 0.0, y = 0.0, z = 0.0}, alpha = 100},
        },

health

Options for this plant related to it's health.

  • lowWaterHealthDecay

    • enable = If set to 'true' the plant loses health when the water level is at or below the defined amount.

    • waterValue = Determines the water level needed for the plant to start losing health.

    • amountMin = Determines the minimum amount of health the plant will lose every tick (1 minute).

    • amountMax = Determines the minimum amount of health the plant will lose every tick (1 minute).

  • highWeedHealthDecay

    • enable = If set to 'true' the plant loses health when the weed level is at or above the defined amount.

    • weedValue = Determines the weed level needed for the plant to start losing health.

    • amountMin = Determines the minimum amount of health the plant will lose every tick (1 minute).

    • amountMax = Determines the maximum amount of health the plant will lose every tick (1 minute).

  • goodStatusHealthRise

    • enable = If set to 'true' the plant gains health when the water and weed levels are at or above their defined amounts.

    • waterValue = Determines the water level needed for the plant to start gaining health.

    • weedValue = Determines the weed level needed for the plant to start gaining health.

    • amountMin = Determines the minimum amount of health the plant will gain every tick (1 minute).

    • amountMax = Determines the maximum amount of health the plant will gain every tick (1 minute).

  • removePlantWhen0 = If set to 'true' the plant will be removed when it's health reaches 0.

        health = {                                              
            lowWaterHealthDecay = { 
                enable = true, 
                waterValue = 25, 
                amountMin = 1.0, 
                amountMax = 1.0, 
            },
            highWeedHealthDecay = { 
                enable = true, 
                weedValue = 75, 
                amountMin = 1.0, 
                amountMax = 1.0, 
            },
            goodStatusHealthRise = { 
                enable = true, 
                waterValue = 85, 
                weedValue = 10, 
                amountMin = 1.0, 
                amountMax = 1.0, 
            },
            removePlantWhen0 = true                             
        },

Config.Zones

Only poly zones can be used for the growing zones, for more information, see here (https://overextended.github.io/docs/ox_lib/Zones/Client#libzonespoly).

Enabling debug for zones may result in high resource usage.

debugAllZones

If set to 'true' all zones will have the debug markers.

debugAllZones = false,

zones

We recommend using the zone creation tool built into ox_lib, more information can be found here (https://overextended.github.io/docs/ox_lib/Zones/Client#zone-creation-script).

Determines the zones

  • name = Determines the name of the zone, this is what should be used when telling where a plant can be planted.

  • debug = If set to 'true' markers will be drawn at the boundary of this zone

  • points = Determines the outline points of the zone.

  • thickness = Determines the height of the zone.

    zones ={                          
        { 
            name = "Farm_Grapeseed_1",
            debug = false,            
            points = {                
                vec3(2553.5700683594, 4330.7998046875, 37.0), 
                vec3(2534.919921875, 4323.4301757812, 37.0), 
                vec3(2521.8500976562, 4323.4702148438, 37.0), 
                vec3(2481.8898925781, 4333.419921875, 37.0), 
                vec3(2482.0700683594, 4340.8798828125, 37.0), 
                vec3(2510.8898925781, 4406.9301757812, 37.0), 
                vec3(2517.0, 4402.0, 37.0), 
                vec3(2521.0, 4407.0, 37.0), 
                vec3(2575.0, 4353.0, 37.0), 
                vec3(2573.8701171875, 4345.9501953125, 37.0), 
            }, 
            thickness = 18.0          
        },

Last updated