extends Node ## Look-dev sheet for the Schlundkrone (G2): the boss in several clips next to a troop, a hero ## and an attack champion on the Mid platform, seen from the real game camera. Iteration aid. ## Run: godot --path . --resolution 1920x1080 res://tools/luneraria/g2_boss_sheet.tscn -- --out=/tmp/boss/ [--zoom=12] [--yaw=0] const Game = preload("res://scripts/luneraria/lune_game.gd") const UnitView = preload("res://scripts/luneraria/view/lune_unit_view.gd") const POSES: Array = [["idle", 1.0], ["walk", .4], ["attack_a", .7], ["attack_a", .92], ["attack_b", .92], ["hit", .08], ["ability", .95], ["roar", 1.0], ["victory", .5], ["death", 2.2]] var out: String = "/tmp/boss/" var zoom: float = 12.0 var yaw_steps: int = 0 var game: Node3D func _ready() -> void: for arg: String in OS.get_cmdline_user_args(): if arg.begins_with("--out="): out = arg.get_slice("=", 1) if not out.ends_with("/"): out += "/" elif arg.begins_with("--zoom="): zoom = float(arg.get_slice("=", 1)) elif arg.begins_with("--yaw="): yaw_steps = int(arg.get_slice("=", 1)) call_deferred("run") func run() -> void: Soundscape.enabled = false game = Game.new() add_child(game) game.start({"seed": 4, "human_slot": 1}) await get_tree().process_frame game.hud.visible = false var state: LuneMatch = game.match_state var display := LuneCombat.new(state.map, state.balance, 7) var hero := LuneContent.hero_definition({"hero_id": "held_ringborke", "xp": 0, "items": [], "talents": []}) var entries: Array = [["troop", DataCatalog.get_unit("w01"), Vector2(-3.4, 1.0)], ["hero", hero, Vector2(-2.2, 1.0)], ["champion", LuneContent.champion_definition("ch_belagerung", 7, state.balance), Vector2(-.8, 1.0)], ["boss", LuneContent.boss_definition(7, state.balance, true), Vector2(1.8, .6)]] var boss_view: Node3D for entry: Array in entries: var unit: LuneUnit = display.spawn_at(entry[0], 0 if entry[0] != "boss" else 2, "lane", entry[1], entry[2], -1, "sheet") unit.facing = 0.0 var view: Node3D = UnitView.new() view.terrain = game.world.terrain view.ground = game.world.height_at add_child(view) view.bind(unit) view.rotation.y = 0.0 if entry[0] == "boss": boss_view = view game.camera._goal_yaw = yaw_steps * PI * .25 game.camera.look_at_point(Vector3(0, 0, 0.6), zoom, true) DirAccess.make_dir_recursive_absolute(out) for pose: Array in POSES: var clip: String = pose[0] for i: int in range(6): if boss_view.model.has_method("preview"): boss_view.model.preview(clip, float(pose[1])) await get_tree().process_frame await RenderingServer.frame_post_draw var label: String = "%s-%03d" % [clip, int(float(pose[1]) * 100)] get_viewport().get_texture().get_image().save_png(out + label + ".png") print("SHEET ", label) get_tree().quit()