translated the remaining german notes, python comments, help and messages to english (in-game strings, parsed report lines and cli values stay german)

This commit is contained in:
MineTec committed 2026-11-07 10:51:14 +01:00
1 parent 86fe26d786
commit 526f6072f6
36 files changed
+1553 -1544

No files matched your search

+25 -25
View File
@@ -1,15 +1,15 @@
#!/usr/bin/env python3
"""Testlevel bauen: in einem leeren Bereich des MAP-Rasters eine Bodenplatte aus Kopien
eines flachen Boden-Tiles anlegen, darauf je einen Strat (Objekt) pro Typ im Raster
aufstellen, den Spieler (Strat "Llama") an den Anfang setzen und einen kleinen
Parkour (schwebende Bodenplatten, treppauf) anhängen. Geometrie/Texturen/Strat-Code
(TRAK/STPC/TEXT …) bleiben die des Quell-Levels; nur der MAP-Chunk wird neu geschrieben.
"""Build a test level: in an empty area of the MAP grid, lay a floor plate made of copies
of a flat floor tile, place one strat (object) per type on it in a grid, put the
player (strat "Llama") at the start and append a small parkour (floating floor
plates, going up). Geometry/textures/strat code (TRAK/STPC/TEXT ...) stay those of
the source level; only the MAP chunk is rewritten.
make_testlevel.py quelle.wad ziel.wad [--keep-original] [--spacing 3] [--name "TestLevel"]
make_testlevel.py source.wad target.wad [--keep-original] [--spacing 3] [--name "TestLevel"]
--keep-original : Original-Strats behalten (sonst nur Spieler + Raster + Cheats)
Strat-Typen werden per Name erkannt (strats.py); Parameter/Typ-Felder werden von der
ersten Original-Instanz kopiert, Wegpunkt-Index bleibt (zeigt ggf. auf Original-Wegpunkte).
--keep-original : keep the original strats (otherwise only player + grid + cheats)
Strat types are recognised by name (strats.py); parameter/type fields are copied from the
first original instance, the waypoint index is kept (may point at original waypoints).
"""
import argparse
import os
@@ -23,7 +23,7 @@ import strats as S # noqa: E402
import wadtool # noqa: E402
FX = 4096
# nicht ins Raster: Kamera/Cutscene/Trigger-Zonen, Spieler selbst
# not in the grid: camera/cutscene/trigger zones, the player itself
SKIP_PREFIX = ('CutScene', 'Camera', 'MainMenu', 'Options', 'Title', 'TheNewGroove', 'Force',
'EndGameTrigger', 'RiverTriggerBox', 'FallOffNoHurt')
KEEP_ORIGINAL = ('CheatTeleport', 'CheatCharge')
@@ -45,7 +45,7 @@ def trak_models(trak):
def find_floor_tile(m, models, force=None):
"""Häufigstes Tile, dessen Modell eine flache 1x1-Fläche ist."""
"""Most frequent tile whose model is a flat 1x1 surface."""
from collections import Counter
flat = set()
for i, vs in enumerate(models):
@@ -54,7 +54,7 @@ def find_floor_tile(m, models, force=None):
min(v[2] for v in vs) <= -0.49 and max(v[2] for v in vs) >= 0.49:
flat.add(i)
c = Counter(mi for t, mi in zip(m['tiles'], m['tilemodel']) if mi in flat and not t[5])
# begehbare Böden liegen bei Modell-y = +0.25 (Strats stehen auf Tile-y + 0.25)
# walkable floors sit at model y = +0.25 (strats stand on tile y + 0.25)
best = [k for k, _ in c.most_common() if abs(models[k][0][1] - 0.25) < 1e-3]
mdl = force if force is not None else (best or [c.most_common(1)[0][0]])[0]
idx = next(i for i, (t, mi) in enumerate(zip(m['tiles'], m['tilemodel'])) if mi == mdl and not t[5])
@@ -68,7 +68,7 @@ def empty_rect(m, w, h):
if all((x, z) not in occ for x in range(x0 - 1, x0 + w + 1)
for z in range(z0 - 1, z0 + h + 1)):
return x0, z0
raise SystemExit(f'kein freier Bereich {w}x{h} im Raster {m["W"]}x{m["H"]}')
raise SystemExit(f'no free {w}x{h} area in the {m["W"]}x{m["H"]} grid')
def main():
@@ -78,8 +78,8 @@ def main():
ap.add_argument('--spacing', type=int, default=3)
ap.add_argument('--keep-original', action='store_true')
ap.add_argument('--name')
ap.add_argument('--floor-model', type=int, help='TRAK-Modellindex für Bodenplatten')
ap.add_argument('--y', type=float, default=None, help='Höhe der Bodenplatte (Tile-y)')
ap.add_argument('--floor-model', type=int, help='TRAK model index for floor plates')
ap.add_argument('--y', type=float, default=None, help='height of the floor plate (tile y)')
a = ap.parse_args()
ch, wf, m, lo, types = S.level_types(a.src)
@@ -90,13 +90,13 @@ def main():
cols = 6
rows = (len(names) + cols - 1) // cols
sp = a.spacing
gw, gh = cols * sp + 2, rows * sp + 4 # Raster + Startstreifen
pk = 14 # Parkour-Streifen
gw, gh = cols * sp + 2, rows * sp + 4 # grid + start strip
pk = 14 # parkour strip
x0, z0 = empty_rect(m, gw + pk, gh)
base = m['tiles'][ftile]
y = a.y if a.y is not None else base[1]
print(f'Boden-Tile #{ftile} Modell {fmodel} (Fläche y+{fsurf}), Bereich x{x0}..{x0 + gw + pk} '
f'z{z0}..{z0 + gh}, Höhe {y}')
print(f'floor tile #{ftile} model {fmodel} (surface y+{fsurf}), area x{x0}..{x0 + gw + pk} '
f'z{z0}..{z0 + gh}, height {y}')
def add_tile(cx, cz, ty):
m['tiles'].append((cx + 0.5, ty, -(cz + 0.5), base[3], fmodel, 0))
@@ -107,7 +107,7 @@ def main():
for cx in range(x0, x0 + gw):
for cz in range(z0, z0 + gh):
add_tile(cx, cz, y)
# Parkour: Trittplatten mit Lücken, je +0.5 höher, dann Zielplattform 3x3
# parkour: stepping plates with gaps, each +0.5 higher, then a 3x3 goal platform
px, pz, py = x0 + gw + 1, z0 + 1, y
steps = []
for i in range(6):
@@ -151,7 +151,7 @@ def main():
s[8] = len(m['list1'])
m['list1'].extend(m['_list1_orig'][pi:pi + s[7]])
new.append(tuple(s))
# Spieler an den Start (Rand des Rasters, Blick ins Raster)
# player at the start (edge of the grid, facing into it)
if PLAYER in types:
new = [s for s in new if S.strat_name(ch['STPC'], s[6], lo) != PLAYER]
new.insert(0, srec(types[PLAYER][0], x0 + 1, z0 + 1, y, ry=types[PLAYER][0][1]))
@@ -161,7 +161,7 @@ def main():
cz = z0 + 3 + (k // cols) * sp
new.append(srec(types[nm][0], cx, cz, y))
placed.append((nm, cx, cz))
# Münzen auf dem Parkour, Ausgang (LevelDoor) auf der Zielplattform
# coins on the parkour, exit (LevelDoor) on the goal platform
if 'Coin' in types:
for (cx, cz, ty) in steps:
new.append(srec(types['Coin'][0], cx, cz, ty + 0.5))
@@ -170,7 +170,7 @@ def main():
m['strats'] = new
m['strat_x'] = max(m['strat_x'], len(new) + 64)
m['vcol'] = b''.join(m['vcol_split'])
for i, t in enumerate(m['tiles']): # Konsistenz
for i, t in enumerate(m['tiles']): # consistency
assert 0 <= int(t[0] - 0.5) < m['W'] and 0 <= int(-t[2] - 0.5) < m['H'], (i, t)
data = M.build(m, wf)
@@ -183,9 +183,9 @@ def main():
c = wadtool.get(wch, 'NAME')
c[1] = c[1][:4] + a.name.encode('latin1') + b'\0'
wadtool.write(a.dst, wch)
print(f'{len(m["tiles"])} Tiles, {len(new)} Strats ({len(placed)} Typen im Raster) -> {a.dst}')
print(f'{len(m["tiles"])} Tiles, {len(new)} Strats ({len(placed)} types in the grid) -> {a.dst}')
for nm, cx, cz in placed:
print(f' {nm:30s} Zelle ({cx},{cz})')
print(f' {nm:30s} cell ({cx},{cz})')
if __name__ == '__main__':