Skip to main content
A comprehensive character background selection system that allows players to choose their character’s past, providing unique starting conditions, skills, and equipment. Features include customizable backgrounds, perk integration, and immersive UI experience.
This script provides an immersive character creation experience with diverse background options, each offering unique starting conditions, skills, and equipment to shape your character’s journey.

Features

Diverse Backgrounds

Choose from multiple character backgrounds including Hunter, Herbalist, Veteran, and many more, each with unique starting conditions.

Customizable Starting Items

Each background provides specific starting items, weapons, and equipment relevant to the character’s profession and experience.

Perk Integration

Seamless integration with weapon progression systems, providing starting skill levels based on character background.

Immersive UI

Beautiful, immersive user interface with background images and detailed descriptions for each character option.

Custom Events

Support for custom server-side events and functions to handle background-specific logic and interactions.

Framework Integration

Compatible with VORP Core and RSG Core frameworks with modular framework bridge support.

Installation

1

Download

Get the latest release from our Tebex Store and download it from your Keymaster
2

Extract

Extract the script folder to your server’s resources directory
3

Configure

Add ensure [script-name] to your server.cfg
4

Customize

Configure the config.lua file to match your server’s background options

Configuration

The script is highly configurable through the config.lua file. Here are the main configuration sections:

Basic Settings

Config = {}

-- Debug mode
Config.debug = true

-- Event Handlers
Config.triggerEvent = "vorp:initNewCharacter" -- For RSG: "rsg-spawn:client:newplayer"
Config.afterSelectClientEvent = false -- Set to false if no event should be triggered after selection

Background Configuration

Each background is defined with UI settings, gameplay settings, and optional custom functions:
-- Background configurations with UI data
Config.Backgrounds = {
    hunter = {
        -- UI Settings
        label = "Hunter",
        description = "A skilled character, experienced in the art of hunting and survival in the wilderness.",
        image = "images/hunter.jpg",
        
        -- Gameplay Settings
        job = "hunter",
        perks = {
            { name = "hunting", amount = 5000 },
            { name = "gunslinger", amount = 2000 }
        },
        items = {
            { name = "WEAPON_BOW", isWeapon = true },
            { name = "ammoarrownormal", amount = 2 }
        },

        custom = function(source, charid, background)
            -- Custom code here to call custom events or do custom things (server side)
        end
    }
}

UI Settings

Configure the user interface appearance and behavior:
-- UI Settings
Config.UISettings = {
    -- Set to true to make the player invisible while the UI is open
    playerInvisible = true,
    
    -- UI Text (can be customized for different languages)
    text = {
        title = "Background Selection",
        description = "Select your background to define your character through his past and origin – a choice that significantly shapes your game start.",
        confirmationTitle = "Are you sure?",
        confirmationMessage = "This selection is final and cannot be changed.",
        confirmButton = "Confirm",
        cancelButton = "Cancel",
        selectButton = "Select"
    }
}

Background Types

The script includes a variety of pre-configured backgrounds:

Professional Backgrounds

A skilled character experienced in hunting and wilderness survival. Starts with hunting perks, bow, and arrows.
A wise healer familiar with nature’s remedies. Starts with herbalism perks and medical supplies.
A hardened miner experienced in extracting ores. Starts with mining perks and mining tools.
A strong lumberjack skilled with axes. Starts with lumber perks and logging equipment.
A hardworking farmer dedicated to crops and livestock. Starts with farming perks and agricultural tools.

Specialized Backgrounds

A trained healer with extensive medical knowledge. Starts with medical perks and healing supplies.
An experienced veteran with military training. Starts with gunslinger perks and military equipment.
An experienced horse expert. Starts with horse care items and a horse token.
A patient fisherman who knows the waters. Starts with fishing perks and fishing equipment.
A talented cook who can prepare delicious meals. Starts with cooking perks and culinary supplies.

Social Backgrounds

A wealthy heir accustomed to luxury. Starts with significant money and luxury items.
A cunning con artist who gets by with trickery. Starts with lockpicks and minimal money.
A penniless loner with bare essentials. Starts with minimal items and negative money.
An ordinary settler making their way in the West. Basic starting conditions.

Adding Custom Backgrounds

To add a new background, simply add a new entry to the Config.Backgrounds table:
-- Example: Adding a new background
my_new_background = {
    -- UI Settings
    label = "My New Background",          -- Name shown in UI
    description = "Description here...",  -- Description shown in UI
    image = "images/my_image.png",        -- Image path relative to html folder
    
    -- Gameplay Settings
    job = "myjob",
    money = 100,  -- Optional: starting money (can be negative)
    
    -- Optional: starting perks (compatible with weapon progression systems)
    perks = {     
        { name = "some_perk", amount = 1000 }
    },
    
    -- Optional: starting items
    items = {     
        { name = "some_item", amount = 5 },
        { name = "WEAPON_SOMETHING", isWeapon = true }
    },
    
    -- Optional: custom code (server side)
    custom = function(source, charid, background)
        -- Custom code here to call custom events or do custom things (server side)
    end
}

Background Configuration Options

UI Settings

-- Required UI settings for each background
label = "Background Name",           -- Display name in the UI
description = "Background description...", -- Detailed description
image = "images/background.jpg",     -- Image file path

Gameplay Settings

-- Core gameplay settings
job = "jobname",                     -- Starting job assignment
money = 100,                        -- Starting money (can be negative)

