Project Zomboid

Project Zomboid

167 ratings
Accessible Fields
3
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
Updated
38.666 KB
9 Jul, 2023 @ 4:06pm
4 Dec, 2024 @ 6:34pm
5 Change Notes ( view )

Subscribe to download
Accessible Fields

Description
This mod has been superceded by Starlit Library.

Please develop future mods to depend on it instead, and consider transitioning existing mods to use it instead (no code changes are needed).
AccessibleFields is a library for other mods to use, it doesn't do anything on its own. As an end user, you don't have any reason to install this unless a mod you use requires it.

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.
Usage Example:
local player = getPlayer() player:Say("The closest zombie is " .. player.closestZombie .. " away."

Please be aware that while the syntax resembles a table access, accessing fields still invokes a java method and has the associated performance cost.

View on GitHub[github.com]

Workshop ID: 3001901955
Mod ID: 00AccessibleFields
4 Comments
Burryaga 14 Nov, 2024 @ 2:05am 
The page description says it all; you just need to Google the words you don't know from the description above. Only modders need to understand the purpose of this mod, but if you really want to understand, you'll need to educate yourself on basics of Lua programming.

https://www.lua.org/pil/1.html
Timangust 30 Oct, 2024 @ 4:32am 
Explain for noobs,please, what is this thing do?
Eizen 27 May, 2024 @ 7:05am 
can you add it in the ISToolTipInv:render? self.item currently cant access the fields. I don't know if its possible
Dismellion 28 Nov, 2023 @ 4:53pm 
ez sub