I have written a Python program to extract portal locations from the json file. The output of the program is below. The coordinates of each portal is a copy of the position but 'y' is actually 'z' and 'z' is actually 'y'. I verified this using the mod MapCoordinatesDisplay as shown in the attached screenshot.
A subset of the zdoList from the full json and the python program are also included for reference.
n= 6
{'Eikthyr': [{'x': 258.27924, 'y': 33.166325, 'z': -467.05978},
{'x': -13.000263, 'y': 31.675123, 'z': -126.970474}],
'Spawn': [{'x': -89.851616, 'y': 36.7241, 'z': -186.26418},
{'x': -18.03693, 'y': 32.281498, 'z': -114.32009}],
'Stone': [{'x': -10.132895, 'y': 31.679173, 'z': -111.687416},
{'x': -29.335318, 'y': 32.615135, 'z': -105.079544}]}
p= 3
#!/usr/bin/python3
import mmap
import sys
import time
import os
import json
from pprint import pprint
if len(sys.argv) < 2:
print("Usage:")
exit()
# Getting the path of the file
dbfile = sys.argv[1]
with open(dbfile, mode='r') as f:
data = json.load(f)
# pprint(data)
n = 0
portals = {}
for zdoItem in data['zdoList']:
if zdoItem['stringsByName']:
if 'tag' in zdoItem['stringsByName']:
n += 1
if zdoItem['stringsByName']['tag'] in portals:
portals[zdoItem['stringsByName']['tag']].append(zdoItem['position'])
else:
portals[zdoItem['stringsByName']['tag']] = [zdoItem['position']]
print("n=", n)
pprint(portals)
print("p=",len(portals))
I have written a Python program to extract portal locations from the json file. The output of the program is below. The coordinates of each portal is a copy of the position but 'y' is actually 'z' and 'z' is actually 'y'. I verified this using the mod MapCoordinatesDisplay as shown in the attached screenshot.
A subset of the zdoList from the full json and the python program are also included for reference.
StarterPortals.json