ObjDepLoader
A simple workaround for object dependency
About this mod Author’s original text
ObjDepLoader
A simple workaround for object dependency.
Usage
This is primarily to work around objects needing to be loaded for drawing commands. For instance you cannot simply draw the Deku Mask GI from anywhere, or draw DL's from different objects within the same actor without a bunch of complicated logic. With this library this is made simple:
// Import the functions
RECOMP_IMPORT("ProxyMM_ObjDepLoader", bool ObjDepLoader_Load(PlayState* play, u8 segment, s16 objectId));
RECOMP_IMPORT("ProxyMM_ObjDepLoader", void ObjDepLoader_Unload(PlayState* play, u8 segment, s16 objectId));
void MyActor_Draw(Actor actor, PlayState play) {
if (ObjDepLoader_Load(play, 0x06, OBJECT_GI_NUTSMASK)) {
Matrix_Scale(30.0f, 30.0f, 30.0f, MTXMODE_APPLY);
GetItem_Draw(play, GID_MASK_DEKU);
ObjDepLoader_Unload(play, 0x06, OBJECT_GI_NUTSMASK);
}
if (ObjDepLoader_Load(play, 0x06, OBJECT_GI_GOLONMASK)) {
Matrix_Scale(30.0f, 30.0f, 30.0f, MTXMODE_APPLY);
GetItem_Draw(play, GID_MASK_GORON);
ObjDepLoader_Unload(play, 0x06, OBJECT_GI_GOLONMASK);
}
}
Technical
Currently, this is achieved with a very naive approach, a static location in which all objects can be simultaneously loaded into and never unload. Later on I may improve it to be more dilegent and clean up it's un-used objects as things are "unloaded", but the API will stay the same.
Install & use Install: follow the bundled instructions
- Unzip the archive from playbuff and read the bundled readme / instructions first.
- Most mods rely on the game's mod loader — the usual route is a community mod manager (such as r2modman): pick this game, install, and it handles the loader and dependencies.
- For a manual install, put the mod files into the matching Mod / plugins folder inside the game directory.
- Launch the game to confirm it loaded; mods with listed dependencies need those installed as well.
Install locations vary a lot between mods — the bundled readme is the most reliable guide.