Built from his photos: white 5-door wedge, black bumpers + belt-line rubbing strip, amber corner indicators, wide dark grille bezel (pale headlights vanish on white paint without it), and the crown jewel -- rear hatch louvres, five slats that shed one by one on impact like a dropped pie. New optional spec keys: louvres, indicators, side_strip, wide_grille; build_cars.py now takes `-- <id>` to rebuild a single car; screenshot harness gains cam=rear. Reversed-stats rule applied: 54 kW carby IRL -> 21.0 power / 860 kg / 7.8 grip here. Second-quickest thing in the game behind the Excel, and the chuckable-est. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
55 lines
2.2 KiB
GDScript
55 lines
2.2 KiB
GDScript
extends SceneTree
|
|
## Boot straight into the game and save a viewport screenshot (needs a window, not --headless):
|
|
## Godot --path . --script tests/screenshot.gd -- car=datto_120y mode=cruise out=shot.png frames=90 throttle=1
|
|
## Defaults: first car, cruise, screenshot.png, 90 physics frames, throttle held.
|
|
|
|
func _initialize() -> void:
|
|
_run()
|
|
|
|
func _run() -> void:
|
|
var opts := {}
|
|
for a in OS.get_cmdline_user_args():
|
|
var kv := a.split("=")
|
|
if kv.size() == 2:
|
|
opts[kv[0]] = kv[1]
|
|
var cars := Registry.cars()
|
|
Game.car_path = cars.get(opts.get("car", ""), cars.values()[0])
|
|
var levels := Registry.levels()
|
|
Game.level_path = levels.get(opts.get("level", ""), levels.values()[0])
|
|
Game.mode = opts.get("mode", "cruise")
|
|
Game.junction = {}
|
|
if opts.has("jct"): # jct=<index> within the chosen level's junction events
|
|
var jcts := Registry.junctions().filter(func(j): return j.level_path == Game.level_path)
|
|
Game.junction = jcts[int(opts["jct"])].data
|
|
Game.mode = "junction"
|
|
var game: Game = (load("res://src/game.tscn") as PackedScene).instantiate()
|
|
root.add_child(game)
|
|
await process_frame
|
|
if opts.get("throttle", "1") == "1":
|
|
Input.action_press("throttle")
|
|
for i in int(opts.get("frames", "90")):
|
|
await physics_frame
|
|
if opts.get("cam", "") == "front":
|
|
game.set_process(false) # stop the chase cam fighting us
|
|
game.cam.global_position = game.car.global_position + game.car.global_basis * Vector3(2.6, 1.6, -6.5)
|
|
game.cam.look_at(game.car.global_position + Vector3.UP * 0.4)
|
|
await process_frame
|
|
await process_frame
|
|
elif opts.get("cam", "") == "rear":
|
|
game.set_process(false)
|
|
game.cam.global_position = game.car.global_position + game.car.global_basis * Vector3(2.6, 1.6, 6.5)
|
|
game.cam.look_at(game.car.global_position + Vector3.UP * 0.4)
|
|
await process_frame
|
|
await process_frame
|
|
elif opts.get("cam", "") == "top":
|
|
game.set_process(false)
|
|
var alt := float(opts.get("alt", "150"))
|
|
game.cam.far = 4000.0
|
|
game.cam.global_position = game.car.global_position + Vector3(0, alt, 0)
|
|
game.cam.look_at(game.car.global_position, Vector3.FORWARD)
|
|
await process_frame
|
|
await process_frame
|
|
root.get_texture().get_image().save_png("res://" + opts.get("out", "screenshot.png"))
|
|
print("screenshot saved")
|
|
quit(0)
|