BigJk Posted July 23, 2016 Share Posted July 23, 2016 (edited) Hello Guys! Recently I'm playing PZ extensively with my Girlfriend and because I have 3 monitor's I always have the map (http://map.projectzomboid.com/) open on one of the other monitor's. One thing that annoyed me was that even in borderless window mode I had to click out of PZ to move the map to see everything I wanted. Finding the position of your player was also a bit annoying, so one night I sat down and started programming and PZTracker was the result. PZTracker connects the online map to the game. The map will follow your player position if you like and you can move around (arrow keys) or zoom in and out (num+ and num-) on the map by pressing the keys WITHIN PZ. No need to tab out of PZ. You really just need to press buttons ingame. Little Preview: https://www.youtube.com/watch?v=sJEKmZ5Nrh0 I was faced with the problem of connecting two separated systems that had no connection whatsoever. PZ and an Website. I had to get information out of PZ and into the map website. At first I thought about memory reading, but I dropped that idea when modding PZ came to my mind. And so PZTracker currently consists of 3 "components". Component 1: The PZTrackerMod I had to get the information out of the game. I realized this by writing a simple mod. So the PZTrackerMod is just a typical mod written in lua (never worked with lua before, but was easy enough to get everything working in a few minutes) that prints out important information, like player position and keypress events to the PZ cmd. Currently the PZTrackerMod has the following Shortcuts: F - Enables or Disables follow mode. If disabled the map won't follow the position of your player. Arrow Keys - Move the map up, down, left, right for easy navigation. Num + - Zooms into the map. Num - - Zooms out of the map. Component 2: pz_tracker.exe Now I had to get the data that gets printed by the PZTrackerMod out of the cmd, so I wrote a program in golang that starts PZ as a child process and reads and parses the stdout (the text stuff you see in the cmd). Now the program is able to get the data out of the game. To forward this data it also opens a websocket in wich all the data get's send if somebody is connected to it. Component 3: inject.js Now we come to the last part. We got the data that we can get through the websocket from the pz_tracker.exe. Now we have to get the data into the map. Currently I solved the Problem with a small javascript code that I lode into the running map website via the "Chrome Development Console". It,s just pasting the code into the console and hit enter, so even somebody without coding experience should be able to do this. What the code does is to connect to the websocket and read the data that get sent to him. It then uses the data to move the map to the player location or respond to key press events and move or zoom the map. Just download the ZIP File of the latest release: https://github.com/BigJk/PZTracker/releases Setup Video: https://www.youtube.com/watch?v=a4ycQgryxzw Step 1: Download the current Version and extract it somewhere. Step 2: Copy the "PZTrackerMod" to your "Mods" Folder (C:\Users\YOUR USERNAME\Zomboid\mods) Copy the "PZTracker.exe" and "inject-min.js" to your "ProjectZomboid" Folder (With steam: C:\...\Steam\SteamApps\common\ProjectZomboid) Step 3: Start the "PZTracker.exe" and open the PZMap Step 4: Activate the "PZTrackerMod" in your running Project Zomboid. Step 5: Open the Developer Console in your PZMap browser window (Chrome: Ctrl - Shift - I). Paste the code that is displayed in PZTracker after "Insert into development console:" into the development console and hit enter. (Should be something like: $.getScript('http://127.0.0.1:9090/js');) Step 6: Load a Singleplayer Game or join a Server that has "PZTrackerMod" enabled and hit F when you see your character. Now you should see the map moving. Use the shortcuts mentioned above. Advanced Stuff If you start PZTracker for the first time it will generate a config filed called "pztracker_config.json". Open this file with a texteditor and you will find the settings for PZTracker. You should understand them just by the name, but in case an explanation of them will be added shortly. Github Repository: BigJk/PZTracker First of all I would really like to hear the opinion on this from you guys. Maybe you don't like the idea and it will just be a little tool for me to use when I play with my girlfriend, but in case you like it I will get it ready to release in a short while and think about possible future features. Any ideas? Maybe I can simplify the process of getting the data into the map and get away from this "hacky" way of doing it, even though I must admit that it works way better than I have ever expected xD Thank you for taking your time and reading this and huge thanks to blindcoder for creating this awesome map website! I hope you don't mind my playing around xP Edited August 5, 2016 by BigJk Jericoshost, RoboMat, Jason132 and 11 others 13 1 Link to comment Share on other sites More sharing options...
RoboMat Posted July 23, 2016 Share Posted July 23, 2016 Sounds great! BigJk 1 Link to comment Share on other sites More sharing options...
Decay Posted July 24, 2016 Share Posted July 24, 2016 Looks like a good mod for noobs and veteran players alike! or simply for others wanting to meetup on multiplayer. Link to comment Share on other sites More sharing options...
blindcoder Posted July 24, 2016 Share Posted July 24, 2016 Wow, that's awesome! I always wanted to make something like that, but was always too lazy to I'm currently on vacation but will have a look in about a week or two when I'm back! Johnny Fisher, EUDOXIO, EnigmaGrey and 2 others 5 Link to comment Share on other sites More sharing options...
BigJk Posted July 24, 2016 Author Share Posted July 24, 2016 2 hours ago, blindcoder said: Wow, that's awesome! I always wanted to make something like that, but was always too lazy to I'm currently on vacation but will have a look in about a week or two when I'm back! Glad to hear that you and the others like the idea Is there a possibility to maybe integrate this into the map to get away from the manual "injecting" the code? Because it would just need a button that opens a connection to a local websocket and waits and responses to certain packages. The Javascript code is just 35 lines long. So nothing too huge and fancy Just leave me a pm when you are back (I'm also German) Link to comment Share on other sites More sharing options...
nasKo Posted July 24, 2016 Share Posted July 24, 2016 H o l y s h i i i i i i i i- Hydromancerx and Johnny Fisher 2 Link to comment Share on other sites More sharing options...
BigJk Posted July 24, 2016 Author Share Posted July 24, 2016 7 minutes ago, nasKo said: H o l y s h i i i i i i i i- Is that a positive or a negative Holyshi*? XD nasKo 1 Link to comment Share on other sites More sharing options...
nasKo Posted July 24, 2016 Share Posted July 24, 2016 2 minutes ago, BigJk said: Is that a positive or a negative Holyshi*? XD You kidding? This is hella awesome Johnny Fisher 1 Link to comment Share on other sites More sharing options...
BigJk Posted July 24, 2016 Author Share Posted July 24, 2016 6 minutes ago, nasKo said: You kidding? This is hella awesome Glad to hear that. I will try to get a clean version out in a few days for everybody to try Hicks and nasKo 2 Link to comment Share on other sites More sharing options...
Rathlord Posted July 24, 2016 Share Posted July 24, 2016 Very, very cool. Something I don't want for the vanilla game but I've always wanted to see as a mod. Excellent! Johnny Fisher 1 Link to comment Share on other sites More sharing options...
Hydromancerx Posted July 24, 2016 Share Posted July 24, 2016 Wow! Link to comment Share on other sites More sharing options...
TheGentleman Posted July 25, 2016 Share Posted July 25, 2016 Very neat! This is something that could come very useful in certain circumstances (Especially if you used that one custom spawns mod that could spawn you in the forests) and overall just useful for navigation in general. Link to comment Share on other sites More sharing options...
chewgowski Posted July 25, 2016 Share Posted July 25, 2016 So basically, works by magic, youre a wizard? Cool. Link to comment Share on other sites More sharing options...
BigJk Posted July 27, 2016 Author Share Posted July 27, 2016 (edited) Tada! First Release! So, I added a download link to the current version, wrote a little setup guide and made a little video about it. Unfortunately I won't be home from tomorrow on til next week. I can answer here but if this release contains any bugs or is broken for the majority of people I can't do much about it. This is the first release and only tested on my machine. So don't expect wonders and bugs are possible even though I never noticed any. I'm also a bit nervous. I'm not really used to releasing anything, so don't be to hard on me If there are any questions just ask and I will try to do my best to answer everything EDIT: Also added a link to the PZTracker Github Repository, so everybody can take a look at the code. It still needs to get some more structure and cleaning even if it's not that long. Edited July 27, 2016 by BigJk nasKo 1 Link to comment Share on other sites More sharing options...
Leond Posted July 27, 2016 Share Posted July 27, 2016 Just as a question here. Could you use a similar concept to make an extension for team speak that would provide location based voice? Grab player location --> Send player location to TS server --> Server checks distance to other players --> adjusts volume accordingly Awesome job! I like the idea of this because it makes sense that you would know your way around the town you live in. Link to comment Share on other sites More sharing options...
BigJk Posted July 28, 2016 Author Share Posted July 28, 2016 14 hours ago, Leond said: Just as a question here. Could you use a similar concept to make an extension for team speak that would provide location based voice? Grab player location --> Send player location to TS server --> Server checks distance to other players --> adjusts volume accordingly Awesome job! I like the idea of this because it makes sense that you would know your way around the town you live in. That's an awesome Idea. I will definitly take a look into this when I'm back! Leond 1 Link to comment Share on other sites More sharing options...
Leond Posted July 28, 2016 Share Posted July 28, 2016 (edited) 7 hours ago, BigJk said: That's an awesome Idea. I will definitly take a look into this when I'm back! Yay! Also just want to say your code is really easy to read! One could say "Functional and elegant" Again great job! Did some quick looking and it might be a bit easier to do with mumble. https://wiki.mumble.info/wiki/Positional-Audio here is some info about the positional audio system in mumble. The very bottom of the page has a link to info about making plugins for it. I made a separate post to discuss the possibility of this as not to clutter your mods post Edited July 28, 2016 by Leond Added information about mumble Link to comment Share on other sites More sharing options...
BigJk Posted August 3, 2016 Author Share Posted August 3, 2016 So, I'm back! I fixed a little bug and uploaded a new version for everyone to try. From now on all the releases can be found and downloaded directly from the Github Repository. Just download the ZIP File of the most recent release. It will always contain everything you need for PZTracker. PZTracker Release Downloads Rathlord 1 Link to comment Share on other sites More sharing options...
BigJk Posted August 5, 2016 Author Share Posted August 5, 2016 New and easier Version out! (Edited the "Setup Guide" section of the top post to fit to this version) New Features: Now adds a red dot to the map for better navigation Simplified injection process to one line of code Start parameter of Project Zomboid and settings of PZTracker can now be easily changed via a automatically generated config file New Setup Video: https://www.youtube.com/watch?v=a4ycQgryxzw Download: v1.3 Link to comment Share on other sites More sharing options...
thrandisher Posted December 6, 2016 Share Posted December 6, 2016 Pretty neat idea. The good old age kicks in once in awhile and i get lost, lol Link to comment Share on other sites More sharing options...
thrandisher Posted January 12, 2017 Share Posted January 12, 2017 Someone had asked about a in game map and i mentioned this, even tho i havent played around with it yet. Well i just got done taking a look and it appears its broken now, atleast with build 36.4 Looking at the console it says it connects, arrow keys and zoom in/out works from in game, but it doesnt track at all. I turned on debug and nothing shows up. Well it does show user bob so it is connecting, just not tracking. Ive tried with steam and without (by changing the config file) with the same results. With a zerg of mods and with it just by itself. Code might be easly fixed since ya share it all on git, but not by me as i cant code. Hopefully you are still semi around and this can be fixed up or maybe someone else can branch it out. Link to comment Share on other sites More sharing options...
nickodemos Posted June 21, 2017 Share Posted June 21, 2017 So does this work with steam setup? As it is if I do as you instructed the only mod that loads is the PZMap. Tried dropping it into the steam folder no luck. Just can't seem to get it to use the steam loaded exe for mods and PZMap. Link to comment Share on other sites More sharing options...
Komakino Posted December 26, 2018 Share Posted December 26, 2018 As of version 40.43, this still works. However, there is an issue with being able to use the steam workshop mods, it doesn't show up when opening through the PZTracker.exe I found a workaround, however. I had to get all the zomboid workshop mods from the workshop content folder, and had to paste the mods inside C:/Users/NAME/Zomboid/mods Link to comment Share on other sites More sharing options...
FrankWesker Posted November 28, 2019 Share Posted November 28, 2019 Sorry for bumping an old thread, but is this still working on build 41? Hope it does! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now