Project Zomboid

Project Zomboid

Not enough ratings
Derived Object Module Extractor
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
324.576 KB
Mar 2 @ 10:36am
1 Change Note ( view )

Subscribe to download
Derived Object Module Extractor

Description
This is a mod for modders; if another Workshop Item in your subscriptions has not listed this as a dependency and you are not (yet) a modder of Project Zomboid, then you do not need this mod (though I welcome you to try my other ones).

Derived Object Module Extractor (or DOME) is a tool for improving compatibility between formerly incompatible game modification efforts by allowing modders to import many local objects from the vanilla game's Lua files that cannot be required using the require function.

DOME decorates ISBaseObject:derive in order to store every module that uses BaseObject:derive to instantiate its base table as they become instantiated. Once such a module is created, even if that module is local to its own file, you can grab a reference to it using two lines of code:
local DOME = require("DOME") local Module = DOME.require("Module")
Note that you can also use DOME as an optional dependency by checking whether DOME is loaded before using it:
local Module = DOME and DOME.require("Module")
"Module" above is simply the type string that gets passed to "derive" when that table is created. In vanilla game files, this type string generally matches the variable name used for the module to which it refers; for example, in MainOptions.lua, there is a local module named "GameOption" and its type is also "GameOption", and it can be imported into your own Lua files by replacing "Module" with "GameOption" in the above chunk.

This technique effectively gives modders access to many tables that were not returned for easy modding, for a variety of purposes that have formerly been solved by much more instrusive strategies, such as overriding entire vanilla files. In theory, this can allow modders to improve the mutual compatibility of their mods that target local object modules in Lua.

Note that you still need to ensure that the modules you intend to import exist when you try to import them. Be sure that you are in the appropriate folder (client / shared / server) to require the object you are attempting to require.

Like this mod? Feel free to check out my other mods on the Steam Workshop, including:

True Music Jukebox: Norby and I have attempted to make this the ultimate way to enjoy True Music tracks in Project Zomboid. It's already pretty fun. We hope you enjoy it. This mod uses DOME (with or without subscribing to it on this page) to add a page of volume options to the Game Options menu.
Wookiee Gamepad Support: A significant expansion to gamepad support in Project Zomboid, including various helpful gamepad shortcuts and the ability to use the vanilla player-to-player trading on gamepad.
Trash Talker: Given a trait, you will talk trash when you kill zombies. Talking draws zombies. Admins can customize the range of the noise and how talkative trash talkers are; users can customize these features within a range defined by the host, as well as customize the things their character will say. Some users boast around a thousand custom lines and counting!

. . . and many more!

I don't mod for commission, but support is always appreciated![ko-fi.com]

Workshop ID: 3171829037
Mod ID: DerivedObjectModuleExtractor