Add food dispensers to shop.
This commit is contained in:
+16
-16
@@ -1,6 +1,6 @@
|
||||
[gd_scene format=3 uid="uid://22shbqdvnwgo"]
|
||||
|
||||
[ext_resource type="Script" path="res://main.gd" id="1_m3h4l"]
|
||||
[ext_resource type="Script" uid="uid://d1cefhe3yyyds" path="res://Net/multiplayer_world.gd" id="1_nlnup"]
|
||||
[ext_resource type="PackedScene" uid="uid://j5s5wus7tuhb" path="res://prefabs/XROrigin.tscn" id="2_8pfaf"]
|
||||
[ext_resource type="Material" uid="uid://cmia50cfqxxo4" path="res://textures/dev_material_3d.tres" id="3_gatbn"]
|
||||
[ext_resource type="PackedScene" uid="uid://j7caslh27nor" path="res://stations/Hob.tscn" id="4_3lufs"]
|
||||
@@ -13,10 +13,10 @@
|
||||
[ext_resource type="PackedScene" uid="uid://cwnwo4i28upap" path="res://stations/raw_burger_dispenser.tscn" id="15_m3h4l"]
|
||||
[ext_resource type="PackedScene" uid="uid://efaec6ymgabo" path="res://stations/Counter.tscn" id="15_tpcje"]
|
||||
[ext_resource type="PackedScene" uid="uid://caf0xanmxbshy" path="res://stations/table.tscn" id="16_g2k6a"]
|
||||
[ext_resource type="Script" uid="uid://k8ywnvlhcic4" path="res://scenes/testworldLoad.gd" id="16_m3h4l"]
|
||||
[ext_resource type="Script" uid="uid://k8ywnvlhcic4" path="res://test/testworldLoad.gd" id="16_m3h4l"]
|
||||
[ext_resource type="PackedScene" uid="uid://clujaf3u776a3" path="res://addons/godot-xr-tools/objects/viewport_2d_in_3d.tscn" id="17_gatbn"]
|
||||
[ext_resource type="PackedScene" uid="uid://xtcei2uvd5li" path="res://UI/game_over_panel.tscn" id="18_3lufs"]
|
||||
[ext_resource type="Script" uid="uid://cwijoksyou1ey" path="res://scenes/GameOvercontroler.gd" id="19_3lufs"]
|
||||
[ext_resource type="Script" uid="uid://cwijoksyou1ey" path="res://prefabs/GameOvercontroler.gd" id="19_3lufs"]
|
||||
|
||||
[sub_resource type="BoxShape3D" id="BoxShape3D_vlqg6"]
|
||||
size = Vector3(16, 0.1, 16)
|
||||
@@ -38,7 +38,8 @@ sdfgi_enabled = true
|
||||
size = Vector3(16, 10, 0.1)
|
||||
|
||||
[node name="Main" type="Node3D" unique_id=1312265607]
|
||||
script = ExtResource("1_m3h4l")
|
||||
script = ExtResource("1_nlnup")
|
||||
populate_from_layout = false
|
||||
|
||||
[node name="XROrigin3D" parent="." unique_id=2055526621 instance=ExtResource("2_8pfaf")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.6, 0)
|
||||
@@ -47,8 +48,7 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.6, 0)
|
||||
transform = Transform3D(-0.8660254, -0.43301278, 0.24999999, 0.3022632, -0.05510214, 0.9516306, -0.39829266, 0.8997021, 0.17860365, 0, 0, 0)
|
||||
|
||||
[node name="Table" parent="." unique_id=1863572470 instance=ExtResource("16_g2k6a")]
|
||||
transform = Transform3D(-4.371139e-08, 0, -1, 0, 1, 0, 1, 0, -4.371139e-08, 2.739665, 0.47583598, -1.1895752)
|
||||
primary_duration = 35.0
|
||||
transform = Transform3D(-4.371139e-08, 0, -1, 0, 1, 0, 1, 0, -4.371139e-08, 2.739665, -0.023897558, -1.1895752)
|
||||
|
||||
[node name="Floor" type="StaticBody3D" parent="." unique_id=122279514]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.05, 0)
|
||||
@@ -64,10 +64,10 @@ mesh = SubResource("BoxMesh_24d3s")
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.5, -1.2)
|
||||
|
||||
[node name="Hob2" parent="." unique_id=496572049 instance=ExtResource("4_3lufs")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.6, 0.5, -1.2)
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.6, 0.00026646256, -1.2)
|
||||
|
||||
[node name="Hob3" parent="." unique_id=421567982 instance=ExtResource("4_3lufs")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1.2, 0.5, -1.2)
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1.2, 0.00026646256, -1.2)
|
||||
|
||||
[node name="WorldEnvironment" type="WorldEnvironment" parent="." unique_id=1177077250]
|
||||
environment = SubResource("Environment_bvwq1")
|
||||
@@ -76,31 +76,31 @@ environment = SubResource("Environment_bvwq1")
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1.8, 0.015, -1.2)
|
||||
|
||||
[node name="Sink" parent="." unique_id=2055277359 instance=ExtResource("12_ah4xa")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.5997182, 0.5, -1.2)
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.5997182, 0.00026646256, -1.2)
|
||||
|
||||
[node name="Sink2" parent="." unique_id=1692612192 instance=ExtResource("12_ah4xa")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 1.1997182, 0.5, -1.2)
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 1.1997182, 0.00026646256, -1.2)
|
||||
|
||||
[node name="DirtStation" parent="." unique_id=160842153 instance=ExtResource("13_46xi2")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 1.8000001, 0.5, -1.2)
|
||||
|
||||
[node name="Counter2" parent="." unique_id=368890752 instance=ExtResource("15_tpcje")]
|
||||
transform = Transform3D(-4.371139e-08, 0, 1, 0, 1, 0, -1, 0, -4.371139e-08, -1.8, 0.5, -0.6)
|
||||
transform = Transform3D(-4.371139e-08, 0, 1, 0, 1, 0, -1, 0, -4.371139e-08, -1.8, 0.00026646256, -0.6)
|
||||
|
||||
[node name="Counter3" parent="." unique_id=1498817646 instance=ExtResource("15_tpcje")]
|
||||
transform = Transform3D(-4.371139e-08, 0, 1, 0, 1, 0, -1, 0, -4.371139e-08, -1.8, 0.5, 0)
|
||||
transform = Transform3D(-4.371139e-08, 0, 1, 0, 1, 0, -1, 0, -4.371139e-08, -1.8, 0.00026646256, 0)
|
||||
|
||||
[node name="Counter4" parent="." unique_id=906748771 instance=ExtResource("15_tpcje")]
|
||||
transform = Transform3D(-4.371139e-08, 0, 1, 0, 1, 0, -1, 0, -4.371139e-08, -1.8, 0.5, 0.6)
|
||||
transform = Transform3D(-4.371139e-08, 0, 1, 0, 1, 0, -1, 0, -4.371139e-08, -1.8, 0.00026646256, 0.6)
|
||||
|
||||
[node name="Counter5" parent="." unique_id=1487893288 instance=ExtResource("15_tpcje")]
|
||||
transform = Transform3D(-1, 0, -8.742278e-08, 0, 1, 0, 8.742278e-08, 0, -1, -0.6, 0.5, 1.2)
|
||||
transform = Transform3D(-1, 0, -8.742278e-08, 0, 1, 0, 8.742278e-08, 0, -1, -0.6, 0.00026646256, 1.2)
|
||||
|
||||
[node name="Counter6" parent="." unique_id=1154936647 instance=ExtResource("15_tpcje")]
|
||||
transform = Transform3D(-1, 0, -8.742278e-08, 0, 1, 0, 8.742278e-08, 0, -1, 0, 0.5, 1.2)
|
||||
transform = Transform3D(-1, 0, -8.742278e-08, 0, 1, 0, 8.742278e-08, 0, -1, 0, 0.00026646256, 1.2)
|
||||
|
||||
[node name="Counter7" parent="." unique_id=990260272 instance=ExtResource("15_tpcje")]
|
||||
transform = Transform3D(-1, 0, -8.742278e-08, 0, 1, 0, 8.742278e-08, 0, -1, 0.6, 0.5, 1.2)
|
||||
transform = Transform3D(-1, 0, -8.742278e-08, 0, 1, 0, 8.742278e-08, 0, -1, 0.6, 0.00026646256, 1.2)
|
||||
|
||||
[node name="StaticBody3D" type="StaticBody3D" parent="." unique_id=315740174]
|
||||
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
extends Node
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
$"..".visible = false
|
||||
|
||||
# Listen for the game over signal from GameManager
|
||||
Signals.game_state_changed.connect(_on_game_state_changed)
|
||||
|
||||
func _on_game_state_changed(new_state: GameManager.GameState) -> void:
|
||||
if new_state == GameManager.GameState.GAME_OVER:
|
||||
$"..".visible = true
|
||||
else:
|
||||
$"..".visible = false
|
||||
@@ -1 +0,0 @@
|
||||
uid://cwijoksyou1ey
|
||||
+15
-39
@@ -1,14 +1,13 @@
|
||||
[gd_scene format=3 uid="uid://do6mrslyqe5qe"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://d1cefhe3yyyds" path="res://scenes/multiplayer_world.gd" id="1_57ppd"]
|
||||
[ext_resource type="Script" uid="uid://d1cefhe3yyyds" path="res://Net/multiplayer_world.gd" id="1_57ppd"]
|
||||
[ext_resource type="PackedScene" uid="uid://j5s5wus7tuhb" path="res://prefabs/XROrigin.tscn" id="2_o1b3t"]
|
||||
[ext_resource type="Material" uid="uid://cmia50cfqxxo4" path="res://textures/dev_material_3d.tres" id="3_irf4n"]
|
||||
[ext_resource type="Sky" uid="uid://c1abtpwhdm2d5" path="res://textures/sky/NightSkyHDRI009_16K.tres" id="7_n8fyw"]
|
||||
[ext_resource type="PackedScene" uid="uid://q37nqadkibbp" path="res://scenes/door.tscn" id="10_l51r2"]
|
||||
[ext_resource type="PackedScene" uid="uid://q37nqadkibbp" path="res://environment/door.tscn" id="10_l51r2"]
|
||||
[ext_resource type="PackedScene" uid="uid://b3m2ag8g5rj4r" path="res://items/hamburger.tscn" id="11_c8vo7"]
|
||||
[ext_resource type="PackedScene" uid="uid://da6yrsnxvsrif" path="res://scenes/wall.tscn" id="11_slo47"]
|
||||
[ext_resource type="PackedScene" uid="uid://da6yrsnxvsrif" path="res://environment/wall.tscn" id="11_slo47"]
|
||||
[ext_resource type="PackedScene" uid="uid://bp3v1jl8pctro" path="res://Containers/plate.tscn" id="12_1f3bw"]
|
||||
[ext_resource type="PackedScene" uid="uid://bbg7dwsbxxh1t" path="res://scenes/cube_side_dispense.tscn" id="12_57ppd"]
|
||||
[ext_resource type="PackedScene" uid="uid://dlw5geheupgpt" path="res://stations/hatch.tscn" id="12_dpf3b"]
|
||||
[ext_resource type="PackedScene" uid="uid://e4i6o5oriecx" path="res://items/PickupCube.tscn" id="13_1f3bw"]
|
||||
[ext_resource type="PackedScene" uid="uid://caf0xanmxbshy" path="res://stations/table.tscn" id="13_yjosk"]
|
||||
@@ -17,14 +16,12 @@
|
||||
[ext_resource type="PackedScene" uid="uid://efaec6ymgabo" path="res://stations/Counter.tscn" id="15_di04w"]
|
||||
[ext_resource type="PackedScene" uid="uid://xtcei2uvd5li" path="res://UI/game_over_panel.tscn" id="15_eoxxy"]
|
||||
[ext_resource type="PackedScene" uid="uid://ck5tuftqmyiue" path="res://stations/plate_dispenser.tscn" id="15_qxyk8"]
|
||||
[ext_resource type="Script" uid="uid://cwijoksyou1ey" path="res://scenes/GameOvercontroler.gd" id="16_n8fyw"]
|
||||
[ext_resource type="Script" uid="uid://cwijoksyou1ey" path="res://prefabs/GameOvercontroler.gd" id="16_n8fyw"]
|
||||
[ext_resource type="PackedScene" uid="uid://dvrk268s7gkxh" path="res://stations/sink.tscn" id="16_u5c1m"]
|
||||
[ext_resource type="PackedScene" uid="uid://cwnwo4i28upap" path="res://stations/raw_burger_dispenser.tscn" id="17_y7baw"]
|
||||
[ext_resource type="PackedScene" uid="uid://c6rift56ql3f8" path="res://stations/BurgerBunsDispenser.tscn" id="18_wvcs1"]
|
||||
[ext_resource type="PackedScene" uid="uid://duwrbvwcqcuk3" path="res://items/chips.tscn" id="22_2ndvi"]
|
||||
[ext_resource type="PackedScene" uid="uid://dgk88esxip5xi" path="res://items/knife.tscn" id="23_qxyk8"]
|
||||
[ext_resource type="PackedScene" uid="uid://drwuhqb3pjtiy" path="res://items/potato.tscn" id="24_u5c1m"]
|
||||
[ext_resource type="PackedScene" uid="uid://bpvp20hiagxxb" path="res://items/chopped_potato.tscn" id="25_y7baw"]
|
||||
|
||||
[sub_resource type="Environment" id="Environment_bvwq1"]
|
||||
background_mode = 2
|
||||
@@ -120,15 +117,6 @@ shape = SubResource("BoxShape3D_24d3s")
|
||||
transform = Transform3D(-4.371139e-08, 0, -1, 0, 1, 0, 1, 0, -4.371139e-08, 9.934778, 4.297072, -0.018813023)
|
||||
shape = SubResource("BoxShape3D_24d3s")
|
||||
|
||||
[node name="Counter2" parent="." unique_id=368890752 instance=ExtResource("15_di04w")]
|
||||
transform = Transform3D(-4.371139e-08, 0, 1, 0, 1, 0, -1, 0, -4.371139e-08, -3.9477215, 0.5115016, 1.6896921)
|
||||
|
||||
[node name="Counter4" parent="." unique_id=1748373996 instance=ExtResource("15_di04w")]
|
||||
transform = Transform3D(-4.371139e-08, 0, 1, 0, 1, 0, -1, 0, -4.371139e-08, -3.9477215, 0.5115016, 1.0913646)
|
||||
|
||||
[node name="Counter3" parent="." unique_id=1498817646 instance=ExtResource("15_di04w")]
|
||||
transform = Transform3D(-4.371139e-08, 0, 1, 0, 1, 0, -1, 0, -4.371139e-08, -3.9477215, 0.5115016, 2.2925892)
|
||||
|
||||
[node name="GameOverPanel" parent="." unique_id=1234658657 instance=ExtResource("14_di04w")]
|
||||
transform = Transform3D(-4.371139e-08, 0, 1, 0, 1, 0, -1, 0, -4.371139e-08, -4.428178, 2.8122003, 3)
|
||||
scene = ExtResource("15_eoxxy")
|
||||
@@ -140,9 +128,6 @@ scene_properties_keys = PackedStringArray("game_over_panel.gd")
|
||||
[node name="controler" type="Node" parent="GameOverPanel" unique_id=803158176]
|
||||
script = ExtResource("16_n8fyw")
|
||||
|
||||
[node name="CubeSideDispenser2" parent="." unique_id=200950572 instance=ExtResource("12_57ppd")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -3.8484511, 0, 2.9119425)
|
||||
|
||||
[node name="Resturant" type="Node3D" parent="." unique_id=1083608050]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 1.6212463e-05, -0.010500789, 0.0014204979)
|
||||
|
||||
@@ -425,37 +410,37 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 2.4, 0, 0)
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 3, 0, 0)
|
||||
|
||||
[node name="Table2" parent="Resturant" unique_id=1457688277 instance=ExtResource("13_yjosk")]
|
||||
transform = Transform3D(1, 0, -1.7484555e-07, 0, 1, 0, 1.7484555e-07, 0, 1, 0.5999999, 0.48000002, -3)
|
||||
transform = Transform3D(1, 0, -1.7484555e-07, 0, 1, 0, 1.7484555e-07, 0, 1, 0.5999999, -0.035479546, -3)
|
||||
|
||||
[node name="Hob" parent="Resturant" unique_id=172418174 instance=ExtResource("14_2ndvi")]
|
||||
transform = Transform3D(1.3113416e-07, 0, -1, 0, 1, 0, 1, 0, 1.3113416e-07, 4.2000003, 0.54, 1.7999992)
|
||||
transform = Transform3D(1.3113416e-07, 0, -1, 0, 1, 0, 1, 0, 1.3113416e-07, 4.2000003, 0.024520457, 1.7999992)
|
||||
|
||||
[node name="Hob2" parent="Resturant" unique_id=980569400 instance=ExtResource("14_2ndvi")]
|
||||
transform = Transform3D(1.3113416e-07, 0, -1, 0, 1, 0, 1, 0, 1.3113416e-07, 4.200001, 0.54, 1.1999999)
|
||||
transform = Transform3D(1.3113416e-07, 0, -1, 0, 1, 0, 1, 0, 1.3113416e-07, 4.200001, 0.024520457, 1.1999999)
|
||||
|
||||
[node name="Counter" parent="Resturant" unique_id=1487893288 instance=ExtResource("15_di04w")]
|
||||
transform = Transform3D(-4.371139e-08, 0, -1, 0, 1, 0, 1, 0, -4.371139e-08, 4.200001, 0.54, 2.3999996)
|
||||
transform = Transform3D(-4.371139e-08, 0, -1, 0, 1, 0, 1, 0, -4.371139e-08, 4.200001, 0.024520457, 2.3999996)
|
||||
|
||||
[node name="Counter2" parent="Resturant" unique_id=5128912 instance=ExtResource("15_di04w")]
|
||||
transform = Transform3D(-4.371139e-08, 0, -1, 0, 1, 0, 1, 0, -4.371139e-08, 4.200001, 0.54, 3)
|
||||
transform = Transform3D(-4.371139e-08, 0, -1, 0, 1, 0, 1, 0, -4.371139e-08, 4.200001, 0.024520457, 3)
|
||||
|
||||
[node name="Counter3" parent="Resturant" unique_id=1298458612 instance=ExtResource("15_di04w")]
|
||||
transform = Transform3D(-4.371139e-08, 0, -1, 0, 1, 0, 1, 0, -4.371139e-08, 4.2000003, 0.54, 0.5999999)
|
||||
transform = Transform3D(-4.371139e-08, 0, -1, 0, 1, 0, 1, 0, -4.371139e-08, 4.2000003, 0.024520457, 0.5999999)
|
||||
|
||||
[node name="Counter4" parent="Resturant" unique_id=1764980142 instance=ExtResource("15_di04w")]
|
||||
transform = Transform3D(1.3113416e-07, 0, 1, 0, 1, 0, -1, 0, 1.3113416e-07, 4.7683716e-07, 0.54, 2.3999996)
|
||||
transform = Transform3D(1.3113416e-07, 0, 1, 0, 1, 0, -1, 0, 1.3113416e-07, 4.7683716e-07, 0.024520457, 2.3999996)
|
||||
|
||||
[node name="Counter5" parent="Resturant" unique_id=1015820252 instance=ExtResource("15_di04w")]
|
||||
transform = Transform3D(1.3113416e-07, 0, 1, 0, 1, 0, -1, 0, 1.3113416e-07, 4.7683716e-07, 0.54, 3)
|
||||
transform = Transform3D(1.3113416e-07, 0, 1, 0, 1, 0, -1, 0, 1.3113416e-07, 4.7683716e-07, 0.024520457, 3)
|
||||
|
||||
[node name="PlateDispenser" parent="Resturant" unique_id=710538846 instance=ExtResource("15_qxyk8")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0.6)
|
||||
|
||||
[node name="Sink" parent="Resturant" unique_id=2055277359 instance=ExtResource("16_u5c1m")]
|
||||
transform = Transform3D(-1, 0, 8.742278e-08, 0, 1, 0, -8.742278e-08, 0, -1, 0.6, 0.48000002, -0.6)
|
||||
transform = Transform3D(-1, 0, 8.742278e-08, 0, 1, 0, -8.742278e-08, 0, -1, 0.6, -0.035479546, -0.6)
|
||||
|
||||
[node name="Counter6" parent="Resturant" unique_id=2141915043 instance=ExtResource("15_di04w")]
|
||||
transform = Transform3D(-1, 0, 8.742277e-08, 0, 1, 0, -8.742277e-08, 0, -1, 4.7683716e-07, 0.54, -0.6000006)
|
||||
transform = Transform3D(-1, 0, 8.742277e-08, 0, 1, 0, -8.742277e-08, 0, -1, 4.7683716e-07, 0.024520457, -0.6000006)
|
||||
|
||||
[node name="RawBurgerDispenser" parent="Resturant" unique_id=235630131 instance=ExtResource("17_y7baw")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1.2)
|
||||
@@ -464,7 +449,7 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1.2)
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1.8000001)
|
||||
|
||||
[node name="Table3" parent="Resturant" unique_id=1863572470 instance=ExtResource("13_yjosk")]
|
||||
transform = Transform3D(-1, 0, 2.6226832e-07, 0, 1, 0, -2.6226832e-07, 0, -1, 3, 0.48000002, -3)
|
||||
transform = Transform3D(-1, 0, 2.6226832e-07, 0, 1, 0, -2.6226832e-07, 0, -1, 3, -0.035479546, -3)
|
||||
|
||||
[node name="Hamburger" parent="." unique_id=1675596942 instance=ExtResource("11_c8vo7")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.8000001, -0.6)
|
||||
@@ -480,12 +465,3 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.6, 1.2, -0.6)
|
||||
|
||||
[node name="Knife" parent="." unique_id=1789694138 instance=ExtResource("23_qxyk8")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.2, 3)
|
||||
|
||||
[node name="Potato" parent="." unique_id=275760487 instance=ExtResource("24_u5c1m")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -3.9600005, 1.1400001, 2.2800002)
|
||||
|
||||
[node name="ChoppedPotato" parent="." unique_id=1564262551 instance=ExtResource("25_y7baw")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -3.96, 1.1400001, 1.6800001)
|
||||
|
||||
[node name="Chips2" parent="." unique_id=2054749156 instance=ExtResource("22_2ndvi")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -3.9600003, 1.1400001, 1.08)
|
||||
|
||||
@@ -1,72 +0,0 @@
|
||||
[gd_scene format=3 uid="uid://bbg7dwsbxxh1t"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://0y6wnjcsum6" path="res://stations/item_dispenser.gd" id="1_4m60m"]
|
||||
[ext_resource type="PackedScene" uid="uid://e4i6o5oriecx" path="res://items/PickupCube.tscn" id="2_nn8tr"]
|
||||
[ext_resource type="Script" uid="uid://cquqe4f1m1sw6" path="res://addons/godot-xr-tools/objects/snap_zone.gd" id="3_ahn1e"]
|
||||
[ext_resource type="PackedScene" uid="uid://mpapt5mkbuao" path="res://prefabs/slide_off_dome.tscn" id="4_nn8tr"]
|
||||
|
||||
[sub_resource type="SphereShape3D" id="SphereShape3D_xmbo2"]
|
||||
radius = 0.3
|
||||
|
||||
[sub_resource type="CylinderShape3D" id="CylinderShape3D_24d3s"]
|
||||
radius = 0.29541016
|
||||
|
||||
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_24d3s"]
|
||||
albedo_color = Color(0.1764706, 1, 1, 1)
|
||||
|
||||
[sub_resource type="BoxMesh" id="BoxMesh_irf4n"]
|
||||
material = SubResource("StandardMaterial3D_24d3s")
|
||||
size = Vector3(0.1, 0.1, 0.1)
|
||||
|
||||
[node name="CubeSideDispenser2" type="StaticBody3D" unique_id=200950572]
|
||||
script = ExtResource("1_4m60m")
|
||||
item_scene = ExtResource("2_nn8tr")
|
||||
|
||||
[node name="XRToolsSnapZone" type="Area3D" parent="." unique_id=1018021004]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.00070536137, 1.0440714, -0.002165556)
|
||||
collision_layer = 65536
|
||||
collision_mask = 65536
|
||||
script = ExtResource("3_ahn1e")
|
||||
snap_mode = 1
|
||||
metadata/_custom_type_script = "uid://cquqe4f1m1sw6"
|
||||
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="XRToolsSnapZone" unique_id=182042233]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.15291119, 0)
|
||||
shape = SubResource("SphereShape3D_xmbo2")
|
||||
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="." unique_id=1974757539]
|
||||
shape = SubResource("CylinderShape3D_24d3s")
|
||||
|
||||
[node name="SlideOffDome" parent="." unique_id=1427609426 instance=ExtResource("4_nn8tr")]
|
||||
|
||||
[node name="CSGCombiner3D" type="CSGCombiner3D" parent="." unique_id=1172420592]
|
||||
|
||||
[node name="CSGCylinder3D" type="CSGCylinder3D" parent="CSGCombiner3D" unique_id=1073546772]
|
||||
radius = 0.3
|
||||
sides = 32
|
||||
|
||||
[node name="Cubes" type="Node3D" parent="." unique_id=100532970]
|
||||
|
||||
[node name="MeshInstance3D" type="MeshInstance3D" parent="Cubes" unique_id=2040729886]
|
||||
transform = Transform3D(0.9709369, 0, 0.23933554, 0, 1, 0, -0.23933554, 0, 0.9709369, -0.0038359165, 1.0421022, -0.1349423)
|
||||
mesh = SubResource("BoxMesh_irf4n")
|
||||
|
||||
[node name="MeshInstance3D2" type="MeshInstance3D" parent="Cubes" unique_id=2119335322]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.1336323, 1.0421022, 0.049409628)
|
||||
mesh = SubResource("BoxMesh_irf4n")
|
||||
|
||||
[node name="MeshInstance3D3" type="MeshInstance3D" parent="Cubes" unique_id=896999260]
|
||||
transform = Transform3D(0.94914126, 0, -0.31485054, 0, 1, 0, 0.31485054, 0, 0.94914126, 0.021345377, 1.0421022, 0.13508391)
|
||||
mesh = SubResource("BoxMesh_irf4n")
|
||||
|
||||
[node name="MeshInstance3D4" type="MeshInstance3D" parent="Cubes" unique_id=1055210121]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.14830339, 1.0421022, 0.054090023)
|
||||
mesh = SubResource("BoxMesh_irf4n")
|
||||
|
||||
[node name="MeshInstance3D5" type="MeshInstance3D" parent="Cubes" unique_id=1800524097]
|
||||
transform = Transform3D(0.966823, 0, -0.2554472, 0, 1, 0, 0.2554472, 0, 0.966823, 0.12695658, 1.0421022, -0.07926583)
|
||||
mesh = SubResource("BoxMesh_irf4n")
|
||||
|
||||
[node name="MeshInstance3D6" type="MeshInstance3D" parent="Cubes" unique_id=192094054]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.11111963, 1.0421022, -0.094003916)
|
||||
mesh = SubResource("BoxMesh_irf4n")
|
||||
@@ -1,77 +0,0 @@
|
||||
[gd_scene format=3 uid="uid://q37nqadkibbp"]
|
||||
|
||||
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_p8umn"]
|
||||
albedo_color = Color(0.38, 0.35162666, 0.3268, 1)
|
||||
|
||||
[sub_resource type="BoxShape3D" id="BoxShape3D_vlqg6"]
|
||||
size = Vector3(1.2, 0.78000003, 0.6)
|
||||
|
||||
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_b53mu"]
|
||||
albedo_color = Color(0.46, 0.32261336, 0.2024, 1)
|
||||
|
||||
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_hgrxd"]
|
||||
albedo_color = Color(0.46, 0.46, 0.46, 1)
|
||||
metallic = 0.73
|
||||
metallic_specular = 0.83
|
||||
roughness = 0.3
|
||||
|
||||
[node name="Door" type="StaticBody3D" unique_id=964400290]
|
||||
|
||||
[node name="CSGCombinerWall" type="CSGCombiner3D" parent="." unique_id=1966373401]
|
||||
use_collision = true
|
||||
|
||||
[node name="CSGBox3D2" type="CSGBox3D" parent="CSGCombinerWall" unique_id=1920740063]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 3.1, 0)
|
||||
size = Vector3(0.6, 1.8000001, 0.6)
|
||||
material = SubResource("StandardMaterial3D_p8umn")
|
||||
|
||||
[node name="CSGBox3D3" type="CSGBox3D" parent="CSGCombinerWall" unique_id=747780779]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.5999999, 3.1, 0)
|
||||
size = Vector3(0.6, 1.8000001, 0.6)
|
||||
material = SubResource("StandardMaterial3D_p8umn")
|
||||
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="." unique_id=1127621100]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.3, 2.6302783, 0)
|
||||
shape = SubResource("BoxShape3D_vlqg6")
|
||||
|
||||
[node name="CSGCombinerDoor" type="CSGCombiner3D" parent="." unique_id=522743190]
|
||||
transform = Transform3D(0.087155804, 0, -0.9961947, 0, 1, 0, 0.9961947, 0, 0.087155804, -0.89999986, 0, 0)
|
||||
use_collision = true
|
||||
|
||||
[node name="CSGBox3D5" type="CSGBox3D" parent="CSGCombinerDoor" unique_id=34425292]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.29999995, 1.1, 0)
|
||||
size = Vector3(0.6, 2.2, 0.05)
|
||||
material = SubResource("StandardMaterial3D_b53mu")
|
||||
|
||||
[node name="CSGBox3D6" type="CSGBox3D" parent="CSGCombinerDoor" unique_id=397451563]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.48594975, 1.1787889, -0.0049031973)
|
||||
size = Vector3(0.22, 0.42, 0.06)
|
||||
material = SubResource("StandardMaterial3D_hgrxd")
|
||||
|
||||
[node name="CSGCylinder3D" type="CSGCylinder3D" parent="CSGCombinerDoor" unique_id=3701079]
|
||||
transform = Transform3D(1, 0, 0, 0, -4.371139e-08, 1, 0, -1, -4.371139e-08, 0.29999995, 1.6800001, 0)
|
||||
operation = 2
|
||||
radius = 0.15
|
||||
height = 0.2
|
||||
sides = 32
|
||||
|
||||
[node name="CSGCombinerDoor2" type="CSGCombiner3D" parent="." unique_id=454018491]
|
||||
transform = Transform3D(-0.087155804, 8.709011e-08, 0.9961947, 0, 1, -8.742278e-08, 0.9961947, 7.619402e-09, 0.087155804, 0.3000002, 0, 0)
|
||||
use_collision = true
|
||||
|
||||
[node name="CSGBox3D5" type="CSGBox3D" parent="CSGCombinerDoor2" unique_id=312337639]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.29999995, 1.1, 0)
|
||||
size = Vector3(0.6, 2.2, 0.05)
|
||||
material = SubResource("StandardMaterial3D_b53mu")
|
||||
|
||||
[node name="CSGBox3D6" type="CSGBox3D" parent="CSGCombinerDoor2" unique_id=359915386]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.49211836, 1.1787889, -0.0049031973)
|
||||
size = Vector3(0.22, 0.42, 0.06)
|
||||
material = SubResource("StandardMaterial3D_hgrxd")
|
||||
|
||||
[node name="CSGCylinder3D" type="CSGCylinder3D" parent="CSGCombinerDoor2" unique_id=1793882462]
|
||||
transform = Transform3D(1, 0, 0, 0, -4.371139e-08, 1, 0, -1, -4.371139e-08, 0.29999995, 1.6800001, 0)
|
||||
operation = 2
|
||||
radius = 0.15
|
||||
height = 0.2
|
||||
sides = 32
|
||||
@@ -1,6 +1,6 @@
|
||||
[gd_scene format=3 uid="uid://c1nv4w33fedj6"]
|
||||
|
||||
[ext_resource type="Script" path="res://main.gd" id="1_72gy5"]
|
||||
[ext_resource type="Script" uid="uid://d1cefhe3yyyds" path="res://Net/multiplayer_world.gd" id="1_jfr2g"]
|
||||
[ext_resource type="PackedScene" uid="uid://j5s5wus7tuhb" path="res://prefabs/XROrigin.tscn" id="2_8wkh3"]
|
||||
[ext_resource type="Material" uid="uid://cmia50cfqxxo4" path="res://textures/dev_material_3d.tres" id="3_m56cs"]
|
||||
[ext_resource type="PackedScene" uid="uid://j7caslh27nor" path="res://stations/Hob.tscn" id="4_5kvh0"]
|
||||
@@ -35,7 +35,8 @@ ssil_enabled = true
|
||||
sdfgi_enabled = true
|
||||
|
||||
[node name="Main" type="Node3D" unique_id=1312265607]
|
||||
script = ExtResource("1_72gy5")
|
||||
script = ExtResource("1_jfr2g")
|
||||
populate_from_layout = false
|
||||
|
||||
[node name="XROrigin3D" parent="." unique_id=2055526621 instance=ExtResource("2_8wkh3")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.36171648, 0, 0.81835127)
|
||||
@@ -61,7 +62,7 @@ shape = SubResource("BoxShape3D_vlqg6")
|
||||
mesh = SubResource("BoxMesh_24d3s")
|
||||
|
||||
[node name="Hob" parent="." unique_id=1687971542 instance=ExtResource("4_5kvh0")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.29336345, 0.5, -1.484)
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.29336345, 0.015500337, -1.484)
|
||||
|
||||
[node name="WorldEnvironment" type="WorldEnvironment" parent="." unique_id=1177077250]
|
||||
environment = SubResource("Environment_bvwq1")
|
||||
@@ -112,7 +113,7 @@ transform = Transform3D(1, 0, -2.2351742e-08, -2.9802322e-08, 1.0000001, 0, -2.6
|
||||
transform = Transform3D(1, 0, -2.2351742e-08, -2.9802322e-08, 1.0000001, -5.293956e-23, -2.6077032e-08, 1.4901161e-08, 1, 0.7462772, 1.0768684, -1.1673055)
|
||||
|
||||
[node name="Sink" parent="." unique_id=2055277359 instance=ExtResource("12_8apyq")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 1.3147688, 0.5, -1.4940417)
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 1.3147688, 0.015500337, -1.4940417)
|
||||
|
||||
[node name="DirtStation" parent="." unique_id=160842153 instance=ExtResource("13_jnwcx")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 2.0864775, 0.5, -1.244947)
|
||||
@@ -148,16 +149,16 @@ transform = Transform3D(1, 0, -2.2351742e-08, -2.9802322e-08, 1.0000001, 0, -2.6
|
||||
transform = Transform3D(1, 0, -2.2351742e-08, -2.9802322e-08, 1.0000001, -5.293956e-23, -2.6077032e-08, 1.4901161e-08, 1, -1.4505737, 1.0734154, 0.16882455)
|
||||
|
||||
[node name="Counter" parent="." unique_id=1487893288 instance=ExtResource("15_yy81s")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.7124918, 0.5, -1.4886917)
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.7124918, 0.015500337, -1.4886917)
|
||||
|
||||
[node name="Counter2" parent="." unique_id=368890752 instance=ExtResource("15_yy81s")]
|
||||
transform = Transform3D(-4.371139e-08, 0, 1, 0, 1, 0, -1, 0, -4.371139e-08, -1.7648025, 0.5, -0.4458799)
|
||||
transform = Transform3D(-4.371139e-08, 0, 1, 0, 1, 0, -1, 0, -4.371139e-08, -1.7648025, 0.015500337, -0.4458799)
|
||||
|
||||
[node name="Counter3" parent="." unique_id=1498817646 instance=ExtResource("15_yy81s")]
|
||||
transform = Transform3D(-4.371139e-08, 0, 1, 0, 1, 0, -1, 0, -4.371139e-08, -1.7648025, 0.5, 0.55367994)
|
||||
transform = Transform3D(-4.371139e-08, 0, 1, 0, 1, 0, -1, 0, -4.371139e-08, -1.7648025, 0.015500337, 0.55367994)
|
||||
|
||||
[node name="Counter4" parent="." unique_id=906748771 instance=ExtResource("15_yy81s")]
|
||||
transform = Transform3D(-4.371139e-08, 0, 1, 0, 1, 0, -1, 0, -4.371139e-08, -1.7648025, 0.5, 1.5539298)
|
||||
transform = Transform3D(-4.371139e-08, 0, 1, 0, 1, 0, -1, 0, -4.371139e-08, -1.7648025, 0.015500337, 1.5539298)
|
||||
|
||||
[node name="Hamburger3" parent="." unique_id=369573848 instance=ExtResource("10_qacki")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1.7201865, 1.142413, 0.14773655)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[gd_scene format=3 uid="uid://c30i6h32w8p47"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://d1cefhe3yyyds" path="res://scenes/multiplayer_world.gd" id="1_kdan8"]
|
||||
[ext_resource type="Script" uid="uid://d1cefhe3yyyds" path="res://Net/multiplayer_world.gd" id="1_kdan8"]
|
||||
[ext_resource type="PackedScene" uid="uid://j5s5wus7tuhb" path="res://prefabs/XROrigin.tscn" id="2_g30gi"]
|
||||
[ext_resource type="Material" uid="uid://cmia50cfqxxo4" path="res://textures/dev_material_3d.tres" id="3_75ecy"]
|
||||
[ext_resource type="Sky" uid="uid://c1abtpwhdm2d5" path="res://textures/sky/NightSkyHDRI009_16K.tres" id="5_c3xgf"]
|
||||
|
||||
@@ -1,154 +0,0 @@
|
||||
extends Node3D
|
||||
|
||||
## World script for the multiplayer scene. Consumes the host/join request set
|
||||
## by the main menu, spawns the world's stations/items on whichever machine
|
||||
## owns the world (server, or the local player when offline), spawns/despawns
|
||||
## a player avatar per connected peer, and returns to the menu if the session
|
||||
## ends.
|
||||
##
|
||||
## The world's actual content (stations, items) is NOT baked into this scene —
|
||||
## it's spawned at runtime from Net/world_layout.gd via NetworkManager, so a
|
||||
## joining client receives it from the server (MultiplayerSpawner replays
|
||||
## existing spawns to late joiners) instead of relying on its own local copy
|
||||
## matching.
|
||||
|
||||
const PLAYER_SCENE := preload("res://Player/net_player.tscn")
|
||||
|
||||
## Whether to spawn the full WorldLayout on the machine that owns the world.
|
||||
## The real game scene wants this; focused debug scenes (test/) bake their own
|
||||
## handful of stations and items instead and turn it off, so the thing under
|
||||
## test isn't sharing the world with a second copy of the whole kitchen.
|
||||
@export var populate_from_layout: bool = true
|
||||
|
||||
var xr_interface: XRInterface
|
||||
var _populated := false
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
xr_interface = XRServer.find_interface("OpenXR")
|
||||
if xr_interface and xr_interface.is_initialized():
|
||||
DisplayServer.window_set_vsync_mode(DisplayServer.VSYNC_DISABLED)
|
||||
get_viewport().use_xr = true
|
||||
|
||||
NetworkManager.register_world(self, $PlayersSpawner, $ItemsSpawner)
|
||||
NetworkManager.player_joined.connect(_on_player_joined)
|
||||
NetworkManager.player_left.connect(_on_player_left)
|
||||
NetworkManager.session_started.connect(_on_session_started)
|
||||
NetworkManager.session_ended.connect(_on_session_ended)
|
||||
NetworkManager.connection_failed.connect(_on_connection_failed)
|
||||
|
||||
# world_ready() is what actually calls host()/join() (or the cmdline
|
||||
# equivalent). Populating before this point is wrong for EVERY case, not
|
||||
# just offline: is_online() is still false until host()/join() runs, so
|
||||
# owns_world() would read true for a joining client too, and it would
|
||||
# build its own local copy instead of receiving the server's via the
|
||||
# spawner. host() emits session_started synchronously, which populates
|
||||
# via _on_session_started below; the explicit call after world_ready()
|
||||
# only matters for the case where neither host() nor join() ran (no
|
||||
# pending session, no cmdline args) — running this scene directly offline.
|
||||
NetworkManager.world_ready()
|
||||
_populate_world_if_owner()
|
||||
|
||||
get_tree().create_timer(3.0).timeout.connect(_log_world_state)
|
||||
|
||||
|
||||
# Temporary-ish sanity check: confirms WorldContent actually ended up
|
||||
# populated on this peer (whether by spawning it or by receiving it via
|
||||
# replication), so a silent replication failure shows up in the net log
|
||||
# instead of just an empty-looking world.
|
||||
func _log_world_state() -> void:
|
||||
NetworkManager.log_line("World state: WorldContent=%d children, Players=%d children" % [$WorldContent.get_child_count(), $Players.get_child_count()])
|
||||
|
||||
|
||||
func _exit_tree() -> void:
|
||||
NetworkManager.unregister_world()
|
||||
|
||||
|
||||
func _on_session_started(_is_server: bool) -> void:
|
||||
NetworkManager.gate_existing_stations()
|
||||
_populate_world_if_owner()
|
||||
|
||||
|
||||
## Spawns the world's stations/items exactly once, on the machine that owns
|
||||
## world logic (server or offline). Safe to call multiple times/entry points.
|
||||
func _populate_world_if_owner() -> void:
|
||||
if _populated or not populate_from_layout:
|
||||
return
|
||||
# WorldLayout reads the live scene tree to find what to replicate, so it
|
||||
# needs to be an instance sitting in that tree — its methods can't be called
|
||||
# on the class itself.
|
||||
var layout := WorldLayout.new()
|
||||
add_child(layout)
|
||||
var authored := layout.get_station_nodes()
|
||||
authored.append_array(layout.get_item_nodes())
|
||||
|
||||
# The stations and items authored into the scene file are a *template*, not
|
||||
# the live world. Only the server turns them into real objects, spawned
|
||||
# through NetworkManager so they replicate. Every peer therefore drops its
|
||||
# own authored copies: the client would otherwise show its local originals
|
||||
# on top of the server's replicated ones, and the two sets would drift apart
|
||||
# because only the server's are synced.
|
||||
if not NetworkManager.owns_world():
|
||||
NetworkManager.log_line("Clearing %d authored nodes; the server's copies replace them" % authored.size())
|
||||
_remove_authored(authored)
|
||||
layout.queue_free()
|
||||
return
|
||||
|
||||
_init_recipes()
|
||||
_populated = true
|
||||
var stations := layout.get_stations()
|
||||
var items := layout.get_items()
|
||||
layout.queue_free()
|
||||
_remove_authored(authored)
|
||||
NetworkManager.log_line("Populating world: %d stations, %d items" % [stations.size(), items.size()])
|
||||
for d in stations:
|
||||
NetworkManager.spawn_item(d["scene"], d["xform"], d["name"], d["props"])
|
||||
for d in items:
|
||||
NetworkManager.spawn_item(d["scene"], d["xform"], d["name"], d["props"])
|
||||
NetworkManager.log_line("World populated")
|
||||
|
||||
|
||||
func _init_recipes():
|
||||
GameManager.meals_in_play = ["hamburger"]
|
||||
GameManager.sides_in_play = ["cube"]
|
||||
|
||||
|
||||
# Free the authored template nodes. Done immediately rather than with
|
||||
# queue_free() so the names are released before the replicated copies are
|
||||
# spawned under the same ones.
|
||||
func _remove_authored(nodes: Array[Node]) -> void:
|
||||
for node in nodes:
|
||||
if is_instance_valid(node):
|
||||
node.get_parent().remove_child(node)
|
||||
node.free()
|
||||
|
||||
|
||||
## Only the server (or the single offline machine) materialises player
|
||||
## avatars; MultiplayerSpawner replicates the result to everyone else,
|
||||
## including late joiners.
|
||||
func _on_player_joined(peer_id: int) -> void:
|
||||
if not NetworkManager.owns_world() or $Players.has_node(str(peer_id)):
|
||||
return
|
||||
var p := PLAYER_SCENE.instantiate()
|
||||
p.name = str(peer_id)
|
||||
$Players.add_child(p, true)
|
||||
NetworkManager.log_line("Spawned avatar for peer %d" % peer_id)
|
||||
|
||||
|
||||
func _on_player_left(peer_id: int) -> void:
|
||||
if not NetworkManager.owns_world():
|
||||
return
|
||||
var p := $Players.get_node_or_null(str(peer_id))
|
||||
if p:
|
||||
p.queue_free()
|
||||
NetworkManager.log_line("Despawned avatar for peer %d" % peer_id)
|
||||
|
||||
|
||||
func _on_session_ended() -> void:
|
||||
NetworkManager.log_line("Session ended, returning to main menu")
|
||||
get_tree().change_scene_to_file("res://Scenes/mainMenu.tscn")
|
||||
|
||||
|
||||
func _on_connection_failed() -> void:
|
||||
NetworkManager.log_line("Connection failed, returning to main menu")
|
||||
get_tree().change_scene_to_file("res://Scenes/mainMenu.tscn")
|
||||
@@ -1 +0,0 @@
|
||||
uid://d1cefhe3yyyds
|
||||
+10
-7
@@ -1,6 +1,6 @@
|
||||
[gd_scene format=3 uid="uid://dbgu4r127ke5v"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://d1cefhe3yyyds" path="res://scenes/multiplayer_world.gd" id="1_atgwk"]
|
||||
[ext_resource type="Script" uid="uid://d1cefhe3yyyds" path="res://Net/multiplayer_world.gd" id="1_atgwk"]
|
||||
[ext_resource type="Sky" uid="uid://c1abtpwhdm2d5" path="res://textures/sky/NightSkyHDRI009_16K.tres" id="2_1jq86"]
|
||||
[ext_resource type="PackedScene" uid="uid://j5s5wus7tuhb" path="res://prefabs/XROrigin.tscn" id="3_bryd6"]
|
||||
[ext_resource type="Material" uid="uid://cmia50cfqxxo4" path="res://textures/dev_material_3d.tres" id="4_kpgm6"]
|
||||
@@ -13,7 +13,8 @@
|
||||
[ext_resource type="PackedScene" uid="uid://caf0xanmxbshy" path="res://stations/table.tscn" id="11_gaw43"]
|
||||
[ext_resource type="PackedScene" uid="uid://clujaf3u776a3" path="res://addons/godot-xr-tools/objects/viewport_2d_in_3d.tscn" id="12_n58f2"]
|
||||
[ext_resource type="PackedScene" uid="uid://xtcei2uvd5li" path="res://UI/game_over_panel.tscn" id="13_hooyg"]
|
||||
[ext_resource type="Script" uid="uid://cwijoksyou1ey" path="res://scenes/GameOvercontroler.gd" id="14_cqmpj"]
|
||||
[ext_resource type="Script" uid="uid://cwijoksyou1ey" path="res://prefabs/GameOvercontroler.gd" id="14_cqmpj"]
|
||||
[ext_resource type="PackedScene" uid="uid://sc6i0i1f0o48" path="res://stations/potato_dispenser.tscn" id="15_hooyg"]
|
||||
|
||||
[sub_resource type="Environment" id="Environment_bvwq1"]
|
||||
background_mode = 2
|
||||
@@ -92,10 +93,9 @@ transform = Transform3D(-4.371139e-08, 0, -1, 0, 1, 0, 1, 0, -4.371139e-08, 9.93
|
||||
shape = SubResource("BoxShape3D_24d3s")
|
||||
|
||||
[node name="Hob" parent="." unique_id=1687971542 instance=ExtResource("5_gfdi7")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.507, 0)
|
||||
|
||||
[node name="Counter" parent="." unique_id=1487893288 instance=ExtResource("7_jnxsa")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.6, 0.512, 0)
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.6, 0, 0)
|
||||
|
||||
[node name="Potato" parent="." unique_id=962444046 instance=ExtResource("8_1qeqw")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1.273382, 1.5940565, -0.036002517)
|
||||
@@ -110,13 +110,13 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.6, 0, 0)
|
||||
script = ExtResource("9_atgwk")
|
||||
|
||||
[node name="Sink" parent="." unique_id=1559059799 instance=ExtResource("10_dhas4")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 1.2, 0.5, 0)
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 1.2, 0, 0)
|
||||
|
||||
[node name="Table" parent="." unique_id=1863572470 instance=ExtResource("11_gaw43")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -2.4, 0.5, 1.8)
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1.8, 0, 1.8)
|
||||
|
||||
[node name="GameOverPanel" parent="." unique_id=522901881 instance=ExtResource("12_n58f2")]
|
||||
transform = Transform3D(-4.371139e-08, 0, 1, 0, 1, 0, -1, 0, -4.371139e-08, -4.428178, 2.8122003, 3)
|
||||
transform = Transform3D(-4.371139e-08, 0, -1, 0, 1, 0, 1, 0, -4.371139e-08, 2.7718225, 2.8122003, 1.8000003)
|
||||
scene = ExtResource("13_hooyg")
|
||||
viewport_size = Vector2(900, 600)
|
||||
transparent = 0
|
||||
@@ -125,3 +125,6 @@ scene_properties_keys = PackedStringArray("game_over_panel.gd")
|
||||
|
||||
[node name="controler" type="Node" parent="GameOverPanel" unique_id=1442195864]
|
||||
script = ExtResource("14_cqmpj")
|
||||
|
||||
[node name="PotatoDispenser" parent="." unique_id=1410160280 instance=ExtResource("15_hooyg")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1.8000002, 0, 0)
|
||||
|
||||
@@ -1,62 +0,0 @@
|
||||
extends Node
|
||||
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready() -> void:
|
||||
print(get_stations())
|
||||
print(get_items())
|
||||
|
||||
|
||||
|
||||
func get_node_data(node):
|
||||
# {"scene": "res://Stations/Hob.tscn", "name": "Hob",
|
||||
# "xform": Transform3D(Basis(), Vector3(0.29336345, 0.8981018, -1.484)), "props": {}},
|
||||
var data = {}
|
||||
data["scene"] = node.scene_file_path
|
||||
data["name"] = node.name
|
||||
data["xform"] = node.transform
|
||||
data["props"] = {}
|
||||
var scrip = node.get_script()
|
||||
if scrip:
|
||||
for i in scrip.get_script_property_list():
|
||||
if i.usage & PROPERTY_USAGE_STORAGE:
|
||||
data["props"][i["name"]] = node.get(i["name"])
|
||||
return data
|
||||
|
||||
|
||||
func get_stations() -> Array[Dictionary]:
|
||||
var Stations = ResourceLoader.list_directory("res://Stations/")
|
||||
|
||||
var Stations2 = []
|
||||
for i in Stations:
|
||||
Stations2.append("res://Stations/" + i)
|
||||
Stations = Stations2
|
||||
|
||||
var Stations_nodes = []
|
||||
for i in get_tree().root.find_children("*", "StaticBody3D", true, false):
|
||||
if i.scene_file_path in Stations:
|
||||
Stations_nodes.append(i)
|
||||
|
||||
var data: Array[Dictionary] = []
|
||||
for i in Stations_nodes:
|
||||
data.append(get_node_data(i))
|
||||
return data
|
||||
|
||||
|
||||
func get_items() -> Array[Dictionary]:
|
||||
var Items = ResourceLoader.list_directory("res://Items/")
|
||||
|
||||
var Items2 = []
|
||||
for i in Items:
|
||||
Items2.append("res://Items/" + i)
|
||||
Items = Items2
|
||||
|
||||
var Items_nodes = []
|
||||
for i in get_tree().root.find_children("*", "XRToolsPickable", true, false):
|
||||
if i.scene_file_path in Items:
|
||||
Items_nodes.append(i)
|
||||
|
||||
var data: Array[Dictionary] = []
|
||||
for i in Items_nodes:
|
||||
data.append(get_node_data(i))
|
||||
return data
|
||||
@@ -1 +0,0 @@
|
||||
uid://k8ywnvlhcic4
|
||||
@@ -1,21 +0,0 @@
|
||||
[gd_scene format=3 uid="uid://da6yrsnxvsrif"]
|
||||
|
||||
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_p8umn"]
|
||||
albedo_color = Color(0.38, 0.35162666, 0.3268, 1)
|
||||
|
||||
[sub_resource type="BoxShape3D" id="BoxShape3D_vlqg6"]
|
||||
size = Vector3(0.6, 0.34027833, 0.6)
|
||||
|
||||
[node name="Wall" type="StaticBody3D" unique_id=434181749]
|
||||
|
||||
[node name="CSGCombiner3D" type="CSGCombiner3D" parent="." unique_id=671294008]
|
||||
use_collision = true
|
||||
|
||||
[node name="CSGBox3D2" type="CSGBox3D" parent="CSGCombiner3D" unique_id=308631620]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 2, 0)
|
||||
size = Vector3(0.6, 4, 0.6)
|
||||
material = SubResource("StandardMaterial3D_p8umn")
|
||||
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="." unique_id=1166811333]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.0501393, 0)
|
||||
shape = SubResource("BoxShape3D_vlqg6")
|
||||
Reference in New Issue
Block a user