first commit
This commit is contained in:
150
tests/shots.gd
Normal file
150
tests/shots.gd
Normal file
@@ -0,0 +1,150 @@
|
||||
extends Node
|
||||
## Fährt das Spiel mit Fenster und legt Screenshots ab, um die Welt
|
||||
## auch optisch zu prüfen.
|
||||
|
||||
const OUT := "user://shots/"
|
||||
var main: Node3D
|
||||
var n := 0
|
||||
|
||||
|
||||
func _process(_d: float) -> void:
|
||||
# Maus des Nutzers nicht einfangen, während die Bilder entstehen
|
||||
Input.mouse_mode = Input.MOUSE_MODE_VISIBLE
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
DirAccess.make_dir_recursive_absolute(ProjectSettings.globalize_path(OUT))
|
||||
main = load("res://scenes/main.tscn").instantiate()
|
||||
add_child(main)
|
||||
await get_tree().process_frame
|
||||
await get_tree().process_frame
|
||||
await knipse("01_intro")
|
||||
|
||||
main.ui.schliessen()
|
||||
main.player.global_position = Vector3(0, 3.0, 26.0)
|
||||
main.player.yaw = 0.0
|
||||
main.player.pitch = -0.10
|
||||
await warte(20)
|
||||
await knipse("02_traumwelt")
|
||||
|
||||
main.player.global_position = Vector3(-24, 2.0, 4.0)
|
||||
main.player.yaw = 0.0
|
||||
main.player.pitch = -0.02
|
||||
await warte(20)
|
||||
await knipse("03_bibliothek_aussen")
|
||||
|
||||
Game.teleport_lock = 0.0
|
||||
main.player.global_position = Vector3(0, -299.0, 2.0)
|
||||
main.player.yaw = 0.0
|
||||
main.player.pitch = -0.12
|
||||
await warte(30)
|
||||
await knipse("04_bibliothek_innen")
|
||||
|
||||
main.ui.technik_panel("pomodoro")
|
||||
await warte(6)
|
||||
await knipse("05_technik_hinweise")
|
||||
main.ui.schliessen()
|
||||
|
||||
Game.learn("pomodoro")
|
||||
Game.learn("zerlegen")
|
||||
Game.learn("box_atmung")
|
||||
|
||||
main.player.global_position = Vector3(90, -299.0, 2.0)
|
||||
main.player.yaw = 0.0
|
||||
main.player.pitch = -0.08
|
||||
await warte(20)
|
||||
await knipse("06_missionshalle")
|
||||
|
||||
main.ui.mission_panel("lena")
|
||||
await warte(6)
|
||||
await knipse("07_mission_panel")
|
||||
main.ui.schliessen()
|
||||
Game.accept_mission("lena")
|
||||
|
||||
main.ui.kodex_panel()
|
||||
await warte(6)
|
||||
await knipse("08_kodex")
|
||||
main.ui.schliessen()
|
||||
|
||||
Game.teleport_lock = 0.0
|
||||
main.player.global_position = Vector3(-90, -299.0, 5.0)
|
||||
main.player.yaw = 0.0
|
||||
main.player.pitch = -0.1
|
||||
await warte(20)
|
||||
await knipse("08b_meditation")
|
||||
main.ui.vertiefen_panel()
|
||||
await warte(6)
|
||||
await knipse("08c_vertiefen")
|
||||
main.ui.schliessen()
|
||||
|
||||
main._erde()
|
||||
Game.time_h = 10.5
|
||||
await warte(40)
|
||||
main.player.global_position = Vector3(0, 26.0, 42.0)
|
||||
main.player.pitch = -0.62
|
||||
main.player.yaw = 0.0
|
||||
await warte(20)
|
||||
await knipse("09_erde_uebersicht")
|
||||
|
||||
var lena: Human = null
|
||||
for m in main.welt.humans:
|
||||
if m.data["id"] == "lena":
|
||||
lena = m
|
||||
for i in range(900):
|
||||
main._process(0.05)
|
||||
for k in main.welt.get_children():
|
||||
if k is Human:
|
||||
k._process(0.05)
|
||||
Game.time_h = 10.5
|
||||
if lena.place == "haus_lena" and lena._path.is_empty():
|
||||
break
|
||||
main.player.global_position = lena.global_position + Vector3(0, 1.2, -4.5)
|
||||
main.player.yaw = PI
|
||||
main.player.pitch = -0.15
|
||||
await warte(20)
|
||||
await knipse("10_lena_zoegert")
|
||||
|
||||
main.ui.anwenden_panel(lena)
|
||||
await warte(6)
|
||||
await knipse("11_anwenden")
|
||||
main.ui._anwenden("pomodoro")
|
||||
await warte(25)
|
||||
await knipse("12_reaktion")
|
||||
|
||||
Game.time_h = 13.5
|
||||
for i in range(1200):
|
||||
main._process(0.05)
|
||||
for k in main.welt.get_children():
|
||||
if k is Human:
|
||||
k._process(0.05)
|
||||
Game.time_h = 13.5
|
||||
main.player.global_position = Vector3(0, 11.0, -14.0)
|
||||
main.player.yaw = PI
|
||||
main.player.pitch = -0.5
|
||||
await warte(20)
|
||||
await knipse("13_cafe_mittag")
|
||||
|
||||
Game.time_h = 22.5
|
||||
await warte(40)
|
||||
main.player.global_position = Vector3(0, 18.0, 34.0)
|
||||
main.player.yaw = 0.0
|
||||
main.player.pitch = -0.5
|
||||
await warte(20)
|
||||
await knipse("14_nacht")
|
||||
|
||||
print("Screenshots: %d" % n)
|
||||
print("Ordner: %s" % ProjectSettings.globalize_path(OUT))
|
||||
get_tree().quit()
|
||||
|
||||
|
||||
func warte(frames: int) -> void:
|
||||
for i in range(frames):
|
||||
await get_tree().process_frame
|
||||
|
||||
|
||||
func knipse(bezeichnung: String) -> void:
|
||||
await RenderingServer.frame_post_draw
|
||||
var img := get_viewport().get_texture().get_image()
|
||||
img.save_png(OUT + bezeichnung + ".png")
|
||||
n += 1
|
||||
print(" Bild: " + bezeichnung)
|
||||
Reference in New Issue
Block a user