-- A painted room in 3D, the shape Grim Fandango has: the backdrop is a picture on a flat mesh, a -- pillar that is only in the picture is an occluder -- an invisible box that hides what walks -- behind it -- and a character crosses the room behind it and comes out the other side. return { title = "Author test: painted room", size = { w = 720, h = 480 }, layers = { { kind = "scene3d", ambient = { r = 120, g = 120, b = 130 }, sun = false, fov = 50 }, { kind = "overlay" } }, vars = { score = 0 }, types = { painting = { look = { kind = "mesh", shape = "box", w = 16, h = 9, d = 0.2, r = 255, g = 255, b = 255, texture = "testScripts/hills.png", unlit = true } }, pillar = { look = { kind = "mesh", shape = "box", w = 1.6, h = 5, d = 1.6, occluder = true } }, floor = { look = { kind = "mesh", shape = "box", w = 20, h = 0.2, d = 12, r = 90, g = 90, b = 90 }, behaviours = { { kind = "solid" } } }, hero = { look = { kind = "model", file = "testScripts/Models/Fox.glb", scale = 0.012, clip = "Walk", w = 0.8, h = 1, d = 1.5 }, behaviours = { { kind = "seek", target = "far", speed = 2.2, stopAt = 0.3 } } }, marker = { look = { kind = "none" } }, camera = { look = { kind = "none" }, behaviours = { { kind = "camera", mode = "fixed", lookX = 0, lookY = 1.2, lookZ = -4 } } }, readout = { look = { kind = "text", text = "", r = 235, g = 235, b = 245 } } }, rooms = { { name = "hall", entities = { { type = "painting", id = "painting", x = 0, y = 3, z = -9 }, { type = "floor", id = "floor", x = 0, y = -0.1, z = -4 }, { type = "pillar", id = "pillar", x = 0, y = 2.5, z = -4 }, { type = "hero", id = "hero", x = -5, y = 0, z = -6 }, { type = "marker", id = "far", x = 5, y = 0, z = -6, ry = 90, scale = 2 }, { type = "camera", id = "camera", x = 0, y = 2.2, z = 5 }, { type = "readout", id = "readout", x = 12, y = 12, z = 0 } } } }, rules = { { note = "Across the room", on = "arrived", type = "hero", act = { { "setVar", name = "across", value = true } } }, { note = "The readout, every frame", on = "frame", act = { { "setText", entity = "readout", text = '"the hero is at " .. floor(hero.x * 10) / 10' } } } } }