FrameworkZ API - Features

Features

page

Characters

Characters are the main focus of the game. They are a piece of the player that interacts with the world. Characters can be given a name, description, faction, age, height, eye color, hair color, etc. They can also be given items and equipment.

When a player connects to the server, they may create a character and load said character. The character is then saved to the player's data and can be loaded again when the player reconnects. Characters will be saved automatically at predetermined intervals or upon disconnection or when switching characters.

Characters are not given items in the traditional sense. Instead, they are given items by a unique ID from an item defined in the framework's (or gamemode's or even plugin's) files. This special item definition is then used to create an item instance that is added to the character's inventory. This allows for items to be created dynamically and given to characters. This allows for the same Project Zomboid item to be reused for different purposes. However characters can still be given items in the traditional sense, all of which will save/restore as needed.

Interfaces

This framework provides an interface creation and management system. In other words, User Interfaces (UIs) can be easily created, customized, and managed through a set of predefined functions and classes.

One unique method of interface creation and management for FrameworkZ is how new interfaces are defined and then registered. Since Project Zomboid's ISUI features are defined client side and shared Lua files are loaded first, interfaces must be created then registered in shared environments without necessarily being instantiated right away. When a client loads into the game, all interfaces will be initialized at that time.

Be sure to have a look at Themes as created interfaces use styling options from that module to provide a consistent and unique look across UI elements.

Inventories

Inventories are used to store items for characters, containers, vehicles, and other entities. Each inventory can hold multiple items, and each item can have its own unique properties and data.

An inventory object is broken down into two key elements: The logical inventory, and the "physical" inventory. A logical inventory is composed of items that are directly implemented with FrameworkZ. Whereas a physical inventory is composed of regular Project Zomboid items. These two distinctions were made to provide better organization and management of items within the game considering that not all items would be implemented into FrameworkZ.

Items

Items are an essential piece of gameplay in both Project Zomboid and FrameworkZ. While items aren't necessarily required to roleplay, they provide important mechanics and interactions that enhance the experience.

There are two states an item can be in: Instanced or Non-Instanced. What this means is that a non-instanced item is like a template or blueprint that is used to create actual items in the game world, where they are then considered instanced. In computer terms, imagine that a file is stored on your hard drive (non-instanced), and when you open that file its contents are moved into memory (instanced). A sort of active vs. inactive types of forms.

That said, an item can be instantiated (the process of creating an instance from a non-instanced blueprint).

Another aspect of items are item bases. A base can be defined and inherited from, allowing for the creation of new item types with shared properties and behaviors. This allows code reuse, a self-explained concept where repitious code is defined at a single source and reused by other different elements.

Notifications

The notifications system allows for displaying messages to the player, such as alerts, warnings, and other important information.

While the notifications system is client side only, it can be triggered by server events. Server messages can be logged using the Logs module instead.

Players

Players are the entities that connect to the game server. Each player can have multiple characters and can switch between said characters at any time. Players can also be assigned roles and permissions within the game.

Now it's important to distinguish between players characters, imagine the player as the thing controlling the character. The "person" vs the "avatar" where the avatar is the in-game representation of the player and what/whom they're roleplaying as.