readable names also in io, checks and texture messages (naming moved to editor.model), tile palette filter by name or number, import preview frames the main mass and zooms with the wheel, object palette right-click no longer switches to place, floorfinder built on ground, levelbuild starts get one camera node behind the llama (golden hashes updated, boot-to-level moves it along)

This commit is contained in:
MineTec committed 2026-11-07 14:42:32 +01:00
1 parent 386a06006d
commit 38c679b319
49 files changed
+819 -470

No files matched your search

+9 -9
View File
@@ -419,7 +419,7 @@ class Level:
"""Place an object. y=None: put it on the highest surface at (x,z).
rot: degrees (None = as in the original). params: list of u32 (None = original).
wp: 'relative' (move the original's waypoint chain along, y snapped to the ground),
'here' (all waypoints on the object), 'none' (-1) or list [(x,z[,y[,rot]]),...]."""
'here' (all waypoints on the object), 'none' (-1) or list [(x,z[,y[,rot[,unk2]]]),...]."""
if name not in self.protos:
raise KeyError('strat type %r not in base level (available: %s)' % (name, ', '.join(self.types())))
if y is None:
@@ -430,17 +430,15 @@ class Level:
self.strats.append(d)
return d
def player(self, x, z, rot=0, y=None, cam_dist=8.0):
"""Player start. The first waypoint of the llama chain is (in the original) the camera's
start position -> put it behind the llama (distance cam_dist), the rest on the llama."""
def player(self, x, z, rot=0, y=None, cam_dist=2.0):
"""Player start with its start camera: one waypoint cam_dist behind the llama, 0.5 above it,
unk2 = 0 (default camera distance/height). The game takes the first node of the llama chain
within 2.5 cells as the camera start (keep cam_dist below that); the prototype's chain would put
the camera into the llama's head on village 2 bases."""
d = self.strat('Llama', x, z, y, rot, wp='here')
a = math.radians(rot or 0)
cx, cz = x - cam_dist * math.sin(a), z - cam_dist * math.cos(a)
n = 1
k = self.protos['Llama'][0][13]
while k >= 0 and self.map['nodes'][k][0] and n < 200:
k = self.map['nodes'][k][0]; n += 1
d['wp'] = [(cx, cz, d['y'] - 0.4, rot or 0)] + [(x, z, d['y'], rot or 0)] * (n - 1)
d['wp'] = [(cx, cz, d['y'] + 0.5, rot or 0, 0)]
return d
def checkpoint(self, x, z, rot=None, y=None):
@@ -773,6 +771,8 @@ class Level:
pr = deg(p[3]) if len(p) > 3 else s[1]
# copy extra fields (wait time/mode etc.) from the original waypoint
a_, b_ = (chain[i][8], chain[i][9]) if i < len(chain) else (0, 0)
if len(p) > 4:
a_ = p[4]
new.append([0, 0, 0, pr, 0, int(px * FX), int(py * FX), int(pz * FX), a_, b_])
elif chain and wp != 'none':
ox, oy, oz = proto[3], proto[4], proto[5]