Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

PZ Remove Epilepsy Warning

A small Windows tool that removes Project Zomboid's startup photosensitivity/epilepsy warning screen by patching projectzomboid.jar in place.

Why this exists

Project Zomboid shows a photosensitivity warning screen every time the game starts. There's no in-game setting to disable it — it isn't controlled by options.ini or any Lua mod hook, because it's drawn by compiled Java code (zombie.GameWindow) that runs before Lua even loads. This tool patches that method directly so the game skips it.

This only affects your own local projectzomboid.jar. It doesn't touch save data, online play, or anyone else's game.

What it does

It changes exactly one method, zombie.GameWindow.doEpilepsyWarningText(), from "draw the warning text" to "return immediately." Nothing else in the game is touched.

Concretely, the method's bytecode goes from:

getstatic  TextManager.instance
getfield   TextManager.font
ifnonnull  L10      ; if the font is loaded, jump ahead and draw the warning
return               ; otherwise, bail out early (font not ready yet)
L10: ... draws the warning text for one frame ...

to:

getstatic  TextManager.instance
getfield   TextManager.font
pop                  ; discard the font reference (same stack effect as ifnonnull)
nop
nop
return               ; always take the early-return path now
L10: ... unreachable, but left in place — still valid bytecode ...

The replacement is the same number of bytes as the original (10 bytes in, 10 bytes out), so nothing else in the class file has to shift — no other method, no constant pool entry, no offset table. The pop instruction has the identical stack effect that ifnonnull has (it consumes the one value on the stack either way), so this is a minimal, surgical change rather than a rewritten method.

How the patch is applied

projectzomboid.jar is a zip file. The script:

  1. Opens it with .NET's System.IO.Compression.ZipFile (built into Windows — no extra tools required).
  2. Reads the zombie/GameWindow.class entry into memory.
  3. Searches for the exact 10-byte pattern above.
  4. If found once, patches those 10 bytes and writes the entry back.
  5. Recompresses and closes the archive.

Before the first patch, it copies the untouched jar to projectzomboid.jar.orig as a backup.

Safety checks

The script never patches blindly. Each run it checks what's actually in the jar:

  • Unpatched jar found (fresh install, or Steam just restored the original after an update / "Verify integrity of game files") → it patches it.
  • Already patched → it says so and exits without touching the file.
  • Neither pattern matches (most likely because a game update changed this method) → it aborts and leaves the jar alone, rather than guessing and risking a corrupted jar. Your projectzomboid.jar.orig backup is still there if you need it.

This means you can just re-run the tool any time — after a Steam update, after verifying game files, whenever — and it does the right thing automatically.

Installation

  1. Download this repo (or just the two files: RemoveEpilepsyWarning.bat and RemoveEpilepsyWarning.ps1 — they must stay in the same folder together).
  2. Copy both files into your Project Zomboid install folder, next to projectzomboid.jar. By default that's:
    <Steam library>\steamapps\common\ProjectZomboid\
    
  3. Double-click RemoveEpilepsyWarning.bat.
  4. That's it — launch the game normally.

Usage

  • Patch: double-click RemoveEpilepsyWarning.bat (or run the .ps1 directly in PowerShell). Safe to run multiple times.
  • Restore the original jar:
    powershell -ExecutionPolicy Bypass -File RemoveEpilepsyWarning.ps1 -Restore
    
    This copies projectzomboid.jar.orig back over projectzomboid.jar. (You can also just use Steam's "Verify integrity of game files" to restore it.)

Compatibility

Tested against Project Zomboid 42.20.3. If a future update changes GameWindow.doEpilepsyWarningText(), the safety check above will refuse to patch and tell you why, rather than silently doing something wrong. If that happens, this repo will need a small update to match the new bytecode.

Caveats

  • This edits a game file directly. It's a single-player/local change — no server or other players are affected — but if you're ever concerned about Steam's file integrity check flagging it, just run the restore command above, or let Steam verify the files, before doing anything that checks file integrity.
  • Requires Windows and PowerShell (included with Windows 10/11). No other dependencies.

License

MIT — see LICENSE.

About

Removes Project Zomboid's startup photosensitivity warning by patching projectzomboid.jar

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages