Accessible Fields
Modifies the class metatables to allow fields to be accessed with the intuitive object.field syntax we’re all used to. While fields can be accessed without this script, the syntax is extremely cumbersome and unnatural.
Please be aware that while it uses the syntax of a table access, it is actually a java function call, and a fairly expensive one at that. In testing, a field access is around 70% more expensive than calling a simple getter. So for performance reasons it is usually best to use field access only for things that do not have getters.
There is currently no support for accessing fields inherited from superclasses. This is simply a limitation of Zomboid’s reflection API and not something I can fix. This is most notable for item objects, which inherit 99% of their fields.
View on GitHub[github.com]
Workshop ID: 3001901955
Mod ID: 00AccessibleFields
Revisions:
Old revisions of this mod are available below. Click the link to download.