Installation

2 min readUpdated Today

Overview

ML Diary is a personal diary and encyclopedia system. Players carry a diary item, write personal notes with drawings, and unlock discoverable entries (fauna, flora, locations, items) through exploration and model interaction. In metadata mode the diary behaves as a transferable physical object, anyone holding it can read, write, and tear pages. In license mode the data is bound to the player's identifier and travels with them across diary items.

Quick Start

  1. Download from CFX Portal
  2. Extract to your resources folder as ml_diary
  3. Add to server.cfg:
server.cfg
1ensure oxmysql
2ensure ox_lib
3ensure ml_bridge
4ensure ml_diary
Load Order

ml_diary must start AFTER ml_bridge.

Database

The table is created automatically on first start:

diaries: Stores diary data per serial: owner identifier (audit only), discoveries (JSON), personal notes (JSON)

Schema is also available in _INSTALL/sql.sql if manual creation is preferred.

Item Registration

Item definitions for both ox_inventory and the QB-format are bundled in _INSTALL/items.lua. Copy the relevant block into your inventory's items file:

  • diary: The personal diary item (requires unique metadata, marked unique = true on QB-style inventories)
  • diary_page: Torn page item used to share single notes between diaries

Item names are configurable via Config.DiaryItemName and Config.TornPageItemName.

Image Assets

Place diary.png and diary_page.png in your inventory image folder (e.g. ox_inventory/web/images/).

Verify

After starting, the console will print:

lua
1[ml_diary] Resource started
2[ml_diary] Developed by Micio Mods | miciomods.it

Give yourself a diary with /giveitem <id> diary 1, use it from inventory, and the book UI should open.

  • Diary not opening. Verify the item exists in your inventory and has a serial in its metadata. In license mode no serial is required, the diary is keyed on the player identifier.
  • Discoveries not triggering. Confirm the discoverable's model hash matches a real entity, or that zone coords/radius/size are correct.
  • Notes not saving. Check the oxmysql connection. Auto-save runs every Config.SaveInterval minutes; onResourceStop flushes dirty diaries on shutdown.
  • Webhooks silent, server/config_server.lua ships with INSERT_WEBHOOK_LINK_HERE placeholders. The boot warning lists which keys are still unconfigured.