Configuration

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

If you would like to use the benches used in the preview video, head to our discord and look for the snippets channel of that script.

Variables that are marked as (Optional) do not need to be set (but can be in the case of further customization). In the instances where (Optional) variables are related to "counts" the default value is always 1

Config

Config = {
    language = "en",                
    debug = false,                
    enhancedDebug = false,        
    interactionMethod = "target", 
    interactionDistance = 2,      
    target = "ox_target",         
    inventory = "ox_inventory",   
    canPlaceBenchInWater = false, 
    canPlaceBenchOnRoad = false,  
}

language

Language sets which Locale to use, you can find available locales in [gfg_crafting/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 be 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 bench. Currently supported options are: "target", "textui", "3dtext".

interactionMethod = "target",

interactionDistance

Determines the distance from the bench 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

Determines wich inventory resource to use.

Currently supported options are:

  • "ox_inventory"

  • "qb_inventory"

inventory = "ox_inventory",

canBenchTableInWater

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 bench while in or under water.

canPlaceBenchInWater = false

canPlaceBenchOnRoad

May or may not work on all roads.

Determines if the player can place a bench on a road

canPlaceBenchOnRoad = false,

Config.Bench

This is the configuration section for when the player is placing, and packing a bench.

Config.Bench = {
    animation = {                                             
        dict = "amb@world_human_gardener_plant@male@idle_a",
        anim = "idle_b",                                    
    },
    skillcheck = {                                          
        enable = false,                                     
        difficulty = {'easy', 'easy', 'easy', 'medium'},    
        keys = {'e'},                                       
    },
    getItemOnFailedPack = true,                             
    durabilityLossOnFailedPack = true,                      
    durabilityLossOnFailedPackAmount = {                    
        min = 10,
        max = 25,
    },
    progressBar = {                                         
        time = 1000,                                        
    },
    propRotateSpeed = 1.0,                                  
    placementKeys = {                                       
        place = 22,                                         
        cancel = 47,                                        
        rotateRight = 175,                                  
        rotatLeft = 174,                                    
        rotateSpeed = 1.0                                   
    }
}

animation

Animation that plays during placing and packing, a list of available animations can be found here (https://alexguirre.github.io/animations-list/).

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

  • anim = Animation that's is used within the dictionary determined, in the list given above, it would be the smaller text.

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

skillCheck

Skill Check that is used when the player attempts to place or pack the bench.

  • 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).

skillcheck = {                                          
    enable = false,                                     
    difficulty = {'easy', 'easy', 'easy', 'medium'},    
    keys = {'e'},                                       
},

getItemOnFailedPack

If 'true' the player will succeed with the place/pack of the bench regardless of the result of the skill check. If 'false' the bench will remain if the player fails the skill check.

getItemOnFailedPack = true, 

durabilityLossOnFailedPack

If 'true' the bench will experience random durability loss when the player fails the place/pack skill check.

durabilityLossOnFailedPack = true,

durabilityLossOnFailedPackAmount

Durability Loss can be a float! (00.01 = 100.00)

Determines the amount of durability the bench loses when the player fails the place/pack skill check. If you want it to be a static value set the 'min' and 'max' to the same number.

durabilityLossOnFailedPackAmount = {                    
    min = 1,
    max = 5,
},

progressBar

Progress Bar that is used when the player is placing or packing the bench.

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

progressBar = {                                         
    time = 1000,                                        
},

propRotateSpeed

Determines how fast the preview prop spins in the bench menu.

propRotateSpeed = 1.0,

placementKeys

Determines the keys used when placing a bench.

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

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

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

  • rotateLeft = This key is used to rotate the bench left (Default: Arrow Left).

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

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

Config.Defaults

This is the configuration section for the default values.

Config.Defaults = {
    icon = 'screwdriver-wrench',                        
    animation = {                                       
        dict = "missmechanic",                          
        anim = "work2_base",                            
        prop = 'gr_prop_gr_sdriver_01',                 
        bone = 60309,                                   
        offset = {                                      
            pos = vec3(0.0, 0.03, 0.0),                 
            rot = vec3(100.0, 0.0, 0.0)                 
        }
    },
    progressBarTime = 60,                               
    skillCheck = {                                      
        difficulty = {'easy', 'medium', 'medium'},      
        keys = {'e'}                                    
    },
    durabilityLossOnFailedAssembley = {                 
        minAmount = 10.0,                               
        maxAmount = 20.0,                               
    },
    durabilityLossOnCompletedAssembley = {              
        minAmount = 1.0,                                
        maxAmount = 5.0,                                
    },
    durabilityLossOnFailedRepair = {                    
        minAmount = 2.0,                                
        maxAmount = 10.0,                               
    },
    showAllCraftingOptions = true,                      
    showAllRepairOptions = true,                        
    showItemsNeeded = true,                             
    returnItemsOnFail = true,  
    repairOptions = {                                   
        {
            label = "DIY Repair",                       
            items = {                                   
                {label = "Screwdriver", name = "screwdriver"},  
                {label = "Hammer", name = "hammer"}, 
                {label = "Blowtorch", name = "blowtorch"},
                {label = "Wrench", name = "wrench"},
                {label = "Pliers", name = "pliers"},
                {
                    label = "Nails",                    
                    name = "nails",                     
                    count = 5                           
                },
                {label = "Wood", name = "wood", count = 5}
            }, 
            minAmount = 5,                              
            maxAmount = 10,                             
            skillCheck = {                              
                difficulty = {'easy', 'medium', 'hard'},
                keys = {'e'}                            
            }, 
            time = 120,                                 
            icon = 'toolbox'                            
        },
        { 
            label = "Bench Repair Kit", 
            items = { 
                {label = "Bench Repair Kit", name = 'benchrepairkit'}, 
            }, 
            minAmount = 10,
            maxAmount = 20, 
            skillCheck = { difficulty = {'easy', 'easy', 'easy'}, keys = {'e'} },
            time = 60, 
            icon = 'toolbox' 
        }
    },                         
}

icon

Determines the default icon for assembly.

icon = 'screwdriver-wrench',

animation

Determines the default animation.

A list of available animations can be found here (https://alexguirre.github.io/animations-list/).

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

  • anim = Animation that's is used within the dictionary determined, in the list given above, it would be the smaller text.

  • prop = Determines the prop that is created when using this animation.

  • bone = Determines the ped bone to attach the prop to.

  • offset = Determines the prop offset relative to the ped bone selected.

    • pos = Position offset.

    • rot = Rotation offset.

animation = {                                       
    dict = "missmechanic",                          
    anim = "work2_base",                            
    prop = 'gr_prop_gr_sdriver_01',                 
    bone = 60309,                                   
    offset = {                                      
        pos = vec3(0.0, 0.03, 0.0),                 
        rot = vec3(100.0, 0.0, 0.0)                 
    }
},

progressBarTime

Determines the default progress bar timer (In Seconds)

progressBarTime = 60,

skillCheck

Determines the default skillcheck.

skillCheck = {                                      
    difficulty = {'easy', 'medium', 'medium'},      
    keys = {'e'}                                    
},

durabilityLossOnFailedAssembley

Determines the default amount of durability the bench loses when the player fails assembling an item.

  • minAmount = Minimum Amount.

  • maxAmount = Maximum Amount.

durabilityLossOnFailedAssembley = {                 
    minAmount = 10.0,                               
    maxAmount = 20.0,                               
},

durabilityLossOnCompletedAssembley

Determines the default amount of durability the bench loses when the player assembles an item.

  • minAmount = Minimum Amount.

  • maxAmount = Maximum Amount.

durabilityLossOnCompletedAssembley = {              
    minAmount = 1.0,                                
    maxAmount = 5.0,                                
},

durabilityLossOnFailedRepair

Determines the default amount of durability the bench loses when the player fails repairing.

  • minAmount = Minimum Amount.

  • maxAmount = Maximum Amount.

durabilityLossOnFailedRepair = {                    
    minAmount = 2.0,                                
    maxAmount = 10.0,                               
},

showAllCraftingOptions

If 'true' shows all crafting options when viewing a bench. Otherwise, only shows items the player can assemble based on what they have in their inventory.

showAllCraftingOptions = true,

showAllRepairOptions

If 'true' shows all repair options for that bench. Otherwise, only shows repair options the player can use based on what they have in their inventory.

showAllRepairOptions = true,

showItemsNeeded

If 'true' shows the items needed when hovering over the item in the crafting menu.

showItemsNeeded = true,

returnItemsOnFail

If 'true' returns the items needed to a player when they fail crafting.

returnItemsOnFail = true,

repairOptions

Determines the default repair options.

  • label = Determines the label of the repair option in the menu.

  • items = Determines the items needed for this repair option.

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

    • name = The item name within your inventory resource.

    • count = (Optional) Determines the amount the player needs.

  • minAmount = Determines the minimum amount this option will repair a crafting bench.

  • maxAmount = Determines the maximum amount this option will repair a crafting bench.

  • skillCheck = Determines the skillcheck for this repair option.

  • time = Determines how long this repair option takes to complete.

  • icon = Determines the icon for this repair option in the menu.

repairOptions = {                                   
    {
        label = "DIY Repair",                       
        items = {                                   
            {label = "Screwdriver", name = "screwdriver"},  
            {label = "Hammer", name = "hammer"}, 
            {label = "Blowtorch", name = "blowtorch"},
            {label = "Wrench", name = "wrench"},
            {label = "Pliers", name = "pliers"},
            {label = "Nails", name = "nails", count = 5},
            {label = "Wood", name = "wood", count = 5}
        }, 
        minAmount = 5,                              
        maxAmount = 10,                             
        skillCheck = {                              
            difficulty = {'easy', 'medium', 'hard'},
            keys = {'e'}                            
        }, 
        time = 120,                                 
        icon = 'toolbox'                            
    },
},   

Config.DefaultSkillchecks

Determines the commonly used skillchecks for easy reference. can be used by setting 'skillcheck = Config.DefaultSkillchecks.easy' for example.

Config.DefaultSkillchecks = {                   
    easy = {
        difficulty = {'easy', 'easy', 'easy'},
        keys = {'e'}                          
    },
    medium = {
        difficulty = {'easy', 'medium', 'medium'}, 
        keys = {'e'} 
    },
    hard = {
        difficulty = {'medium', 'medium', 'hard'}, 
        keys = {'e'} 
    },
    godmode = {
        difficulty = {'hard', 'hard', 'hard'}, 
        keys = {'d', 'a', 'v', 'e'} 
    },
}

Each default skillcheck can have an entry in this table.

easy = {
    difficulty = {'easy', 'easy', 'easy'},
    keys = {'e'}                          
},

Config.DefaultAnimations

Determines the commonly used animations for easy reference. can be used by setting 'animation = Config.DefaultAnimations.screwing' for example.

Config.DefaultAnimations = {                      
    screwing = Config.Defaults.animation,         
    drilling = { dict = "anim@heists@fleeca_bank@drilling", anim = "drill_straight_idle", prop = 'prop_tool_drill', bone = 28422, offset = { pos = vec3(0.0, 0.035, 0.05), rot = vec3(0.0, 0.0, 90.0) }, },
    welding = { scenario = "WORLD_HUMAN_WELDING" },
    hammering = { scenario = "WORLD_HUMAN_HAMMERING" },
    wrenching = { dict = "missmechanic", anim = "work2_base", prop = 'xs_prop_arena_torque_wrench_01a', bone = 60309, offset = { pos = vec3(0.0, 0.0, 0.08), rot = vec3(0.0, 180.0, 180.0) } },
    grilling = { scenario = "PROP_HUMAN_BBQ" },
}

Each default animation can have an entry in this table.

This one for example uses the default animation set in 'Config.Defaults'.

screwing = Config.Defaults.animation,

Each default animation can have an entry in this table.

A list of available animations can be found here (https://alexguirre.github.io/animations-list/).

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

  • anim = Animation that's is used within the dictionary determined, in the list given above, it would be the smaller text.

  • prop = Determines the prop that is created when using this animation.

  • bone = Determines the ped bone to attach the prop to.

  • offset = Determines the prop offset relative to the ped bone selected.

    • pos = Position offset.

    • rot = Rotation offset.

drilling = { 
    dict = "anim@heists@fleeca_bank@drilling", 
    anim = "drill_straight_idle", 
    prop = 'prop_tool_drill', 
    bone = 28422, 
    offset = { 
        pos = vec3(0.0, 0.035, 0.05), 
        rot = vec3(0.0, 0.0, 90.0) 
    }, 
},

Each default animation can have an entry in this table.

Scenarios can also be used in place of an animation. A list of available scenarios can be found here (https://github.com/DioneB/gtav-scenarios).

welding = { scenario = "WORLD_HUMAN_WELDING" },

Config.StaticBenches

This is a list of static crafting benches, these are saved in the database but do not have a prop associated with them and cannot be packed up or moved.

Static Benches are based on box zones, since you already have ox_lib installed you have a tool to create them with ease, simply run the zone creation tool for a box zone (/zone box). More information on how this tool works can be found here (https://overextended.github.io/docs/ox_lib/Zones/Shared#zone-creation-script)

Config.StaticBenches = {                                       
    michaelGrill = {                                         
        label = "Michael's Grill",                           
        type = 'showcasegrill',                              
        coords = vec3(-800.21, 187.64, 72.7),                
        size = vec3(1.8, 0.65000000000001, 0.30000000000001),
        rotation = 22.0,                                     
        camera = {                                           
            forwardOffset = -0.9,                            
            offset = vec3(0.0, 0.0, 0.5),                    
            entityAngleOffset = vec3(0.0, 1.0, -0.5),        
            transitionTime = 1000,                           
            propForwardOffset = -0.2,                        
            propOffset = vec3(0.0, 0.0, 1.0),                
            propHeading = 0                                  
        }
    },
}

Each static bench can have an entry in this table.

The key is the internal name of the static bench (what would be seen in the database) and needs to be unique.

  • label = This is the label of the static bench that is used in menu's and does not need to be unique.

  • type = Determines the bench options to use based on type, needs to match the 'type' of one of the benches in 'Config.Benches'.

  • coords = The coordinates of the box.

  • size = The size of the box (length, width, height).

  • rotation = The rotation of the box.

  • camera = Determines the camera settings of static bench. All static benches use a "Faux Prop" to point the camera at even though it will never be seen.

    • forwardOffset = Determines how far off the front of the bench to set the camera. (Should always be negative as positive will put you on the other side of the bench).

    • offset = Determines the positional offset of the camera (In this example the 'Z' value is 0.5, wich means the camera will be 0.5 higher than usual).

    • entityAngleOffset = Determines the rotational offset of the camera (In this example the 'Z' value is -0.5, wich means the camera will be pointed 0.5 lower than usual).

    • transitionTime = Determines the time it takes for the camera to transition.

    • propForwardOffset = Determines how far off the front of the bench to set the preview prop.

    • propOffset = Determines the preview prop offset relative to the box zone coords.

    • propHeading = Determines the preview prop heading.

michaelGrill = {                                         
    label = "Michael's Grill",                           
    type = 'showcasegrill',                              
    coords = vec3(-800.21, 187.64, 72.7),                
    size = vec3(1.8, 0.65000000000001, 0.30000000000001),
    rotation = 22.0,                                     
    camera = {                                           
        forwardOffset = -0.9,                            
        offset = vec3(0.0, 0.0, 0.5),                    
        entityAngleOffset = vec3(0.0, 1.0, -0.5),        
        transitionTime = 1000,                           
        propForwardOffset = -0.2,                        
        propOffset = vec3(0.0, 0.0, 1.0),                
        propHeading = 0                                  
    }
},

Config.Benches

This is the configuration section for benches.

Config.Benches = {
    showcase = {
        name = "Showcase",
        type = "showcase",
        benchNoun = "Bench",                                   
        assembleVerb = "Assemble",
        benchItem = "showcasebench",
        prop = "gr_prop_gr_bench_04b",
        camera = {
            forwardOffset = -0.9,
            offset = vec3(0.0, 0.0, 1.25),
            entityAngleOffset = vec3(0.0, 1.0, 0.5),
            transitionTime = 1000,
            propForwardOffset = -0.2,
            propOffset = vec3(0.0, 0.0, 1.0),
            propHeading = 0
        },
        steps = {                                              
            { 
                label = "Screwing"                             
            
            },
            { 
                label = "Drilling",                            
                animation = Config.DefaultAnimations.drilling ,
                time = 30,                                     
                skillCheck = Config.DefaultSkillchecks.medium, 
            },
            { label = "Welding", animation = Config.DefaultAnimations.welding , time = 30, skillCheck = Config.DefaultSkillchecks.medium,},
            { label = "Hamering", animation = Config.DefaultAnimations.hammering , time = 30, skillCheck = Config.DefaultSkillchecks.medium,},
            { label = "Wrench", animation = Config.DefaultAnimations.wrenching , time = 10, skillCheck = Config.DefaultSkillchecks.medium,},
        },
        itemsNeeded = {                                        
            {
                name = "neededitem1",                          
                label = "Needed Item 1",                       
                count = 2,                                     
            },
            {name = "neededitem2", label = "Needed Item 2"},
        },
        durabilityLossOnFailedAssembley = {                    
            minAmount = 5.0,    
            maxAmount = 10.0, 
        },
        durabilityLossOnCompletedAssembley = {                 
            minAmount = 1.0,
            maxAmount = 5.0, 
        },
        durabilityLossOnFailedRepair = {                       
            minAmount = 2.0,
            maxAmount = 10.0, 
        },
        craftableItems = {                                     
            ["Category 1"] = {                                 
                { 
                    rewardedItem = {                           
                        label = "Crafted Item 1",              
                        name = 'crafteditem1',                 
                        count = 2                              
                    }, 
                    prop = {model = 'v_ind_cs_toolbox3'},
                    itemsNeeded = {                            
                        {name = "neededitem1", label = "Needed Item 1"},
                        {name = "neededitem2", label = "Needed Item 2"},
                        {name = "neededitem3", label = "Needed Item 3", count = 3},
                    },
                    steps = {                                  
                        { label = "Screwing"},
                        { label = "Drilling", time = 30, animation = Config.DefaultAnimations.drilling, skillCheck = Config.DefaultSkillchecks.medium },
                        { label = "Welding", animation = Config.DefaultAnimations.welding },
                        { label = "Hamering", animation = Config.DefaultAnimations.hammering },
                    },
                }
            },
            ["Category 2"] = {
                {                                              
                    rewardedItem = { label = "Crafted Item 2", name = 'crafteditem2' },
                    prop = {model = 'v_ind_cs_toolbox3'},
                },
            }
        },
        repairOptions = {                                      
            {
                label = "DIY Repair", 
                items = {
                    {label = "Screwdriver", name = "screwdriver"},
                    {label = "Hammer", name = "hammer"}, 
                    {label = "Blowtorch", name = "blowtorch"},
                    {label = "Wrench", name = "wrench"},
                    {label = "Pliers", name = "pliers"},
                    {label = "Nails", name = "nails", count = 5},
                    {label = "Wood", name = "wood", count = 5}
                }, 
                minAmount = 5,
                maxAmount = 10,
                skillCheck = {
                    difficulty = {'easy', 'medium', 'hard'},
                    keys = {'e'}
                }, 
                time = 120,
                icon = 'toolbox'
            },
        }
    },
}

The key of each bench is the internal name of the bench, needs to be unique.

name

The name of the bench type used in menu's.

name = "Showcase",

type

The type of the bench, needs to match the internal name of the bench set above.

type = "showcase",

benchNoun

The noun describing the bench, mainly used in menu's.

benchNoun = "Bench",

assembleVerb

The verb describing action on the bench, mainly used in menu's.

assembleVerb = "Assemble",

benchItem

The item used to place this type of bench.

benchItem = "showcasebench",

prop

The prop that represents this bench type.

prop = "gr_prop_gr_bench_04b",

camera

Determines the camera settings of static bench. All static benches use a "Faux Prop" to point the camera at even though it will never be seen.

  • forwardOffset = Determines how far off the front of the bench to set the camera. (Should always be negative as positive will put you on the other side of the bench).

  • offset = Determines the positional offset of the camera (In this example the 'Z' value is 0.5, wich means the camera will be 0.5 higher than usual).

  • entityAngleOffset = Determines the rotational offset of the camera (In this example the 'Z' value is -0.5, wich means the camera will be pointed 0.5 lower than usual).

  • transitionTime = Determines the time it takes for the camera to transition.

  • propForwardOffset = Determines how far off the front of the bench to set the preview prop.

  • propOffset = Determines the preview prop offset relative to the box zone coords.

  • propHeading = Determines the preview prop heading.

camera = {
    forwardOffset = -0.9,
    offset = vec3(0.0, 0.0, 1.25),
    entityAngleOffset = vec3(0.0, 1.0, 0.5),
    transitionTime = 1000,
    propForwardOffset = -0.2,
    propOffset = vec3(0.0, 0.0, 1.0),
    propHeading = 0
},

steps

Animations and SkillChecks can be set here with their full variables (as done in Config.Defaults) or by referencing one the default options.

Determines the default steps for this bench type that are used if a specific item's steps are omitted. (If you wish to not use these then set steps = { {label = "NULL"}, }, ).

  • label = The label of the step, used in menu's.

  • animation = (Optional) Determines the animation to be used for this step (In this example it uses the animation defined in 'Config.DefaultAnimations.drilling').

  • time = (Optional) Determines the progress bar time for this step (In Seconds).

  • skillCheck = (Optional) Determines the skillcheck to be used for this step (In this example it uses the skillcheck defined in 'Config.DefaultSkillchecks.medium').

steps = {                                              
    { 
        label = "Drilling",                            
        animation = Config.DefaultAnimations.drilling ,
        time = 30,                                     
        skillCheck = Config.DefaultSkillchecks.medium, 
    },
},

itemsNeeded

Determines the default items needed for this bench type if a specific item's needed are omitted (If you wish to not use this then set itemsNeeded = { {label = "NULL"}, },)

  • name = The item name in your inventory resource.

  • label = The label of the item, used in menu's.

  • count = (Optional) The amount of the item that is needed.

itemsNeeded = {                                        
    {
        name = "neededitem1",                          
        label = "Needed Item 1",                       
        count = 2,                                     
    },
},

durabilityLossOnFailedAssembley

(Optional) Determines the amount of durability the bench loses when the player fails assembling an item.

durabilityLossOnFailedAssembley = {                    
    minAmount = 5.0,    
    maxAmount = 10.0, 
},

durabilityLossOnCompletedAssembley

(Optional) Determines the amount of durability the bench loses when the player assembles an item.

durabilityLossOnCompletedAssembley = {                 
    minAmount = 1.0,
    maxAmount = 5.0, 
},

durabilityLossOnFailedRepair

(Optional) Determines the amount of durability the bench loses when the player fails repairing.

durabilityLossOnFailedRepair = {                       
    minAmount = 2.0,
    maxAmount = 10.0, 
},

craftableItems

Determines the items that can be crafted at this bench type.

Items are sorted into "Categories" which can be named whatever you like, in this example we have "Category 1" and "Category 2".

Each craft able item in each category can have the following variables:

  • rewardedItem = Determines the item that is rewarded when crafted.

    • label = The label of the item, used in menu's.

    • name = The item name in your inventory resource.

    • count = (Optional)The amount of the item the player receives.

  • prop = The prop that is displayed when this item is selected.

  • itemsNeeded = (Optional) Determines the items needed to craft this item, if omitted, uses the bench's itemsNeeded.

  • steps = (Optional) Determines the items steps needed to craft, if omitted, uses the bench's steps. (Steps are completed in the order given in this list.)

craftableItems = {                                     
    ["Category 1"] = {                                 
        { 
            rewardedItem = {                           
                label = "Crafted Item 1",              
                name = 'crafteditem1',                 
                count = 2                              
            }, 
            prop = {model = 'v_ind_cs_toolbox3'},
            itemsNeeded = {                            
                {name = "neededitem1", label = "Needed Item 1"},
                {name = "neededitem2", label = "Needed Item 2"},
                {name = "neededitem3", label = "Needed Item 3", count = 3},
            },
            steps = {                                  
                { label = "Screwing"},
                { label = "Drilling", time = 30, animation = Config.DefaultAnimations.drilling, skillCheck = Config.DefaultSkillchecks.medium },
                { label = "Welding", animation = Config.DefaultAnimations.welding },
                { label = "Hamering", animation = Config.DefaultAnimations.hammering },
            }
        }
    },
    ["Category 2"] = {
        {                                              
            rewardedItem = { label = "Crafted Item 2", name = 'crafteditem2' },
            prop = {model = 'v_ind_cs_toolbox3'},
        },
    }
},

repairOptions

(Optional) Determines the repair options for this bench type, if omitted, uses the repair options defined in Config.Defaults.

repairOptions = {                                      
    {
        label = "DIY Repair", 
        items = {
            {label = "Screwdriver", name = "screwdriver"},
            {label = "Hammer", name = "hammer"}, 
            {label = "Blowtorch", name = "blowtorch"},
            {label = "Wrench", name = "wrench"},
            {label = "Pliers", name = "pliers"},
            {label = "Nails", name = "nails", count = 5},
            {label = "Wood", name = "wood", count = 5}
        }, 
        minAmount = 5,
        maxAmount = 10,
        skillCheck = {
            difficulty = {'easy', 'medium', 'hard'},
            keys = {'e'}
        }, 
        time = 120,
        icon = 'toolbox'
    },
}

Example Config

This is an example config to show you the layout, the values here are not meant for production.

Config = {
    language = "en",
    debug = false,
    enhancedDebug = false,                                      
    interactionMethod = "target",
    interactionDistance = 2,
    target = "ox_target",
    inventory = "ox_inventory",
    canPlaceBenchInWater = false,
    canPlaceBenchOnRoad = false,
}

Config.Bench = {
    animation = {
        dict = "amb@world_human_gardener_plant@male@idle_a",
        anim = "idle_b",
    },
    skillcheck = {
        enable = false,
        difficulty = {'easy', 'easy', 'easy', 'medium'},
        keys = {'e'},
    },
    getItemOnFailedPack = true,
    durabilityLossOnFailedPack = true,
    durabilityLossOnFailedPackAmount = {
        min = 10,
        max = 25,
    },
    progressBar = {
        time = 1000,
    },
    propRotateSpeed = 1.0,
    placementKeys = {
        place = 22,
        cancel = 47,
        rotateRight = 175,
        rotatLeft = 174,
        rotateSpeed = 1.0
    }
}

Config.Defaults = {
    icon = 'screwdriver-wrench',
    animation = {
        dict = "missmechanic",
        anim = "work2_base",
        prop = 'gr_prop_gr_sdriver_01',
        bone = 60309,
        offset = {
            pos = vec3(0.0, 0.03, 0.0),
            rot = vec3(100.0, 0.0, 0.0)
        }
    },
    progressBarTime = 60,
    skillCheck = {
        difficulty = {'easy', 'medium', 'medium'},
        keys = {'e'}
    },
    durabilityLossOnFailedAssembley = {
        minAmount = 10.0,
        maxAmount = 20.0,
    },
    durabilityLossOnCompletedAssembley = {
        minAmount = 1.0,
        maxAmount = 5.0,
    },
    durabilityLossOnFailedRepair = {
        minAmount = 2.0,
        maxAmount = 10.0,
    },
    showAllCraftingOptions = true,
    showAllRepairOptions = true,
    showItemsNeeded = true,
    returnItemsOnFail = true,
    repairOptions = {
        { label = "DIY Repair", items = { {label = "Screwdriver", name = "screwdriver"}, {label = "Hammer", name = "hammer"}, {label = "Blowtorch", name = "blowtorch"}, {label = "Wrench", name = "wrench"}, {label = "Pliers", name = "pliers"}, { label = "Nails", name = "nails", count = 5 }, {label = "Wood", name = "wood", count = 5} }, minAmount = 5, maxAmount = 10, skillCheck = { difficulty = {'easy', 'medium', 'hard'}, keys = {'e'} }, time = 120, icon = 'toolbox' },
        { label = "Bench Repair Kit", items = { {label = "Bench Repair Kit", name = 'benchrepairkit'}, }, minAmount = 10, maxAmount = 20, skillCheck = { difficulty = {'easy', 'easy', 'easy'}, keys = {'e'} }, time = 60, icon = 'toolbox' }
    },
}

Config.DefaultSkillchecks = {
    easy = { difficulty = {'easy', 'easy', 'easy'}, keys = {'e'} },
    medium = { difficulty = {'easy', 'medium', 'medium'}, keys = {'e'} },
    hard = { difficulty = {'medium', 'medium', 'hard'}, keys = {'e'} },
    godmode = { difficulty = {'hard', 'hard', 'hard'}, keys = {'d', 'a', 'v', 'e'} },
}

Config.DefaultAnimations = {
    screwing = Config.Defaults.animation,
    drilling = { dict = "anim@heists@fleeca_bank@drilling", anim = "drill_straight_idle", prop = 'prop_tool_drill', bone = 28422, offset = { pos = vec3(0.0, 0.035, 0.05), rot = vec3(0.0, 0.0, 90.0) }, },
    welding = { scenario = "WORLD_HUMAN_WELDING" },
    hammering = { scenario = "WORLD_HUMAN_HAMMERING" },
    wrenching = { dict = "missmechanic", anim = "work2_base", prop = 'xs_prop_arena_torque_wrench_01a', bone = 60309, offset = { pos = vec3(0.0, 0.0, 0.08), rot = vec3(0.0, 180.0, 180.0) } },
    grilling = { scenario = "PROP_HUMAN_BBQ" },
}

Config.StaticBenches = {                                        
    michaelGrill = {
        label = "Michael's Grill",
        type = 'showcasegrill',
        coords = vec3(-800.21, 187.64, 72.7),
        size = vec3(1.8, 0.65000000000001, 0.30000000000001),
        rotation = 22.0,
        camera = {
            forwardOffset = -0.9,
            offset = vec3(0.0, 0.0, 0.5),
            entityAngleOffset = vec3(0.0, 1.0, -0.5),
            transitionTime = 1000,
            propForwardOffset = -0.2,
            propOffset = vec3(0.0, 0.0, 1.0),
            propHeading = 0
        }
    },
    michaelCuttingBoard = {
        label = "Michael's Cutting Board",
        type = 'showcasecuttingboard',
        coords = vec3(-796.15, 185.85, 72.65),
        size = vec3(0.4, 0.55, 0.10000000000001),
        rotation = 16.25, 
        camera = {
            forwardOffset = -0.9,
            offset = vec3(0.0, 0.0, 0.5),
            entityAngleOffset = vec3(0.0, 1.0, -0.5),
            transitionTime = 1000,
            propForwardOffset = -0.2,
            propOffset = vec3(0.0, 0.0, 1.0),
            propHeading = 0
        }
    }
}

Config.Benches = {
    showcase = {
        name = "Showcase",
        type = "showcase",
        benchNoun = "Bench",
        assembleVerb = "Assemble",
        benchItem = "showcasebench",
        prop = "gr_prop_gr_bench_04b",
        camera = {
            forwardOffset = -0.9,
            offset = vec3(0.0, 0.0, 1.25),
            entityAngleOffset = vec3(0.0, 1.0, 0.5),
            transitionTime = 1000,
            propForwardOffset = -0.2,
            propOffset = vec3(0.0, 0.0, 1.0),
            propHeading = 0
        },
        steps = {
            { label = "Screwing"},
            { label = "Drilling", animation = Config.DefaultAnimations.drilling , time = 30, skillCheck = Config.DefaultSkillchecks.medium,},
            { label = "Welding", animation = Config.DefaultAnimations.welding , time = 30, skillCheck = Config.DefaultSkillchecks.medium,},
            { label = "Hamering", animation = Config.DefaultAnimations.hammering , time = 30, skillCheck = Config.DefaultSkillchecks.medium,},
            { label = "Wrench", animation = Config.DefaultAnimations.wrenching , time = 10, skillCheck = Config.DefaultSkillchecks.medium,},
        },
        itemsNeeded = {
            { name = "neededitem1", label = "Needed Item 1", count = 2,},
            {name = "neededitem2", label = "Needed Item 2"},
        },
        durabilityLossOnFailedAssembley = { minAmount = 5.0, maxAmount = 10.0, },
        durabilityLossOnCompletedAssembley = { minAmount = 1.0, maxAmount = 5.0, },
        durabilityLossOnFailedRepair = { minAmount = 2.0, maxAmount = 10.0, },
        craftableItems = {
            ["Category 1"] = {
                { 
                    rewardedItem = { label = "Crafted Item 1", name = 'crafteditem1', count = 2 }, 
                    itemsNeeded = { {name = "neededitem1", label = "Needed Item 1"}, {name = "neededitem2", label = "Needed Item 2"}, {name = "neededitem3", label = "Needed Item 3", count = 3}, },
                    steps = { { label = "Screwing"}, { label = "Drilling", time = 30, animation = Config.DefaultAnimations.drilling, skillCheck = Config.DefaultSkillchecks.medium }, { label = "Welding", animation = Config.DefaultAnimations.welding }, { label = "Hamering", animation = Config.DefaultAnimations.hammering }, }
                }
            },
            ["Category 2"] = {
                { rewardedItem = { label = "Crafted Item 2", name = 'crafteditem2' } },
            }
        },
        repairOptions = {
            {
                label = "DIY Repair", 
                items = {
                    {label = "Screwdriver", name = "screwdriver"},
                    {label = "Hammer", name = "hammer"}, 
                    {label = "Blowtorch", name = "blowtorch"},
                    {label = "Wrench", name = "wrench"},
                    {label = "Pliers", name = "pliers"},
                    {label = "Nails", name = "nails", count = 5},
                    {label = "Wood", name = "wood", count = 5}
                }, 
                minAmount = 5,
                maxAmount = 10,
                skillCheck = {
                    difficulty = {'easy', 'medium', 'hard'},
                    keys = {'e'}
                }, 
                time = 120,
                icon = 'toolbox'
            },
        }
    },
    showcasegrill = {
        name = "Showcase",
        type = "showcasegrill",
        benchNoun = "Grill",
        assembleVerb = "Cook",
        benchItem = "showcasegrill",
        prop = "prop_bbq_1",
        camera = {
            forwardOffset = -0.8,
            offset = vec3(0.0, 0.0, 1.69),
            entityAngleOffset = vec3(0.0, 1.0, 0.3),
            transitionTime = 1000,
            propForwardOffset = 0.0,
            propOffset = vec3(0.0, 0.0, 1.0),
            propHeading = 0
        },
        icon = 'fire-burner',
        steps = {
            { label = "Grilling", animation = Config.DefaultAnimations.grilling , time = 30, skillCheck = Config.DefaultSkillchecks.easy,},
        },
        itemsNeeded = {
            {name = "neededitem1", label = "Needed Item 1"},
            {name = "neededitem2", label = "Needed Item 2"},
        },
        craftableItems = {
            ["Food"] = {
                { rewardedItem = {label = "Burger", name = 'burger'}, prop = {model = 'prop_cs_burger_01'}, icon = 'burger'},
                { rewardedItem = {label = "Hotdog", name = 'hotdog'}, prop = {model = 'prop_cs_hotdog_01'}, icon = 'hotdog'},
                { rewardedItem = {label = "Steak", name = 'steak'}, prop = {model = 'prop_cs_steak'}},
                { rewardedItem = {label = "Stew", name = 'stewbowl'}, prop = {model = 'prop_cs_bowl_01b'}, icon = 'bowl-food'},
            }
        },
    },
    showcasecuttingboard = {
        name = "Showcase",
        type = "showcasecuttingboard",
        benchNoun = "Cutting Board",
        assembleVerb = "Chop",
        benchItem = "showcasecuttingboard",
        prop = "prop_cooker_03",
        camera = {
            forwardOffset = -0.8,
            offset = vec3(0.0, 0.0, 1.75),
            entityAngleOffset = vec3(0.0, 1.0, 0.0),
            transitionTime = 1000,
            propForwardOffset = 0.0,
            propOffset = vec3(0.0, 0.0, 1.0),
            propHeading = 0
        },
        icon = 'utensils',
        steps = {
            { label = "Choping", animation = Config.DefaultAnimations.grilling , time = 30, skillCheck = Config.DefaultSkillchecks.easy,},
        },
        itemsNeeded = {
            {name = "neededitem1", label = "Needed Item 1"},
            {name = "neededitem2", label = "Needed Item 2"},
        },
        durabilityLossOnFailedAssembley = {
            minAmount = 10.0,
            maxAmount = 20.0, 
        },
        durabilityLossOnCompletedAssembley = {
            minAmount = 1.0,
            maxAmount = 5.0, 
        },
        durabilityLossOnFailedRepair = {
            minAmount = 2.0,
            maxAmount = 10.0, 
        },
        craftableItems = {
            ["Food"] = {
                { rewardedItem = {label = "Burger", name = 'burger'}, prop = {model = 'prop_cs_burger_01'}, icon = 'burger'},
                { rewardedItem = {label = "Hotdog", name = 'hotdog'}, prop = {model = 'prop_cs_hotdog_01'}, icon = 'hotdog'},
                { rewardedItem = {label = "Steak", name = 'steak'}, prop = {model = 'prop_cs_steak'}},
                { rewardedItem = {label = "Stew", name = 'stewbowl'}, prop = {model = 'prop_cs_bowl_01b'}, icon = 'bowl-food'},
            }
        },
    },
}

Last updated