Skip to content

Epip

The Epip table mainly serves as a container for Features. It contains methods to register Features as well as libraries and UI tables.

Use RegisterFeature() to register and initialize a Feature.

Epip Class

Events and Hooks

BeforeFeatureInitialization (event)

Fired during feature initialization.

@field Feature Feature

AfterFeatureInitialization (event)

Fired during feature initialization.

@field Feature Feature

Methods

GetFeature
function Epip.GetFeature(modTable, id, required)
   -> Feature|`T`

@param modTable string

@param id `T`

@param required boolean? If `true`, an error will be thrown if the feature could not be fetched.

GetFeature
function Epip.GetFeature(id)
   -> Feature|`T`

Overload for fetching features defined in EpipEncounters.

@param id `T`

ImportGlobals
function Epip.ImportGlobals(tbl)

Copies Epip's globals into a table.

Intended usage is to copy into another mod's _ENV.

@param tbl table

InitializeFeature
function Epip.InitializeFeature(modTable, id, feature)

TODO move to Feature

@param modTable string

@param id string

@param feature Feature

InitializeLibrary
function Epip.InitializeLibrary()
IsDeveloperMode
function Epip.IsDeveloperMode(requirePipPoem)
   -> boolean

Returns whether developer mode is enabled.

@param requirePipPoem boolean? Whether a poem to Pip is required for `true` to be returned. Defaults to `false`, which checks for Extender developer mode instead.

IsPipFork
function Epip.IsPipFork()

Returns whether the game is using Pip's Script Extender fork.

RegisterFeature
function Epip.RegisterFeature(modTable, id, feature)

Registers a feature, initializing its utility metatable and exposing it to other mods via GetFeature(). Should be called outside of any listener, as soon as the table is defined. This will also check for required path overrides and disable the feature if the required mods are not enabled.

@param modTable string

@param id string

@param feature Feature

RegisterFeatureInitializationListener
function Epip.RegisterFeatureInitializationListener(modTable, featureID, timing, listener)

Registers a FeatureInitialization listener for a specific feature.

@param modTable modtable

@param featureID string

@param timing "Before"|"After"

@param listener fun(ev:Epip.Events.FeatureInitialization)

SaveDump
function Epip.SaveDump(obj, opts, fileName)

@param obj any

@param opts any?

@param fileName string?

ShutUp
function Epip.ShutUp(modTable)

Silences logging from all features of a mod.

@param modTable modtable? Defaults to `"EpipEncounters"`