-- Optional perk configuration
perks = {
    { name = "perk_name", amount = 5000 }  -- Perk name and starting amount
},

-- Optional item configuration
items = {
    { name = "item_name", amount = 5 },                    -- Regular item
    { name = "WEAPON_NAME", isWeapon = true },             -- Weapon item
    { name = "item_name", amount = 1, metadata = {...} }   -- Item with metadata
}

Custom Functions

-- Optional custom server-side function
custom = function(source, charid, background)
    -- source: player source ID
    -- charid: character ID
    -- background: background configuration table
    
    -- Example: Trigger custom events
    TriggerEvent('my_custom_event', source, charid)
    
    -- Example: Call external functions
    exports['my_script']:doSomething(source, charid)
end

Item Configuration

Regular Items

items = {
    { name = "bandage", amount = 5 },
    { name = "compass", amount = 1 }
}

Weapon Items

items = {
    { name = "WEAPON_BOW", isWeapon = true },
    { name = "WEAPON_REVOLVER_NAVY", isWeapon = true }
}

Items with Metadata

items = {
    { 
        name = "horse_token", 
        amount = 1, 
        metadata = { 
            description = "American Paint Splashed White", 
            id = "A_C_Horse_AmericanPaint_SplashedWhite" 
        }
    }
}

Perk Integration

The script integrates with weapon progression systems:
-- Perk configuration example
perks = {
    { name = "hunting", amount = 5000 },      -- Hunting skill
    { name = "gunslinger", amount = 2000 },   -- Weapon proficiency
    { name = "herbalism", amount = 7600 },    -- Herbalism skill
    { name = "mining", amount = 5000 },       -- Mining skill
    { name = "farming", amount = 5000 },      -- Farming skill
    { name = "medic", amount = 5000 },        -- Medical skill
    { name = "fishing", amount = 5000 },      -- Fishing skill
    { name = "cooking", amount = 5000 },      -- Cooking skill
    { name = "blacksmithing", amount = 5000 }, -- Blacksmithing skill
    { name = "lumber", amount = 5000 }        -- Lumberjacking skill
}
Perk names and amounts should match your weapon progression system configuration.

Framework Integration

VORP Core

Config.triggerEvent = "vorp:initNewCharacter"

RSG Core

Config.triggerEvent = "rsg-spawn:client:newplayer"

Custom Framework

Config.triggerEvent = "your_custom_event"
Config.afterSelectClientEvent = "your_after_select_event"

Usage Examples

Professional Background Example

blacksmith = {
    label = "Blacksmith",
    description = "A skilled craftsman who forges weapons, tools, and horseshoes, essential to frontier life.",
    image = "images/blacksmith.jpg",

    job = "blacksmith",
    perks = {
        { name = "blacksmithing", amount = 5000 }
    },
    items = {
        { name = "hammer", amount = 1 },
        { name = "anvil", amount = 1 },
        { name = "iron_ore", amount = 10 }
    }
}

Social Background Example

outlaw = {
    label = "Outlaw",
    description = "A wanted criminal with a dark past, skilled in stealth and survival.",
    image = "images/outlaw.jpg",

    job = "outlaw",
    money = -50,  -- Negative starting money
    perks = {
        { name = "gunslinger", amount = 3000 },
        { name = "stealth", amount = 2000 }
    },
    items = {
        { name = "lockpick", amount = 10 },
        { name = "WEAPON_REVOLVER_NAVY", isWeapon = true },
        { name = "ammorevolvernormal", amount = 2 }
    },
    custom = function(source, charid, background)
        -- Set wanted level or trigger custom events
        TriggerEvent('outlaw:setWanted', source, 1)
    end
}

Performance Considerations

The script is optimized for performance with several key features:
  • Efficient UI Loading: Background images and data are loaded efficiently
  • Minimal Server Impact: Background selection is processed quickly
  • Configurable Events: Optional event triggering to reduce overhead
  • Debug Mode: Can be disabled in production for optimal performance

Performance Tips

  • Image Optimization: Use compressed images for background pictures
  • Background Count: Limit the number of backgrounds to essential options
  • Custom Functions: Keep custom functions lightweight and efficient
  • Debug Mode: Disable Config.debug in production

Troubleshooting

Verify the background is properly added to Config.Backgrounds, check that the image file exists in the correct path, and ensure the configuration syntax is correct.
Confirm item names match your inventory system, check that weapons are properly marked with isWeapon = true, and verify the framework integration is working correctly.
Ensure perk names match your weapon progression system, verify perk amounts are valid, and check that the progression system is properly integrated.
Check that the trigger event is properly configured for your framework, verify the script is started in server.cfg, and ensure there are no console errors.
Verify the custom function syntax is correct, check that the function parameters are properly used, and ensure the function doesn’t contain errors that prevent execution.

Framework Integration

The script includes built-in support for multiple frameworks:
-- Automatically detected when vorp_core is running
Config.triggerEvent = "vorp:initNewCharacter"
-- No additional configuration required

Limitations

Be aware of the following limitations when configuring the script:
  • Image Requirements: Background images must exist in the specified path
  • Item Compatibility: Items must be compatible with your inventory system
  • Perk Integration: Perk names must match your weapon progression system
  • Framework Events: Custom events must be properly configured for your framework

Support

If you encounter issues or need assistance:
I