Wax

content

What content.lua defines.

The Explorer searches everything on this page, and the classes of the game too.

WaxContent

The game content a mod brings: models, textures, materials, sounds and blueprints made in the Unreal editor and packed into one file, content/<Id>.pak, in the mod's folder. Wax checks the file, hands it to the game before the mod's code runs, and the mod then loads from it by name. mod.Content is nil for a mod without that file. A changed pak is taken up without a restart when the mod reloads: the game lets go of the older copy and loads from the newer one. An asset the game still uses at that moment keeps its older look until the game is restarted, and State then says "restart".

Below, content stands for one of these.

Open in the Explorer

PropertyTypeDescription
State"ready" | "restart" | "off""ready": the content is there. "restart": it is there, and some assets still show an older copy until the game is restarted. "off": the game does not have it, and Reason says why.
Reasonstring?Why State is "off" or "restart". Nil when it is "ready".
Filesstring[]The files in the pak, such as "BP_Thing.uasset". A new list each time.

content:Path(name)

The game's path of an asset in this mod's content, as game.Assets:Load takes it. "Meshes/Rock" gives "/Game/Mods/<Id>/Meshes/Rock.Rock".

content:Path(name: string): string
ParameterTypeDescription
namestringThe asset's name, with its folders inside the mod's content when it has any.

Returns string

Open in the Explorer

content:ClassPath(name)

The game's path of a blueprint's class in this mod's content: "BP_Thing" gives "/Game/Mods/<Id>/BP_Thing.BP_Thing_C". It is what base of game.Blueprints:Define takes.

content:ClassPath(name: string): string
ParameterTypeDescription
namestringThe blueprint's name.

Returns string

Open in the Explorer

content:Load(name)

Loads an asset of this mod's content and keeps it for the mod, as game.Assets:Load does.

content:Load(name: string): WaxInstance?, string?
ParameterTypeDescription
namestringThe asset's name, such as "T_Icon" or "Meshes/Rock".

Returns

  • WaxInstance? (asset) Nil when it could not be loaded.
  • string? (why) The reason, when it could not.

Open in the Explorer

content:LoadClass(name)

Loads the class of a blueprint of this mod's content.

content:LoadClass(name: string): WaxInstance?, string?
ParameterTypeDescription
namestringThe blueprint's name, such as "BP_Thing".

Returns

  • WaxInstance? (class) Nil when it could not be loaded.
  • string? (why) The reason, when it could not.

Open in the Explorer

content:Has(name)

True when the pak holds an asset of this name. Loads nothing.

content:Has(name: string): boolean
ParameterType
namestring

Returns boolean

Open in the Explorer

On this page