From 4a564dc3f548845dea5e9d2814d94502f076428f Mon Sep 17 00:00:00 2001 From: Clevertop Date: Sat, 10 Aug 2024 21:55:26 +1000 Subject: [PATCH] pedestals working --- Assets/Materials/green_floor.tres | 14 +++++++++++ Commands/command_pedestal.gd | 16 ++++++++++++ Commands/command_pedestal.tscn | 25 ++++++++++++++++++ Levels/StartingRoom.tscn | 42 ++++++++++++++++++++++++++++--- Scripts/ChronoManager.gd | 8 +++--- Scripts/Player.gd | 13 ++++++++++ 6 files changed, 109 insertions(+), 9 deletions(-) create mode 100644 Assets/Materials/green_floor.tres create mode 100644 Commands/command_pedestal.gd create mode 100644 Commands/command_pedestal.tscn diff --git a/Assets/Materials/green_floor.tres b/Assets/Materials/green_floor.tres new file mode 100644 index 0000000..09760d0 --- /dev/null +++ b/Assets/Materials/green_floor.tres @@ -0,0 +1,14 @@ +[gd_resource type="StandardMaterial3D" load_steps=2 format=3 uid="uid://didvwdmm46bmq"] + +[sub_resource type="CompressedTexture2D" id="CompressedTexture2D_78k07"] +load_path = "res://.godot/imported/stone_2_gray_0.png-9d16a4858afb7acd70485069983b75ce.s3tc.ctex" + +[resource] +albedo_color = Color(0.325915, 1, 0.29823, 1) +albedo_texture = SubResource("CompressedTexture2D_78k07") +emission = Color(1, 1, 1, 1) +subsurf_scatter_strength = 1.0 +uv1_scale = Vector3(3, 2, 1) +uv1_triplanar_sharpness = 0.0583145 +uv2_triplanar_sharpness = 0.170755 +texture_filter = 0 diff --git a/Commands/command_pedestal.gd b/Commands/command_pedestal.gd new file mode 100644 index 0000000..12d34c2 --- /dev/null +++ b/Commands/command_pedestal.gd @@ -0,0 +1,16 @@ +extends Node3D +class_name Pedestal + +@export var placed_command : Node3D +@export var has_command : bool = false +@export var slot : Node3D + + +# Called when the node enters the scene tree for the first time. +func _ready(): + pass # Replace with function body. + + +# Called every frame. 'delta' is the elapsed time since the previous frame. +func _process(delta): + pass diff --git a/Commands/command_pedestal.tscn b/Commands/command_pedestal.tscn new file mode 100644 index 0000000..384a525 --- /dev/null +++ b/Commands/command_pedestal.tscn @@ -0,0 +1,25 @@ +[gd_scene load_steps=5 format=3 uid="uid://cq4rfdsc5kghr"] + +[ext_resource type="Script" path="res://Commands/command_pedestal.gd" id="1_02nqv"] +[ext_resource type="Material" uid="uid://cr4ra7ijk1uec" path="res://Assets/Materials/floor.tres" id="2_rgb2l"] + +[sub_resource type="BoxMesh" id="BoxMesh_hrk6g"] +material = ExtResource("2_rgb2l") +size = Vector3(0.8, 1, 0.8) + +[sub_resource type="ConcavePolygonShape3D" id="ConcavePolygonShape3D_8evcs"] +data = PackedVector3Array(-0.4, 0.5, 0.4, 0.4, 0.5, 0.4, -0.4, -0.5, 0.4, 0.4, 0.5, 0.4, 0.4, -0.5, 0.4, -0.4, -0.5, 0.4, 0.4, 0.5, -0.4, -0.4, 0.5, -0.4, 0.4, -0.5, -0.4, -0.4, 0.5, -0.4, -0.4, -0.5, -0.4, 0.4, -0.5, -0.4, 0.4, 0.5, 0.4, 0.4, 0.5, -0.4, 0.4, -0.5, 0.4, 0.4, 0.5, -0.4, 0.4, -0.5, -0.4, 0.4, -0.5, 0.4, -0.4, 0.5, -0.4, -0.4, 0.5, 0.4, -0.4, -0.5, -0.4, -0.4, 0.5, 0.4, -0.4, -0.5, 0.4, -0.4, -0.5, -0.4, 0.4, 0.5, 0.4, -0.4, 0.5, 0.4, 0.4, 0.5, -0.4, -0.4, 0.5, 0.4, -0.4, 0.5, -0.4, 0.4, 0.5, -0.4, -0.4, -0.5, 0.4, 0.4, -0.5, 0.4, -0.4, -0.5, -0.4, 0.4, -0.5, 0.4, 0.4, -0.5, -0.4, -0.4, -0.5, -0.4) + +[node name="CommandPedestal" type="StaticBody3D" node_paths=PackedStringArray("slot")] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.5, 0) +script = ExtResource("1_02nqv") +slot = NodePath("slot") + +[node name="MeshInstance3D" type="MeshInstance3D" parent="."] +mesh = SubResource("BoxMesh_hrk6g") + +[node name="CollisionShape3D" type="CollisionShape3D" parent="."] +shape = SubResource("ConcavePolygonShape3D_8evcs") + +[node name="slot" type="Node3D" parent="."] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.567907, 0) diff --git a/Levels/StartingRoom.tscn b/Levels/StartingRoom.tscn index b196cf6..8a7f54b 100644 --- a/Levels/StartingRoom.tscn +++ b/Levels/StartingRoom.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=26 format=3 uid="uid://bojbawyoy11i4"] +[gd_scene load_steps=27 format=3 uid="uid://bojbawyoy11i4"] [ext_resource type="Script" path="res://Scripts/ChronoManager.gd" id="1_5b2rd"] [ext_resource type="Material" uid="uid://cr4ra7ijk1uec" path="res://Assets/Materials/floor.tres" id="2_0aj3l"] @@ -9,6 +9,7 @@ [ext_resource type="Texture2D" uid="uid://dc23iehev1s8w" path="res://Assets/Textures/crystal_wall_2.png" id="6_g3qnb"] [ext_resource type="Texture2D" uid="uid://bb8771vptn2l8" path="res://Assets/Textures/transparent_wall_new.png" id="6_nv7xj"] [ext_resource type="Texture2D" uid="uid://dd150xco2ee5q" path="res://Assets/Textures/cobalt_stone_4.png" id="7_qjeey"] +[ext_resource type="PackedScene" uid="uid://cq4rfdsc5kghr" path="res://Commands/command_pedestal.tscn" id="10_sghta"] [sub_resource type="BoxMesh" id="BoxMesh_21vdj"] material = ExtResource("2_0aj3l") @@ -104,9 +105,10 @@ material = SubResource("StandardMaterial3D_itc1d") [sub_resource type="BoxShape3D" id="BoxShape3D_y4l56"] -[node name="ChronoManager" type="Node3D" node_paths=PackedStringArray("gui")] +[node name="ChronoManager" type="Node3D" node_paths=PackedStringArray("gui", "pedestals")] script = ExtResource("1_5b2rd") gui = NodePath("Gui") +pedestals = [NodePath("Pedestals/CommandPedestal"), NodePath("Pedestals/CommandPedestal2"), NodePath("Pedestals/CommandPedestal3"), NodePath("Pedestals/CommandPedestal4"), NodePath("Pedestals/CommandPedestal5"), NodePath("Pedestals/CommandPedestal6"), NodePath("Pedestals/CommandPedestal7"), NodePath("Pedestals/CommandPedestal8"), NodePath("Pedestals/CommandPedestal9"), NodePath("Pedestals/CommandPedestal10")] [node name="Player" parent="." instance=ExtResource("2_hsi55")] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 2.12895, 0) @@ -115,9 +117,9 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 2.12895, 0) mesh_library = SubResource("MeshLibrary_udrkc") cell_size = Vector3(1, 1, 1) data = { -"cells": PackedInt32Array(65532, 65526, 851968, 65531, 65526, 851968, 65530, 65526, 851968, 65529, 65526, 851968, 65528, 65526, 851968, 65527, 65526, 851968, 65526, 65526, 851968, 65525, 65526, 851968, 65526, 65525, 851968, 65527, 65525, 851968, 65528, 65525, 851968, 65529, 65525, 851968, 65530, 65525, 851968, 65531, 65525, 851968, 65532, 65525, 851968, 65533, 65525, 851968, 65525, 65525, 851968, 65524, 65525, 851968, 65524, 65526, 851968, 65523, 65525, 851968, 65523, 65526, 851968, 65522, 65527, 851968, 65523, 65527, 851968, 65523, 65528, 851968, 65523, 65529, 851968, 65523, 65530, 851968, 65523, 65531, 851968, 65523, 65532, 851968, 196595, 65525, 851968, 196596, 65525, 851968, 196597, 65525, 851968, 196598, 65525, 851968, 196599, 65525, 851968, 196600, 65525, 851968, 196601, 65525, 851968, 196602, 65525, 851968, 196603, 65525, 851968, 196604, 65525, 851968, 196605, 65526, 851968, 196604, 65526, 851968, 196603, 65526, 851968, 196602, 65526, 851968, 196601, 65526, 851968, 196600, 65526, 851968, 196599, 65526, 851968, 196598, 65526, 851968, 196597, 65526, 851968, 196596, 65526, 851968, 196595, 65526, 851968, 196594, 65526, 851968, 131059, 65526, 851968, 131060, 65526, 851968, 131061, 65526, 851968, 131062, 65526, 851968, 131062, 65527, 851968, 131063, 65527, 851968, 131064, 65527, 851968, 131065, 65527, 851968, 131066, 65527, 851968, 131066, 65526, 851968, 131067, 65526, 851968, 131068, 65526, 851968, 131065, 65526, 851968, 131064, 65526, 851968, 131063, 65526, 851968, 131056, 0, 786432, 131059, 5, 786432, 131058, 5, 786432, 131057, 5, 786432, 131056, 5, 786432, 131056, 4, 786432, 131055, 4, 786432, 131055, 3, 786432, 131055, 2, 786432, 131056, 2, 786432, 131056, 1, 786432, -65550, 0, 786432, -65549, 0, 786432, -13, 0, 786432, -12, 0, 786432, 65524, 0, 786432, 65523, 0, 786432, 131059, 0, 786432, 131058, 0, 786432, 65522, 0, 786432, -14, 0, 786432, 65521, 0, 786432, -15, 0, 786432, 196594, 0, 786432, 196593, 0, 786432, 131057, 0, 786432, 65520, 0, 786432, -16, 0, 786432, -65551, 0, 786432, -131087, 0, 786432, -196623, 0, 786432, -196622, 0, 786432, -131086, 0, 786432, 262130, 0, 786432, 262129, 0, 786432, 327665, 0, 786432, 262128, 0, 786432, 196592, 0, 786432, -196621, 0, 786432, -131085, 0, 786432, -65548, 0, 786432, 196595, 0, 786432, -262158, 0, 786432, -262157, 0, 786432, -131084, 0, 786432, -65547, 0, 786432, -11, 0, 786432, 65525, 0, 786432, 131061, 0, 786432, 196597, 0, 786432, 196596, 0, 786432, 262132, 0, 786432, 327667, 0, 786432, 393203, 0, 786432, 393202, 0, 786432, 393201, 0, 786432, 327664, 0, 786432, 131055, 0, 786432, 65519, 0, 786432, -17, 0, 786432, -65552, 0, 786432, -131088, 0, 786432, -262160, 0, 786432, -327694, 0, 786432, -327693, 0, 786432, -262156, 0, 786432, -196620, 0, 786432, 131060, 0, 786432, 262131, 0, 786432, 327666, 0, 786432, -65553, 0, 786432, -131089, 0, 786432, -196625, 0, 786432, -196624, 0, 786432, -262159, 0, 786432, -327695, 0, 786432, 65527, 16, 393216, 65528, 16, 393216, 65529, 16, 393216, 65530, 16, 393216, 65531, 17, 393216, 65531, 18, 393216, 65531, 19, 393216, 65531, 20, 393216, 65530, 21, 393216, 65529, 21, 393216, 1, 16, 393216, 2, 17, 393216, 2, 18, 393216, 2, 19, 393216, 1, 20, 393216, 0, 20, 393216, 65535, 20, 393216, 65534, 19, 393216, 65534, 18, 393216, 65528, 21, 393216, 65527, 21, 393216, 65526, 20, 393216, 65526, 19, 393216, 65526, 17, 393216, 65526, 18, 393216, 65534, 17, 393216, 65535, 16, 393216, 65535, 0, 1245186, 65535, 65535, 1245186, 0, 65535, 1245186, 0, 0, 1245186, 65534, 1, 1245185, 65534, 0, 1245185, 65534, 65535, 1245185, 65534, 65534, 1245185, 1, 65535, 1245185, 1, 0, 1245185, 1, 1, 1245185, 0, 1, 1245185, 65535, 1, 1245185, 2, 1, 1245185, 2, 0, 1245185, 2, 65535, 1245185, 2, 65533, 1245185, 1, 65533, 1245185, 0, 65533, 1245185, 65535, 65533, 1245185, 65533, 65534, 1245185, 65533, 65535, 1179649, 65533, 0, 1179649, 65533, 1, 1179649, 65533, 2, 1179649, 65534, 2, 1179649, 65535, 2, 1179649, 0, 2, 1179649, 1, 2, 1179649, 2, 2, 1179649, 65532, 3, 1179649, 65532, 2, 1179649, 65532, 1, 1179649, 65532, 0, 1179649, 65532, 65535, 1179649, 65532, 65534, 1179649, 65532, 65532, 1179649, 65533, 65532, 1179649, 65534, 65532, 1179649, 65535, 65532, 1179649, 0, 65532, 1179649, 1, 65532, 1179649, 2, 65532, 1179649, 3, 65532, 1179649, 3, 65533, 1179649, 3, 65535, 1179649, 3, 0, 1179649, 3, 1, 1179649, 3, 2, 1179649, 3, 3, 1179649, 2, 3, 1179649, 1, 3, 1179649, 0, 3, 1179649, 65535, 3, 1179649, 65534, 3, 1179649, 65533, 3, 1179649, 65531, 65531, 1179649, 65531, 65532, 1179649, 65531, 65534, 1179649, 65531, 65535, 1179649, 65531, 0, 1179649, 65531, 1, 1179649, 65531, 2, 1179649, 65531, 3, 1179649, 65531, 4, 1179649, 65532, 4, 1179649, 65533, 4, 1179649, 65534, 4, 1179649, 65535, 4, 1179649, 0, 4, 1179649, 1, 4, 1179649, 2, 4, 1179649, 3, 4, 1179649, 4, 4, 1179649, 4, 3, 1179649, 4, 2, 1179649, 4, 1, 1179649, 4, 0, 1179649, 4, 65535, 1179649, 4, 65533, 1179649, 4, 65532, 1179649, 4, 65531, 1179649, 3, 65531, 1179649, 2, 65531, 1179649, 1, 65531, 1179649, 0, 65531, 1179649, 65535, 65531, 1179649, 65534, 65531, 1179649, 65533, 65531, 1179649, 65532, 65531, 1179649, 131069, 3, 1179650, 131070, 3, 1179650, 131071, 3, 1179650, 65536, 3, 1179650, 65537, 3, 1179650, 65538, 3, 1179650, 65539, 2, 1179650, 65539, 1, 1179650, 131068, 1, 1179650, 131068, 2, 1179650, 131066, 4, 3, 131066, 3, 3, 131066, 2, 3, 131066, 1, 3, 131066, 0, 3, 131066, 65535, 3, 131066, 65534, 3, 131066, 65533, 3, 131066, 65532, 3, 131066, 65531, 3, 131066, 65530, 3, 131067, 65530, 3, 131068, 65530, 3, 0, 65530, 1179650, 65535, 65530, 1179650, 131069, 65530, 3, 131070, 65530, 3, 65538, 65530, 3, 65537, 65530, 3, 65539, 65530, 3, 65540, 65530, 3, 65541, 4, 3, 65541, 3, 3, 65541, 2, 3, 65541, 1, 3, 65541, 0, 3, 65541, 65535, 3, 65541, 65534, 3, 65541, 65533, 3, 65541, 65532, 3, 65541, 65531, 3, 65541, 65530, 3, 65541, 5, 3, 65540, 5, 3, 65539, 5, 3, 65538, 5, 3, 65537, 5, 3, 65536, 5, 3, 131071, 5, 3, 131070, 5, 3, 131069, 5, 3, 131068, 5, 3, 131067, 5, 3, 131066, 5, 3, 196602, 5, 3, 262138, 5, 1179651, 196602, 4, 3, 196602, 3, 3, 196602, 2, 3, 196602, 1, 3, 196602, 0, 3, 196602, 65535, 3, 196602, 65534, 3, 196602, 65533, 3, 196602, 65532, 3, 196602, 65531, 3, 196602, 65530, 3, 262138, 65530, 1179651, 262138, 65531, 1179651, 262138, 65532, 1179651, 262138, 65533, 1179651, 262138, 65534, 1179651, 262138, 65535, 1179651, 262138, 0, 1179651, 262138, 1, 1179651, 262138, 2, 1179651, 262138, 3, 1179651, 262138, 4, 1179651, 196613, 5, 3, 196613, 4, 3, 196613, 3, 3, 196613, 2, 3, 196613, 1, 3, 196613, 0, 3, 196613, 65535, 3, 196613, 65534, 3, 196613, 65533, 3, 196613, 65532, 3, 196613, 65531, 3, 196613, 65530, 3, 131077, 65530, 3, 131077, 65531, 3, 131077, 65532, 3, 131077, 65533, 3, 131077, 65534, 3, 131077, 65535, 3, 131077, 0, 3, 131077, 1, 3, 131077, 2, 3, 131077, 3, 3, 131077, 4, 3, 131077, 5, 3, 131076, 5, 3, 131075, 5, 3, 131074, 5, 3, 131073, 5, 3, 131072, 5, 3, 196607, 5, 3, 196606, 5, 3, 196605, 5, 3, 196604, 5, 3, 196603, 5, 3, 262139, 5, 3, 262140, 5, 3, 262141, 5, 3, 262142, 5, 3, 262143, 5, 3, 196608, 5, 3, 196609, 5, 3, 196610, 5, 3, 196611, 5, 3, 196612, 5, 3, 196603, 65530, 3, 196604, 65530, 3, 196605, 65530, 3, 196606, 65530, 3, 131073, 65530, 3, 131074, 65530, 3, 131075, 65530, 3, 131076, 65530, 3, 262139, 65530, 1179651, 262140, 65530, 1179651, 262141, 65530, 1179651, 262142, 65530, 1179651, 196609, 65530, 1179651, 196610, 65530, 1179651, 196611, 65530, 1179651, 196612, 65530, 1179651, 1, 65530, 0, 2, 65530, 0, 3, 65530, 0, 4, 65530, 0, 5, 65530, 0, 5, 65531, 0, 5, 65532, 0, 5, 65533, 0, 5, 65535, 0, 5, 0, 0, 5, 1, 0, 5, 2, 0, 5, 3, 0, 5, 4, 0, 5, 5, 0, 65530, 5, 0, 65531, 5, 0, 65532, 5, 0, 65533, 5, 0, 65534, 5, 0, 65535, 5, 0, 0, 5, 0, 1, 5, 0, 2, 5, 0, 3, 5, 0, 4, 5, 0, 65530, 65530, 0, 65530, 65531, 0, 65530, 65533, 0, 65530, 65534, 0, 65530, 65535, 0, 65530, 0, 0, 65530, 1, 0, 65530, 2, 0, 65530, 3, 0, 65530, 4, 0, 65531, 65530, 0, 65532, 65530, 0, 65533, 65530, 0, 65534, 65530, 0, 5, 65534, 0, 4, 65534, 1179649, 3, 65534, 1179649, 2, 65534, 1245185, 1, 65534, 1245185, 0, 65534, 1245185, 65535, 65534, 1245185, 65534, 65533, 1245185, 65533, 65533, 1245185, 65532, 65533, 1179649, 65531, 65533, 1179649, 65530, 65532, 0, 327674, 65530, 1179651, 327674, 65531, 1179651, 327674, 65532, 1179651, 327674, 65533, 1179651, 327674, 65534, 1179651, 327674, 65535, 1179651, 327674, 0, 1179651, 327674, 1, 1179651, 327674, 2, 1179651, 327674, 3, 1179651, 327674, 4, 1179651, 327674, 5, 1179651, 327675, 65530, 1179651, 327675, 5, 3, 327676, 65530, 1179651, 327676, 5, 3, 327677, 65530, 1179651, 327677, 5, 3, 327678, 65530, 1179651, 327678, 5, 3, 327679, 5, 3, 262144, 5, 3, 262145, 65530, 1179651, 262145, 5, 3, 262146, 65530, 1179651, 262146, 5, 3, 262147, 65530, 1179651, 262147, 5, 3, 262148, 65530, 1179651, 262148, 5, 3, 262149, 65530, 3, 262149, 65531, 3, 262149, 65532, 3, 262149, 65533, 3, 262149, 65534, 3, 262149, 65535, 3, 262149, 0, 3, 262149, 1, 3, 262149, 2, 3, 262149, 3, 3, 262149, 4, 3, 262149, 5, 3, 393210, 65530, 1179651, 393210, 65531, 1179651, 393210, 65532, 1179651, 393210, 65533, 1179651, 393210, 65534, 1179651, 393210, 65535, 1179651, 393210, 0, 1179651, 393210, 1, 1179651, 393210, 2, 1179651, 393210, 3, 1179651, 393210, 4, 1179651, 393210, 5, 1179651, 393211, 65530, 1179651, 393211, 5, 3, 393212, 65530, 1179651, 393212, 5, 3, 393213, 65530, 1179651, 393213, 5, 3, 393214, 65530, 1179651, 393214, 5, 3, 393215, 5, 3, 327680, 5, 3, 327681, 65530, 1179651, 327681, 5, 3, 327682, 65530, 1179651, 327682, 5, 3, 327683, 65530, 1179651, 327683, 5, 3, 327684, 65530, 1179651, 327684, 5, 3, 327685, 65530, 3, 327685, 65531, 3, 327685, 65532, 3, 327685, 65533, 3, 327685, 65534, 3, 327685, 65535, 3, 327685, 0, 3, 327685, 1, 3, 327685, 2, 3, 327685, 3, 3, 327685, 4, 3, 327685, 5, 3, 458746, 65530, 1, 458746, 65531, 1, 458746, 65532, 1, 458746, 65533, 1, 458746, 65534, 1, 458746, 65535, 1, 458746, 0, 1, 458746, 1, 1, 458746, 2, 1, 458746, 3, 1, 458746, 4, 1, 458746, 5, 1, 458747, 65530, 1, 458747, 65531, 1, 458747, 65532, 1, 458747, 65533, 1, 458747, 65534, 1, 458747, 65535, 1, 458747, 0, 1, 458747, 1, 1, 458747, 2, 1, 458747, 3, 1, 458747, 4, 1, 458747, 5, 1, 458748, 65530, 1, 458748, 65531, 1, 458748, 65532, 1, 458748, 65533, 1, 458748, 65534, 1, 458748, 65535, 1, 458748, 0, 1, 458748, 1, 1, 458748, 2, 1, 458748, 3, 1, 458748, 4, 1, 458748, 5, 1, 458749, 65530, 1, 458749, 65531, 1, 458749, 65532, 1, 458749, 65533, 1, 458749, 65534, 1, 458749, 65535, 1, 458749, 0, 1, 458749, 1, 1, 458749, 2, 1, 458749, 3, 1, 458749, 4, 1, 458749, 5, 1, 458750, 65530, 1, 458750, 65531, 1, 458750, 65532, 1, 458750, 65533, 1, 458750, 65534, 1, 458750, 65535, 1, 458750, 0, 1, 458750, 1, 1, 458750, 2, 1, 458750, 3, 1, 458750, 4, 1, 458750, 5, 1, 458751, 65530, 1, 458751, 65531, 1, 458751, 65532, 1, 458751, 65533, 1, 458751, 65534, 1, 458751, 65535, 1, 458751, 0, 1, 458751, 1, 1, 458751, 2, 1, 458751, 3, 1, 458751, 4, 1, 458751, 5, 1, 393216, 65530, 1, 393216, 65531, 1, 393216, 65532, 1, 393216, 65533, 1, 393216, 65534, 1, 393216, 65535, 1, 393216, 0, 1, 393216, 1, 1, 393216, 2, 1, 393216, 3, 1, 393216, 4, 1, 393216, 5, 1, 393217, 65530, 1, 393217, 65531, 1, 393217, 65532, 1, 393217, 65533, 1, 393217, 65534, 1, 393217, 65535, 1, 393217, 0, 1, 393217, 1, 1, 393217, 2, 1, 393217, 3, 1, 393217, 4, 1, 393217, 5, 1, 393218, 65530, 1, 393218, 65531, 1, 393218, 65532, 1, 393218, 65533, 1, 393218, 65534, 1, 393218, 65535, 1, 393218, 0, 1, 393218, 1, 1, 393218, 2, 1, 393218, 3, 1, 393218, 4, 1, 393218, 5, 1, 393219, 65530, 1, 393219, 65531, 1, 393219, 65532, 1, 393219, 65533, 1, 393219, 65534, 1, 393219, 65535, 1, 393219, 0, 1, 393219, 1, 1, 393219, 2, 1, 393219, 3, 1, 393219, 4, 1, 393219, 5, 1, 393220, 65530, 1, 393220, 65531, 1, 393220, 65532, 1, 393220, 65533, 1, 393220, 65534, 1, 393220, 65535, 1, 393220, 0, 1, 393220, 1, 1, 393220, 2, 1, 393220, 3, 1, 393220, 4, 1, 393220, 5, 1, 393221, 65530, 1, 393221, 65531, 1, 393221, 65532, 1, 393221, 65533, 1, 393221, 65534, 1, 393221, 65535, 1, 393221, 0, 1, 393221, 1, 1, 393221, 2, 1, 393221, 3, 1, 393221, 4, 1, 393221, 5, 1, 393215, 65530, 3, 327680, 65530, 3, 262144, 65530, 3, 327679, 65530, 3, 196608, 65530, 3, 262143, 65530, 3) +"cells": PackedInt32Array(65532, 65526, 851968, 65531, 65526, 851968, 65530, 65526, 851968, 65529, 65526, 851968, 65528, 65526, 851968, 65527, 65526, 851968, 65526, 65526, 851968, 65525, 65526, 851968, 65526, 65525, 851968, 65527, 65525, 851968, 65528, 65525, 851968, 65529, 65525, 851968, 65530, 65525, 851968, 65531, 65525, 851968, 65532, 65525, 851968, 65533, 65525, 851968, 65525, 65525, 851968, 65524, 65525, 851968, 65524, 65526, 851968, 65523, 65525, 851968, 65523, 65526, 851968, 65522, 65527, 851968, 65523, 65527, 851968, 65523, 65528, 851968, 65523, 65529, 851968, 65523, 65530, 851968, 65523, 65531, 851968, 65523, 65532, 851968, 196595, 65525, 851968, 196596, 65525, 851968, 196597, 65525, 851968, 196598, 65525, 851968, 196599, 65525, 851968, 196600, 65525, 851968, 196601, 65525, 851968, 196602, 65525, 851968, 196603, 65525, 851968, 196604, 65525, 851968, 196605, 65526, 851968, 196604, 65526, 851968, 196603, 65526, 851968, 196602, 65526, 851968, 196601, 65526, 851968, 196600, 65526, 851968, 196599, 65526, 851968, 196598, 65526, 851968, 196597, 65526, 851968, 196596, 65526, 851968, 196595, 65526, 851968, 196594, 65526, 851968, 131059, 65526, 851968, 131060, 65526, 851968, 131061, 65526, 851968, 131062, 65526, 851968, 131062, 65527, 851968, 131063, 65527, 851968, 131064, 65527, 851968, 131065, 65527, 851968, 131066, 65527, 851968, 131066, 65526, 851968, 131067, 65526, 851968, 131068, 65526, 851968, 131065, 65526, 851968, 131064, 65526, 851968, 131063, 65526, 851968, 131056, 0, 786432, 131059, 5, 786432, 131058, 5, 786432, 131057, 5, 786432, 131056, 5, 786432, 131056, 4, 786432, 131055, 4, 786432, 131055, 3, 786432, 131055, 2, 786432, 131056, 2, 786432, 131056, 1, 786432, -65550, 0, 786432, -65549, 0, 786432, -13, 0, 786432, -12, 0, 786432, 65524, 0, 786432, 65523, 0, 786432, 131059, 0, 786432, 131058, 0, 786432, 65522, 0, 786432, -14, 0, 786432, 65521, 0, 786432, -15, 0, 786432, 196594, 0, 786432, 196593, 0, 786432, 131057, 0, 786432, 65520, 0, 786432, -16, 0, 786432, -65551, 0, 786432, -131087, 0, 786432, -196623, 0, 786432, -196622, 0, 786432, -131086, 0, 786432, 262130, 0, 786432, 262129, 0, 786432, 327665, 0, 786432, 262128, 0, 786432, 196592, 0, 786432, -196621, 0, 786432, -131085, 0, 786432, -65548, 0, 786432, 196595, 0, 786432, -262158, 0, 786432, -262157, 0, 786432, -131084, 0, 786432, -65547, 0, 786432, -11, 0, 786432, 65525, 0, 786432, 131061, 0, 786432, 196597, 0, 786432, 196596, 0, 786432, 262132, 0, 786432, 327667, 0, 786432, 393203, 0, 786432, 393202, 0, 786432, 393201, 0, 786432, 327664, 0, 786432, 131055, 0, 786432, 65519, 0, 786432, -17, 0, 786432, -65552, 0, 786432, -131088, 0, 786432, -262160, 0, 786432, -327694, 0, 786432, -327693, 0, 786432, -262156, 0, 786432, -196620, 0, 786432, 131060, 0, 786432, 262131, 0, 786432, 327666, 0, 786432, -65553, 0, 786432, -131089, 0, 786432, -196625, 0, 786432, -196624, 0, 786432, -262159, 0, 786432, -327695, 0, 786432, 65527, 16, 393216, 65528, 16, 393216, 65529, 16, 393216, 65530, 16, 393216, 65531, 17, 393216, 65531, 18, 393216, 65531, 19, 393216, 65531, 20, 393216, 65530, 21, 393216, 65529, 21, 393216, 1, 16, 393216, 2, 17, 393216, 2, 18, 393216, 2, 19, 393216, 1, 20, 393216, 0, 20, 393216, 65535, 20, 393216, 65534, 19, 393216, 65534, 18, 393216, 65528, 21, 393216, 65527, 21, 393216, 65526, 20, 393216, 65526, 19, 393216, 65526, 17, 393216, 65526, 18, 393216, 65534, 17, 393216, 65535, 16, 393216, 65535, 0, 1245186, 65535, 65535, 1245186, 0, 65535, 1245186, 0, 0, 1245186, 65534, 1, 1245185, 65534, 0, 1245185, 65534, 65535, 1245185, 65534, 65534, 1245185, 1, 65535, 1245185, 1, 0, 1245185, 1, 1, 1245185, 0, 1, 1245185, 65535, 1, 1245185, 2, 1, 1245185, 2, 0, 1245185, 2, 65535, 1245185, 2, 65533, 1245185, 1, 65533, 1245185, 0, 65533, 1245185, 65535, 65533, 1245185, 65533, 65534, 1245185, 65533, 65535, 1179649, 65533, 0, 1179649, 65533, 1, 1179649, 65533, 2, 1179649, 65534, 2, 1179649, 65535, 2, 1179649, 0, 2, 1179649, 1, 2, 1179649, 2, 2, 1179649, 65532, 3, 1179649, 65532, 2, 1179649, 65532, 1, 1179649, 65532, 0, 1179649, 65532, 65535, 1179649, 65532, 65534, 1179649, 65532, 65532, 1179649, 65533, 65532, 1179649, 65534, 65532, 1179649, 65535, 65532, 1179649, 0, 65532, 1179649, 1, 65532, 1179649, 2, 65532, 1179649, 3, 65532, 1179649, 3, 65533, 1179649, 3, 65535, 1179649, 3, 0, 1179649, 3, 1, 1179649, 3, 2, 1179649, 3, 3, 1179649, 2, 3, 1179649, 1, 3, 1179649, 0, 3, 1179649, 65535, 3, 1179649, 65534, 3, 1179649, 65533, 3, 1179649, 65531, 65531, 1179649, 65531, 65532, 1179649, 65531, 65534, 1179649, 65531, 65535, 1179649, 65531, 0, 1179649, 65531, 1, 1179649, 65531, 2, 1179649, 65531, 3, 1179649, 65531, 4, 1179649, 65532, 4, 1179649, 65533, 4, 1179649, 65534, 4, 1179649, 65535, 4, 1179649, 0, 4, 1179649, 1, 4, 1179649, 2, 4, 1179649, 3, 4, 1179649, 4, 4, 1179649, 4, 3, 1179649, 4, 2, 1179649, 4, 1, 1179649, 4, 0, 1179649, 4, 65535, 1179649, 4, 65533, 1179649, 4, 65532, 1179649, 4, 65531, 1179649, 3, 65531, 1179649, 2, 65531, 1179649, 1, 65531, 1179649, 0, 65531, 1179649, 65535, 65531, 1179649, 65534, 65531, 1179649, 65533, 65531, 1179649, 65532, 65531, 1179649, 131066, 4, 3, 131066, 3, 3, 131066, 2, 3, 131066, 1, 3, 131066, 0, 3, 131066, 65535, 3, 131066, 65534, 3, 131066, 65533, 3, 131066, 65532, 3, 131066, 65531, 3, 131066, 65530, 3, 131067, 65530, 3, 131068, 65530, 3, 0, 65530, 1179650, 65535, 65530, 1179650, 131069, 65530, 3, 131070, 65530, 3, 65538, 65530, 3, 65537, 65530, 3, 65539, 65530, 3, 65540, 65530, 3, 65541, 4, 3, 65541, 3, 3, 65541, 2, 3, 65541, 1, 3, 65541, 0, 3, 65541, 65535, 3, 65541, 65534, 3, 65541, 65533, 3, 65541, 65532, 3, 65541, 65531, 3, 65541, 65530, 3, 65541, 5, 3, 65540, 5, 3, 65539, 5, 3, 65538, 5, 3, 65537, 5, 3, 65536, 5, 3, 131071, 5, 3, 131070, 5, 3, 131069, 5, 3, 131068, 5, 3, 131067, 5, 3, 131066, 5, 3, 196602, 5, 3, 262138, 5, 1179651, 196602, 4, 3, 196602, 3, 3, 196602, 2, 3, 196602, 1, 3, 196602, 0, 3, 196602, 65535, 3, 196602, 65534, 3, 196602, 65533, 3, 196602, 65532, 3, 196602, 65531, 3, 196602, 65530, 3, 262138, 65530, 1179651, 262138, 65531, 1179651, 262138, 65532, 1179651, 262138, 65533, 1179651, 262138, 65534, 1179651, 262138, 65535, 1179651, 262138, 0, 1179651, 262138, 1, 1179651, 262138, 2, 1179651, 262138, 3, 1179651, 262138, 4, 1179651, 196613, 5, 3, 196613, 4, 3, 196613, 3, 3, 196613, 2, 3, 196613, 1, 3, 196613, 0, 3, 196613, 65535, 3, 196613, 65534, 3, 196613, 65533, 3, 196613, 65532, 3, 196613, 65531, 3, 196613, 65530, 3, 131077, 65530, 3, 131077, 65531, 3, 131077, 65532, 3, 131077, 65533, 3, 131077, 65534, 3, 131077, 65535, 3, 131077, 0, 3, 131077, 1, 3, 131077, 2, 3, 131077, 3, 3, 131077, 4, 3, 131077, 5, 3, 131076, 5, 3, 131075, 5, 3, 131074, 5, 3, 131073, 5, 3, 131072, 5, 3, 196607, 5, 3, 196606, 5, 3, 196605, 5, 3, 196604, 5, 3, 196603, 5, 3, 262139, 5, 3, 262140, 5, 3, 262141, 5, 3, 262142, 5, 3, 262143, 5, 3, 196608, 5, 3, 196609, 5, 3, 196610, 5, 3, 196611, 5, 3, 196612, 5, 3, 196603, 65530, 3, 196604, 65530, 3, 196605, 65530, 3, 196606, 65530, 3, 131073, 65530, 3, 131074, 65530, 3, 131075, 65530, 3, 131076, 65530, 3, 262139, 65530, 1179651, 262140, 65530, 1179651, 196609, 65530, 1179651, 196610, 65530, 1179651, 196611, 65530, 1179651, 196612, 65530, 1179651, 1, 65530, 0, 2, 65530, 0, 3, 65530, 0, 4, 65530, 0, 5, 65530, 0, 5, 65531, 0, 5, 65532, 0, 5, 65533, 0, 5, 65535, 0, 5, 0, 0, 5, 1, 0, 5, 2, 0, 5, 3, 0, 5, 4, 0, 5, 5, 0, 65530, 5, 0, 65531, 5, 0, 65532, 5, 0, 65533, 5, 0, 65534, 5, 0, 65535, 5, 0, 0, 5, 0, 1, 5, 0, 2, 5, 0, 3, 5, 0, 4, 5, 0, 65530, 65530, 0, 65530, 65531, 0, 65530, 65533, 0, 65530, 65534, 0, 65530, 65535, 0, 65530, 0, 0, 65530, 1, 0, 65530, 2, 0, 65530, 3, 0, 65530, 4, 0, 65531, 65530, 0, 65532, 65530, 0, 65533, 65530, 0, 65534, 65530, 0, 5, 65534, 0, 4, 65534, 1179649, 3, 65534, 1179649, 2, 65534, 1245185, 1, 65534, 1245185, 0, 65534, 1245185, 65535, 65534, 1245185, 65534, 65533, 1245185, 65533, 65533, 1245185, 65532, 65533, 1179649, 65531, 65533, 1179649, 65530, 65532, 0, 327674, 65530, 1179651, 327674, 65531, 1179651, 327674, 65532, 1179651, 327674, 65533, 1179651, 327674, 65534, 1179651, 327674, 65535, 1179651, 327674, 0, 1179651, 327674, 1, 1179651, 327674, 2, 1179651, 327674, 3, 1179651, 327674, 4, 1179651, 327674, 5, 1179651, 327675, 65530, 1179651, 327675, 5, 3, 327676, 65530, 1179651, 327676, 5, 3, 327677, 65530, 1179651, 327677, 5, 3, 327678, 65530, 1179651, 327678, 5, 3, 327679, 5, 3, 262144, 5, 3, 262145, 65530, 1179651, 262145, 5, 3, 262146, 65530, 1179651, 262146, 5, 3, 262147, 65530, 1179651, 262147, 5, 3, 262148, 65530, 1179651, 262148, 5, 3, 262149, 65530, 3, 262149, 65531, 3, 262149, 65532, 3, 262149, 65533, 3, 262149, 65534, 3, 262149, 65535, 3, 262149, 0, 3, 262149, 1, 3, 262149, 2, 3, 262149, 3, 3, 262149, 4, 3, 262149, 5, 3, 393210, 65530, 1179651, 393210, 65531, 1179651, 393210, 65532, 1179651, 393210, 65533, 1179651, 393210, 65534, 1179651, 393210, 65535, 1179651, 393210, 0, 1179651, 393210, 1, 1179651, 393210, 2, 1179651, 393210, 3, 1179651, 393210, 4, 1179651, 393210, 5, 1179651, 393211, 65530, 1179651, 393211, 5, 3, 393212, 65530, 1179651, 393212, 5, 3, 393213, 65530, 1179651, 393213, 5, 3, 393214, 65530, 1179651, 393214, 5, 3, 393215, 5, 3, 327680, 5, 3, 327681, 65530, 1179651, 327681, 5, 3, 327682, 65530, 1179651, 327682, 5, 3, 327683, 65530, 1179651, 327683, 5, 3, 327684, 65530, 1179651, 327684, 5, 3, 327685, 65530, 3, 327685, 65531, 3, 327685, 65532, 3, 327685, 65533, 3, 327685, 65534, 3, 327685, 65535, 3, 327685, 0, 3, 327685, 1, 3, 327685, 2, 3, 327685, 3, 3, 327685, 4, 3, 327685, 5, 3, 458746, 65530, 1, 458746, 65531, 1, 458746, 65532, 1, 458746, 65533, 1, 458746, 65534, 1, 458746, 65535, 1, 458746, 0, 1, 458746, 1, 1, 458746, 2, 1, 458746, 3, 1, 458746, 4, 1, 458746, 5, 1, 458747, 65530, 1, 458747, 65531, 1, 458747, 65532, 1, 458747, 65533, 1, 458747, 65534, 1, 458747, 65535, 1, 458747, 0, 1, 458747, 1, 1, 458747, 2, 1, 458747, 3, 1, 458747, 4, 1, 458747, 5, 1, 458748, 65530, 1, 458748, 65531, 1, 458748, 65532, 1, 458748, 65533, 1, 458748, 65534, 1, 458748, 65535, 1, 458748, 0, 1, 458748, 1, 1, 458748, 2, 1, 458748, 3, 1, 458748, 4, 1, 458748, 5, 1, 458749, 65530, 1, 458749, 65531, 1, 458749, 65532, 1, 458749, 65533, 1, 458749, 65534, 1, 458749, 65535, 1, 458749, 0, 1, 458749, 1, 1, 458749, 2, 1, 458749, 3, 1, 458749, 4, 1, 458749, 5, 1, 458750, 65530, 1, 458750, 65531, 1, 458750, 65532, 1, 458750, 65533, 1, 458750, 65534, 1, 458750, 65535, 1, 458750, 0, 1, 458750, 1, 1, 458750, 2, 1, 458750, 3, 1, 458750, 4, 1, 458750, 5, 1, 458751, 65530, 1, 458751, 65531, 1, 458751, 65532, 1, 458751, 65533, 1, 458751, 65534, 1, 458751, 65535, 1, 458751, 0, 1, 458751, 1, 1, 458751, 2, 1, 458751, 3, 1, 458751, 4, 1, 458751, 5, 1, 393216, 65530, 1, 393216, 65531, 1, 393216, 65532, 1, 393216, 65533, 1, 393216, 65534, 1, 393216, 65535, 1, 393216, 0, 1, 393216, 1, 1, 393216, 2, 1, 393216, 3, 1, 393216, 4, 1, 393216, 5, 1, 393217, 65530, 1, 393217, 65531, 1, 393217, 65532, 1, 393217, 65533, 1, 393217, 65534, 1, 393217, 65535, 1, 393217, 0, 1, 393217, 1, 1, 393217, 2, 1, 393217, 3, 1, 393217, 4, 1, 393217, 5, 1, 393218, 65530, 1, 393218, 65531, 1, 393218, 65532, 1, 393218, 65533, 1, 393218, 65534, 1, 393218, 65535, 1, 393218, 0, 1, 393218, 1, 1, 393218, 2, 1, 393218, 3, 1, 393218, 4, 1, 393218, 5, 1, 393219, 65530, 1, 393219, 65531, 1, 393219, 65532, 1, 393219, 65533, 1, 393219, 65534, 1, 393219, 65535, 1, 393219, 0, 1, 393219, 1, 1, 393219, 2, 1, 393219, 3, 1, 393219, 4, 1, 393219, 5, 1, 393220, 65530, 1, 393220, 65531, 1, 393220, 65532, 1, 393220, 65533, 1, 393220, 65534, 1, 393220, 65535, 1, 393220, 0, 1, 393220, 1, 1, 393220, 2, 1, 393220, 3, 1, 393220, 4, 1, 393220, 5, 1, 393221, 65530, 1, 393221, 65531, 1, 393221, 65532, 1, 393221, 65533, 1, 393221, 65534, 1, 393221, 65535, 1, 393221, 0, 1, 393221, 1, 1, 393221, 2, 1, 393221, 3, 1, 393221, 4, 1, 393221, 5, 1, 393215, 65530, 3, 327680, 65530, 3, 262144, 65530, 3, 327679, 65530, 3, 196608, 65530, 3, 262143, 65530, 3, 262142, 65530, 1179651, 262141, 65530, 1179651) } -metadata/_editor_floor_ = Vector3(0, 3, 0) +metadata/_editor_floor_ = Vector3(0, 1, 0) [node name="WorldEnvironment" type="WorldEnvironment" parent="."] environment = SubResource("Environment_u27ip") @@ -143,4 +145,36 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1.70813, 1.32179, -1.59377) command_name = "jump" command_sprite = ExtResource("7_qjeey") +[node name="Pedestals" type="Node3D" parent="."] + +[node name="CommandPedestal" parent="Pedestals" instance=ExtResource("10_sghta")] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 3.5, 1, 2.5) + +[node name="CommandPedestal2" parent="Pedestals" instance=ExtResource("10_sghta")] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 3.5, 1, 1.5) + +[node name="CommandPedestal3" parent="Pedestals" instance=ExtResource("10_sghta")] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 2.5, 1, 3.5) + +[node name="CommandPedestal4" parent="Pedestals" instance=ExtResource("10_sghta")] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 1.5, 1, 3.5) + +[node name="CommandPedestal5" parent="Pedestals" instance=ExtResource("10_sghta")] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.5, 1, 3.5) + +[node name="CommandPedestal6" parent="Pedestals" instance=ExtResource("10_sghta")] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.5, 1, 3.5) + +[node name="CommandPedestal7" parent="Pedestals" instance=ExtResource("10_sghta")] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1.5, 1, 3.5) + +[node name="CommandPedestal8" parent="Pedestals" instance=ExtResource("10_sghta")] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -2.5, 1, 3.5) + +[node name="CommandPedestal9" parent="Pedestals" instance=ExtResource("10_sghta")] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -3.5, 1, 2.5) + +[node name="CommandPedestal10" parent="Pedestals" instance=ExtResource("10_sghta")] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -3.5, 1, 1.5) + [connection signal="object_clicked" from="Player" to="." method="_on_player_object_clicked"] diff --git a/Scripts/ChronoManager.gd b/Scripts/ChronoManager.gd index 2d75dad..e29f63a 100644 --- a/Scripts/ChronoManager.gd +++ b/Scripts/ChronoManager.gd @@ -6,15 +6,14 @@ signal broadcast(command : String) @export_group("Variables") @export var level_tick : float = 1 # how often to run a command @export var level_time : float = 10 # the amoutn of time allowed for the level -@export var commands : Array[String] + @export_group("Node References") @export var gui : Control +@export var pedestals : Array[Pedestal] # Called when the node enters the scene tree for the first time. func _ready(): - while(commands.size() < level_time / level_tick): # prevent index out of bounds error - commands.append("") pass # Replace with function body. @@ -22,8 +21,7 @@ func _ready(): func _process(delta): pass -func set_command(position : int, command : String): - commands[position] = command + func start_room(): # open door diff --git a/Scripts/Player.gd b/Scripts/Player.gd index 51802ca..9125f40 100644 --- a/Scripts/Player.gd +++ b/Scripts/Player.gd @@ -43,6 +43,7 @@ func _physics_process(delta): if Input.is_action_just_pressed("interact"): if "name" in raycast.get_collider(): if "command_name" in raycast.get_collider(): + # clicked a command block print(raycast.get_collider().command_name) #hand.add_child(held_object) @@ -52,6 +53,18 @@ func _physics_process(delta): held_object.position = Vector3(0,0,0) held_object.freeze = true has_object = true + elif "placed_command" in raycast.get_collider(): + # clicked a pedestal, place on pedestal if its not already got something + var clicked_pedestal = raycast.get_collider() as Pedestal + print("clicked pedestal: "+ clicked_pedestal.name) + if(has_object and not clicked_pedestal.has_command): + print("trying to place") + held_object.reparent(clicked_pedestal.slot) + held_object.position = Vector3(0,0,0) + held_object.rotation_degrees = Vector3(0,0,0) + has_object = false + clicked_pedestal.has_command = true + clicked_pedestal.placed_command = held_object else: print(raycast.get_collider().name) object_clicked.emit(raycast.get_collider())