Custom framework

Running on your own framework, inventory or notifications, and patching single functions.

Obsi Lib can run on a framework or inventory it does not know, and you can replace a single function of a supported one. Both happen in the editable/ folder, so library updates never overwrite them.

A custom framework

  1. Switch to custom

    editable/shared/config.lua
    ObsiConfig.Framework = 'custom'
  2. Fill in the functions

    Write your functions into ObsiEditable.framework in editable/server/framework.lua and editable/client/framework.lua.

Patching one function

To change a single behaviour on a supported framework, put a function with the same name in ObsiEditable.frameworkPatch:

editable/server/framework.lua
ObsiEditable.frameworkPatch = {
    gender = function(src)
        return MyIdentity.getGender(src)
    end,
}

Everything else keeps using the detected framework.

A custom inventory

Inventories work the same way:

FrameworkInventory
ConfigObsiConfig.Framework = 'custom'ObsiConfig.Inventory = 'custom'
Full replacementObsiEditable.frameworkObsiEditable.inventory
Single-function patchObsiEditable.frameworkPatchObsiEditable.inventoryPatch

Returning nil from a custom inventory function falls back to the framework's own item functions. The stash hooks (registerStash, openStash, stashAdd, stashRemove, stashItems) are optional.

A custom notification system

Set ObsiConfig.Notify = 'custom' and write the backend in editable/server/notify.lua and editable/client/notify.lua.

Custom framework · Obsi Scripts