Isolated packages
Every FORGE package runs in its own HELIXlua_State. There are no shared globals across
packages, forge-items cannot read a variable set by forge-combat. This keeps packages
independent and removable, but it means all cross-package communication is explicit.
There are exactly two ways packages interact:
Exports
Direct function calls. Synchronous, return a value. Use for queries and commands.
Events
Fire-and-forget broadcasts. Use to announce that something happened.
Exports
A package exposes functions by registering them, then others call them by package name.IsReady(), not just
forge-core:
Events
Events announce facts. The server-local bus is the common case:The Result contract
Every export that can fail returns a Result table, never a bare value or a raw error:r.ok and read r.data on success or r.code on failure. Codes are stable,
namespaced strings (namespace:reason). A handful of read-only helpers return plain booleans by
design (for example forge-equipment:HasEquippedTag), those are documented per package.
Stable IDs
Content is addressed by stable, namespaced ids:item:bandage, effect:well_fed,
attr:strength, recipe:bandage, coin. Ids are the contract between packages, a quest can
reward item:bandage without knowing anything else about it.
Persistence
Packages don’t write to the database ad hoc. They mark state dirty and letforge-core coordinate
saves (MarkDirty → flush → ReportSaved). Money is the deliberate exception: forge-economy
writes wallet changes through immediately in a single transaction, because dupe forensics need an
authoritative ledger.
Putting it together
A typical interaction, a player kills a training dummy, flows entirely through these channels:Combat resolves the hit
forge-combat applies damage, the target reaches 0 HP, and it fires
forge-combat:server:died.Content reacts
The creator’s content package subscribed to that event. It calls
exports["forge-loot"]:Grant(...) and exports["forge-progression"]:GainXP(...).Next: the content model
How FORGE ships neutral defaults you can keep, edit, or remove.