Module Definitions
Module definition system for the Lilia framework.
Overview
The module system provides comprehensive functionality for defining modules within the Lilia framework. Modules represent self-contained systems that add specific functionality to the gamemode, each with unique properties, behaviors, and configuration options. The system supports both server-side logic for gameplay mechanics and client-side properties for user interface and experience. Modules are defined using the MODULE table structure, which includes properties for identification, metadata, dependencies, privileges, and configuration. The system includes callback methods that are automatically invoked during key module lifecycle events, enabling dynamic behavior and customization. Modules can have dependencies, privileges, network strings, and various configuration options, providing a flexible foundation for modular systems.
name
đ Purpose
Sets the display name of the module
đĄ Example Usage
author
đ Purpose
Sets the author of the module
đĄ Example Usage
discord
đ Purpose
Sets the Discord contact for the module author
đĄ Example Usage
desc
đ Purpose
Sets the description of the module
đĄ Example Usage
-- Set a detailed description of what the module does
MODULE.desc = "A comprehensive inventory management system"
version
đ Purpose
Sets the version number of the module
đĄ Example Usage
versionID
đ Purpose
Sets the unique version identifier for the module
đĄ Example Usage
uniqueID
đ Purpose
Unique identifier for the module (INTERNAL - set automatically when loaded)
â° When Called
Set automatically during module loading Note: This property is internal and should not be modified directly
đĄ Example Usage
-- This is set automatically when the module is loaded from its folder name
-- Module in folder "inventory" will have uniqueID = "inventory"
Privileges
đ Purpose
Sets the privileges required for this module
đĄ Example Usage
-- Define required privileges for module access
MODULE.Privileges = {
{ Name = "canManageInventory", Min = 1 }
}
Dependencies
đ Purpose
Sets the file dependencies for this module
đĄ Example Usage
-- Define required files for this module
MODULE.Dependencies = {
{ File = "gridinv.lua", Type = "shared" }
}
NetworkStrings
đ Purpose
Sets the network strings used by this module
đĄ Example Usage
-- Define network strings for client-server communication
MODULE.NetworkStrings = {"liaInventoryOpen", "liaInventorySync"}
WorkshopContent
đ Purpose
Sets the Workshop content IDs required by this module
đĄ Example Usage
-- Set required Workshop content (single ID or table of IDs)
MODULE.WorkshopContent = "1234567890"
MODULE.WorkshopContent = {"1234567890", "0987654321"}
WebSounds
đ Purpose
Sets the web-hosted sound files used by this module
đĄ Example Usage
-- Define web-hosted sound files for the module
MODULE.WebSounds = {
["sounds/beep.wav"] = "https://example.com/sounds/beep.wav"
}
WebImages
đ Purpose
Sets the web-hosted image files used by this module
đĄ Example Usage
-- Define web-hosted image files for the module
MODULE.WebImages = {
["icons/inventory.png"] = "https://example.com/icons/inventory.png"
}
enabled
đ Purpose
Sets whether the module is enabled by default
đĄ Example Usage
folder
đ Purpose
Sets the folder path for the module Internal Variable: This is set automatically by the module system ]]
path
đ Purpose
Sets the file path for the module Internal Variable: This is set automatically by the module system ]]
variable
đ Purpose
Sets the variable name for the module Internal Variable: This is set automatically by the module system ]]
loading
đ Purpose
Sets whether the module is currently loading Internal Variable: This is set automatically by the module system ]]
OnLoaded
đ Purpose
Called when the module is fully loaded
â° When Called
After all module files have been loaded and initialized
đ Realm
Shared
âŠī¸ Returns
- None
đĄ Example Usage
-- Called after all module files are loaded
function MODULE:OnLoaded()
print("Module loaded successfully!")
end