M MY Multiplayer: Wiki
Side
Kind

engineLoadTxd

Client

Loads a texture dictionary (.ktd) from a resource file under a name. It exists on this client only.

txd engineLoadTxd(string path [, string name = the file's name without its extension])

Parameters

NameTypeDescription
pathstringPath to the .ktd file in the resource.
namestringThe dictionary's name.default the file's name without its extension

Returns

The new txd element. Raises an error if another script's txd has that name or the file cannot be found.

If a pack already has a txd with that name, the loaded one covers it while it lives, and a warning is logged.

Example

local txd = engineLoadTxd("models/u6car.ktd")

addEventHandler("onClientAssetLoad", txd, function(loaded)
    if loaded then
        engineSetModelTxd("infernus", txd)
    end
end)
NoteThe file is read in the background, so the txd is empty until onClientAssetLoad fires on it. If the file cannot be read, the event gets false.

See also