Skip to content

Introduction

Open Markdown

Viewpoint is a mod for Project Zomboid. It draws the game in first and third person. Other authors can add to it with addons, resource packs and Shaderpacks. Players see each package and control it from the settings window.

KindContainsDescriptor
AddonJava code. It can also contain assets, shader snippets and Lua.addon.properties
Resource PackModels, tiles, sounds and data. No Java and no shader code.pack.properties
ShaderpackGLSL files and their options. No Java.pack.properties

A model pack in the older Viewpoint model pack format is a resource pack with the legacy flag. See Package kinds.

  • It loads your jar in a class loader of its own. Your code can use viewpoint.api, and the members of Viewpoint that are on the internals list.
  • It shows your package in the settings window: an addon in Advanced, Addons, a resource pack in Graphics, Resource Packs, and a Shaderpack in Graphics, Shaderpacks. The player orders it, switches it on and off, and reads what it does. A restart is not necessary.
  • It checks your jar when it loads it, and shows a label: Normal, Amber or Red. See Labels.
  • It installs the hooks that you declare, runs them in the player’s order, and lists each active hook.
  • It gives you files, downloads and assets through its services. Each service has a permission and limits.
To do thisUsePage
Read where the view is and what it showsViewState, ViewListenerView state
Give settings and key bindingssettings.properties, AddonSettings, KeyActionSettings & keys
Read the view state from LuaViewpoint.AddonsLua mirror
Give your Java functions to Lua@LuaExportLua exports
Keep filesAddonFilesFiles
Get a file from the internetAddonDownloadsDownloads
Load models, textures, sounds and dataAddonAssetsAssets
Give a feature to other addonsServicesServices
Move the cameraCameraLayer, CameraClaimCamera layers
Follow the aim and the shotsAimListener, ShotListenerAim & shots
Choose the model of an objectModelProvider, AttachmentProviderModel providers
Give numbers to shader codeShaderValuesShader values
Add a piece of GLSL to a shaderAddonSnippetsShader snippets
Draw with OpenGLDrawCallback, GpuDraw callbacks (planned)
Change what a game method does@HookManaged patching
Change what a method of Viewpoint does@Hook on a listed memberHooking Viewpoint
Replace the game’s tile artThe tiles folder of a resource packTiles
Choose a model from the state of an objectA version 2 manifestModel states
Change how the whole frame looksA ShaderpackShaderpack format

A page marked planned is not written yet. Its feature is part of API 1.0. The sidebar group Planned lists these pages.

The addon API (viewpoint-api.jar), the samples and these pages have the MIT licence. Viewpoint itself has a different licence. The font of these pages is Roboto Medium, under the Apache 2.0 licence (notice).

  1. Getting started: make the smallest addon and switch it on.
  2. Sample walkthrough: the samples that use each service.
  3. Package kinds: which kind of package to make.
  4. Descriptor: all keys of the descriptors.
  5. Glossary: the terms these pages use.