[gd_scene format=3 uid="uid://dg1b7t2vssf3f"] [ext_resource type="Script" uid="uid://ckndmko4orxx" path="res://scripts/traincontrol.gd" id="1_amtmp"] [ext_resource type="Texture2D" uid="uid://bg24v3kb5e73l" path="res://resources/rail2.png" id="1_ihlg3"] [ext_resource type="PackedScene" uid="uid://csm5ihvpyw5m7" path="res://scenes/main.tscn" id="2_0b1nv"] [ext_resource type="Script" uid="uid://ck4j0pekoofm1" path="res://scripts/engine.gd" id="2_jgp6u"] [ext_resource type="ArrayMesh" uid="uid://cm8un80nubjbi" path="res://resources/train kit/train-diesel-a.obj" id="3_jy5c4"] [ext_resource type="Script" uid="uid://b65vwus8xxmun" path="res://scripts/traincontrol_camera.gd" id="4_jy5c4"] [ext_resource type="Script" uid="uid://df2oi5vyeak81" path="res://scripts/train_movement.gd" id="6_1lqs8"] [ext_resource type="Script" uid="uid://b5x80gpkn1swt" path="res://scripts/rail_swtich.gd" id="7_cenvf"] [sub_resource type="PlaneMesh" id="PlaneMesh_23vqf"] size = Vector2(100, 100) [sub_resource type="StandardMaterial3D" id="StandardMaterial3D_23vqf"] albedo_color = Color(2.153851e-06, 0.25305444, 0.03645257, 1) [sub_resource type="Curve3D" id="Curve3D_0b1nv"] closed = true _data = { "points": PackedVector3Array(-2.1678085, -0.043792725, 1.658886, 2.1678085, 0.043792725, -1.658886, -41.962486, 0.03566742, -44.78871, 0, 0, 0, 0, 0, 0, -7.760188, 0.036315918, -45.60305, -6.559948, 0.007423401, -0.16356277, 6.559948, -0.007423401, 0.16356277, 21.603975, 0.03604126, -45.26774, -3.4513588, 0.124176025, -4.544277, 3.4513588, -0.124176025, 4.544277, 40.931072, 0.032211304, -40.35701, 0.5563507, 0.09750366, -3.6268482, -0.5563507, -0.09750366, 3.6268482, 45.43544, 0.021453857, -26.947992, 3.438774, 0.09018707, -3.405755, -3.438774, -0.09018707, 3.405755, 38.412643, 0.47789, -9.150471, 6.6514378, -0.022911072, 0.7331085, -6.6514378, 0.022911072, -0.7331085, 25.856459, 0.10243797, -3.7440395, 5.315757, -0.10071564, 3.6390858, -5.315757, 0.10071564, -3.6390858, 3.4968712, 0.0079574585, -10.011598, 4.9409637, -0.0754776, 2.709568, -4.9409637, 0.0754776, -2.709568, -3.8321874, 0.024543762, -30.849133, 6.360344, 0.0488739, -1.9223251, -6.360344, -0.0488739, 1.9223251, -22.311077, 0.005493164, -31.887383, -0.9378357, 0.12989807, -4.797656, 0.9378357, -0.12989807, 4.797656, -31.28027, 0.015075684, -18.969343, -7.12364, 0.096969604, -3.4738579, 7.12364, -0.096969604, 3.4738579, -23.472174, 0.003479004, -4.4070177, -9.224047, 0.08418274, -2.961853, 9.224047, -0.08418274, 2.961853, 12.167218, -0.011207581, 14.035401, -8.825874, 0.03265381, -1.0564928, 8.825874, -0.03265381, 1.0564928, 32.632145, -0.011894226, 14.993831, 0, 0, 0, 0, 0, 0, 39.98447, -0.019104004, 24.146927, 4.9879036, 0.122177124, -4.6163826, -4.9879036, -0.122177124, 4.6163826, 35.724655, 0.047676086, 33.444454, 8.1661625, 0.014076233, -0.6628723, -8.1661625, -0.014076233, 0.6628723, 11.495622, 0.0951767, 40.647045, 4.9570847, -0.058029175, 2.0650558, -4.9570847, 0.058029175, -2.0650558, -22.318954, 0.051948547, 40.504288, 4.9869003, -0.18069458, 6.610588, -4.9869003, 0.18069458, -6.610588, -37.494194, 0.080329895, 26.992659, -1.5943985, -0.19984436, 7.435757, 1.5943985, 0.19984436, -7.435757, -46.58226, 0.10346222, 8.63745, -0.4270401, -0.16287994, 6.045038, 0.4270401, 0.16287994, -6.045038, -39.930115, 0.050865173, -11.514841, 4.8086166, -0.20992279, 7.687052, -4.8086166, 0.20992279, -7.687052, -35.56163, 0.15759277, -32.8561, -0.73628235, -0.15232849, 5.656826, 0.73628235, 0.15232849, -5.656826, -45.566254, 0.602231, -39.59991), "tilts": PackedFloat32Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0) } point_count = 23 [sub_resource type="StandardMaterial3D" id="StandardMaterial3D_ke0jj"] albedo_texture = ExtResource("1_ihlg3") uv1_scale = Vector3(0.235, -4.785, 1) uv1_offset = Vector3(0, -0.61, 0) [sub_resource type="StandardMaterial3D" id="StandardMaterial3D_ihlg3"] metallic = 1.0 roughness = 0.25 [sub_resource type="Curve3D" id="Curve3D_1lqs8"] closed = true _data = { "points": PackedVector3Array(-6.2964935, 0.06638336, -2.3570595, 6.2964935, -0.06638336, 2.3570595, 24, 0, -36, 0.40251923, 0.1432724, -5.316846, -0.40251923, -0.1432724, 5.316846, 30.535202, 0.016418457, -19.69652, -3.0211945, 0.21754456, -8.010609, 3.0211945, -0.21754456, 8.010609, 37.792625, 0.0013275146, -0.5123644, 7.037945, 0.16593933, -6.2738285, -7.037945, -0.16593933, 6.2738285, 33.177887, 0.0013427734, 21.921793, 12.049584, -0.0362854, 1.1334801, -12.049584, 0.0362854, -1.1334801, 7.185522, 0.0013427734, 33.84686, 3.006013, -0.23966217, 8.824167, -3.006013, 0.23966217, -8.824167, -5.633688, 0.0127334595, 16.86435, 0.09129143, -0.14064789, 5.2124147, -0.09129143, 0.14064789, -5.2124147, -20.520624, 0.0013427734, -3.9991686, -6.1595325, -0.18273163, 6.8687496, 6.1595325, 0.18273163, -6.8687496, -10.095118, 0.0013427734, -27.90497), "tilts": PackedFloat32Array(0, 0, 0, 0, 0, 0, 0, 0) } point_count = 8 [sub_resource type="ProceduralSkyMaterial" id="ProceduralSkyMaterial_jgp6u"] sky_top_color = Color(0.6262097, 0.76737565, 0.9309246, 1) sky_horizon_color = Color(0.82665706, 0.8808251, 0.95468724, 1) ground_bottom_color = Color(0.5370987, 0.48452926, 0.42358288, 1) ground_horizon_color = Color(0.7014107, 0.735357, 0.7014107, 1) [sub_resource type="Sky" id="Sky_o6xl0"] sky_material = SubResource("ProceduralSkyMaterial_jgp6u") [sub_resource type="Environment" id="Environment_jy5c4"] background_mode = 2 background_energy_multiplier = 1.2 sky = SubResource("Sky_o6xl0") ambient_light_source = 3 ambient_light_color = Color(0.32642248, 0.5324062, 1, 1) ambient_light_energy = 0.6 tonemap_mode = 3 fog_enabled = true fog_light_color = Color(0.42881075, 0.64639634, 0.94499296, 1) fog_density = 0.0015 [sub_resource type="LabelSettings" id="LabelSettings_1lqs8"] font_color = Color(0, 0, 0, 1) [node name="TrainControl" type="Node3D" unique_id=840483686] script = ExtResource("1_amtmp") main_scene = ExtResource("2_0b1nv") [node name="Ground" type="MeshInstance3D" parent="." unique_id=263562811] mesh = SubResource("PlaneMesh_23vqf") surface_material_override/0 = SubResource("StandardMaterial3D_23vqf") [node name="Rails1" type="Path3D" parent="Ground" unique_id=1160818899] curve = SubResource("Curve3D_0b1nv") [node name="Ballast" type="CSGPolygon3D" parent="Ground/Rails1" unique_id=259312931] polygon = PackedVector2Array(-1, 0, -1, 0.1, 1, 0.1, 1, 0) mode = 2 path_node = NodePath("..") path_interval_type = 0 path_interval = 1.0 path_simplify_angle = 0.0 path_rotation = 2 path_rotation_accurate = false path_local = false path_continuous_u = true path_u_distance = 1.0 path_joined = true material = SubResource("StandardMaterial3D_ke0jj") [node name="LRail" type="CSGPolygon3D" parent="Ground/Rails1" unique_id=477776682] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -2.24889, -4.7985353, 2.2341003) polygon = PackedVector2Array(-0.5, 0, -0.5, 0.2, -0.4, 0.2, -0.4, 0) mode = 2 path_node = NodePath("..") path_interval_type = 0 path_interval = 1.0 path_simplify_angle = 0.0 path_rotation = 2 path_rotation_accurate = false path_local = false path_continuous_u = true path_u_distance = 1.0 path_joined = true material = SubResource("StandardMaterial3D_ihlg3") [node name="RRail" type="CSGPolygon3D" parent="Ground/Rails1" unique_id=965437995] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -2.24889, -4.7985353, 2.2341003) polygon = PackedVector2Array(0.5, 0, 0.5, 0.2, 0.4, 0.2, 0.5, 0) mode = 2 path_node = NodePath("..") path_interval_type = 0 path_interval = 1.0 path_simplify_angle = 0.0 path_rotation = 2 path_rotation_accurate = false path_local = false path_continuous_u = true path_u_distance = 1.0 path_joined = true material = SubResource("StandardMaterial3D_ihlg3") [node name="TrainEngine" type="PathFollow3D" parent="Ground/Rails1" unique_id=973990755] transform = Transform3D(0.6867339, -0.014397825, -0.8973005, 0, 1.130071, -0.018126711, 0.8974141, 0.01101774, 0.68664694, -41.962486, 0.03566742, -44.78871) rotation_mode = 4 script = ExtResource("2_jgp6u") [node name="Rails2" type="Path3D" parent="Ground" unique_id=1426938039] curve = SubResource("Curve3D_1lqs8") [node name="Ballast" type="CSGPolygon3D" parent="Ground/Rails2" unique_id=608449521] polygon = PackedVector2Array(-1, 0, -1, 0.1, 1, 0.1, 1, 0) mode = 2 path_node = NodePath("..") path_interval_type = 0 path_interval = 1.0 path_simplify_angle = 0.0 path_rotation = 2 path_rotation_accurate = false path_local = false path_continuous_u = true path_u_distance = 1.0 path_joined = true material = SubResource("StandardMaterial3D_ke0jj") [node name="RRail" type="CSGPolygon3D" parent="Ground/Rails2" unique_id=469196308] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -2.24889, -4.7985353, 2.2341003) polygon = PackedVector2Array(0.5, 0, 0.5, 0.2, 0.4, 0.2, 0.5, 0) mode = 2 path_node = NodePath("..") path_interval_type = 0 path_interval = 1.0 path_simplify_angle = 0.0 path_rotation = 2 path_rotation_accurate = false path_local = false path_continuous_u = true path_u_distance = 1.0 path_joined = true material = SubResource("StandardMaterial3D_ihlg3") [node name="LRail" type="CSGPolygon3D" parent="Ground/Rails2" unique_id=1887208549] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -2.24889, -4.7985353, 2.2341003) polygon = PackedVector2Array(-0.5, 0, -0.5, 0.2, -0.4, 0.2, -0.4, 0) mode = 2 path_node = NodePath("..") path_interval_type = 0 path_interval = 1.0 path_simplify_angle = 0.0 path_rotation = 2 path_rotation_accurate = false path_local = false path_continuous_u = true path_u_distance = 1.0 path_joined = true material = SubResource("StandardMaterial3D_ihlg3") [node name="TrainEngine" type="PathFollow3D" parent="Ground/Rails2" unique_id=1618605131] transform = Transform3D(-0.39616987, 0.010450672, -1.0582525, 0, 1.1301593, 0.01115706, 1.0583019, 0.003912155, -0.3961513, 24, 0, -36) rotation_mode = 4 script = ExtResource("2_jgp6u") [node name="Train" type="MeshInstance3D" parent="Ground" unique_id=65189673] transform = Transform3D(0.6867333, -0.014397784, -0.89729905, 0, 1.1300678, -0.018126683, 0.8974134, 0.011017708, 0.68664587, -41.962486, 0.03566742, -44.78871) mesh = ExtResource("3_jy5c4") skeleton = NodePath("../Rails1/TrainEngine") script = ExtResource("6_1lqs8") [node name="RailSwtich" type="Area3D" parent="Ground" unique_id=1897237029 node_paths=PackedStringArray("rail_a", "rail_b", "switch_to_rail")] script = ExtResource("7_cenvf") rail_a = NodePath("../Rails1") rail_b = NodePath("../Rails2") switch_to_rail = NodePath("../Rails1") [node name="DirectionalLight3D" type="DirectionalLight3D" parent="." unique_id=1729725358] shadow_enabled = true shadow_bias = 0.04 [node name="WorldEnvironment" type="WorldEnvironment" parent="." unique_id=431838059] environment = SubResource("Environment_jy5c4") [node name="TrainCamera" type="Camera3D" parent="." unique_id=188013126 node_paths=PackedStringArray("train")] transform = Transform3D(0.30358428, -0.00013030751, -0.95280457, 0, 1, -0.00013676206, 0.95280457, 4.151881e-05, 0.30358428, 18.173706, 3.0913553, 48.05532) current = true fov = 11.9 near = 0.001 script = ExtResource("4_jy5c4") train = NodePath("../Ground/Train") follow_distance = 30.0 [node name="HUD" type="Control" parent="." unique_id=563257159] layout_mode = 3 anchors_preset = 0 offset_right = 40.0 offset_bottom = 40.0 [node name="speed_label" type="Label" parent="HUD" unique_id=1564808190] layout_mode = 0 offset_left = 20.0 offset_top = 20.0 offset_right = 1280.0 offset_bottom = 43.0 size_flags_vertical = 0 text = "Velocità: 0" label_settings = SubResource("LabelSettings_1lqs8") [node name="camera_label" type="Label" parent="HUD" unique_id=1719494020] layout_mode = 0 offset_left = 19.0 offset_top = 43.0 offset_right = 1279.0 offset_bottom = 66.0 size_flags_vertical = 0 text = "Camera: " label_settings = SubResource("LabelSettings_1lqs8") [node name="controls_label" type="Label" parent="HUD" unique_id=1262113688] layout_mode = 0 offset_left = 19.0 offset_top = 83.0 offset_right = 1279.0 offset_bottom = 236.0 size_flags_vertical = 0 text = "Comandi: \"W / S - Accelera / Rallenta\", \"A / D - Ruota camera\", \"SPACE - Cambia camera\", \"TAB\" - Cambia binario, \"ESC - Esci\"" label_settings = SubResource("LabelSettings_1lqs8") [node name="switch_label" type="Label" parent="HUD" unique_id=462391845] layout_mode = 0 offset_left = 19.0 offset_top = 64.0 offset_right = 1279.0 offset_bottom = 87.0 size_flags_vertical = 0 text = "Binario: " label_settings = SubResource("LabelSettings_1lqs8")