cff29546 / pzmap2dzi

A command-line tool to convert Project Zomboid map data into Deep Zoom format
MIT License
53 stars 17 forks source link

Shroud unexplored areas. #9

Open Nunyabb opened 9 months ago

Nunyabb commented 9 months ago

I have been trying to research how to go about pulling data from the game to add a overlay to the map that shrouds the map and only reveals the map as the player explores it along with player location data. I cant for the life of me find any info on the bin files or how they are structured internally. I thought this game was mod friendly? But anyways would be a neat feature that a faction could host on a wamp or xampp webserver

cff29546 commented 7 months ago

The structure of bin files is dependent on mods. It is not easy to retrieve visited area info from bin files. However, the current player location is simple to get. The player database (players.db) stores this info. You can list the locations of all players via the following script:

import sqlite3

playersDB = sqlite3.connect('players.db')
cursor = playersDB.cursor()
cursor.execute('SELECT name, wx, wy, x, y, z FROM localPlayers;')
print(cursor.fetchall())