Character Creation

CLIENT SIDE ONLY

A light weight standalone selection of helper functions useful for creating anything where character creation can be used, multi-characters, clothing stores, tattoo shops etc.

Functions

get_clothing_and_prop_values

Gets clothing and prop values for UI inputs.

--- Utils object
local values = utils.character_creation.get_clothing_and_prop_values()
print('Clothing + Prop Values:', json.encode(values))

--- Direct export
local values = exports.boii_utils:get_clothing_and_prop_values()
print('Clothing + Prop Values:', json.encode(values))

set_ped_appearance

Sets ped appearance values for hair, makeup, genetics, clothing, tattoos, etc. This uses utils built in appearance data.

--- Utils object
local appearance = utils.shared.style['m']
utils.character_creation.set_ped_appearance(PlayerPedId(), appearance)

--- Direct export
local appearance = utils.shared.style['m']
exports.boii_utils:set_ped_appearance(PlayerPedId(), appearance)

update_ped_data

Updates utils.shared.style with new values to be displayed on player.

--- Specify sex
local sex = 'm'
--- Specify category
local category = 'genetics'
--- Specify id within category
local id = 'resemblance'
--- Define value to update to
local value = 75

--- Utils object
utils.character_creation.update_ped_data(sex, category, id, value)

--- Direct export
exports.boii_utils:update_ped_data(sex, category, id, value)

change_player_ped

Changes the players ped model based on selected sex.

--- Define sex
local sex = 'm' -- 'm' | 'f'

--- Utils object
utils.character_creation.change_player_ped(sex)

--- Direct export
exports.boii_utils:change_player_ped(sex)

rotate_ped

Rotates the current ped facing direction. Options: 'right', 'left', 'flip', 'reset'

--- Specify direction
local direction = 'left'

--- Utils object
utils.character_creation.rotate_ped(direction)

--- Direct export
exports.boii_utils:rotate_ped(direction)

load_character_model

Loads and applys appearence to character model.

--- Define character data
local data = {
    identity = {
        sex = 'm'
    },
    style = {
        genetics = {
            mother = 21,
            father = 12,
            resemblence = 0.7,
            ...
        },
        barber = {
            ...
        },
        clothing = {
            ...
        },
        tattoos = {
            torso = {
                ...
            }
        }
    }
}

--- Utils object
utils.character_creation.load_character_model(data)

--- Direct export
exports.boii_utils:load_character_model(data)

Last updated