6 Commits

Author SHA1 Message Date
JonShard d2f5e1fd4f jon scene: preview grid scales 2026-07-27 14:41:10 +02:00
JonShard 5dae9c5779 Add Plate dispenser 2026-07-27 14:40:38 +02:00
JonShard 488feff7dc Add raw burger and cube dispenser 2026-07-27 14:20:44 +02:00
JonShard b7775e9de6 Add progress bar to Table 2026-07-27 13:32:04 +02:00
JonShard 01587e3b9c Add progress bar to Sink 2026-07-27 12:53:33 +02:00
JonShard f4b2e687b5 Add Progress bar to Hob 2026-07-27 10:16:44 +02:00
17 changed files with 706 additions and 204 deletions
+4 -4
View File
@@ -45,7 +45,7 @@ static func get_combination_result(first_id: StringName, second_id: StringName)
return get_item_scene(result_id)
static func get_cooking_result(ingredient_id: StringName) -> PackedScene:
static func get_cooking_result(ingredient_id: StringName) -> String:
load_recipes()
for cooked_id in _cooking_map.keys():
var cook_defs = _cooking_map[cooked_id]
@@ -53,12 +53,12 @@ static func get_cooking_result(ingredient_id: StringName) -> PackedScene:
if typeof(cook_defs) == TYPE_ARRAY:
for cook_def in cook_defs:
if cook_def["ingredient"] == ingredient_id:
return get_item_scene(cooked_id)
return cooked_id
else:
var cook_def = cook_defs
if cook_def["ingredient"] == ingredient_id:
return get_item_scene(cooked_id)
return null
return cooked_id
return ""
static func get_cooking_time(ingredient_id: StringName) -> float:
+223 -130
View File
@@ -4,41 +4,44 @@
[ext_resource type="PackedScene" uid="uid://j5s5wus7tuhb" path="res://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="PackedScene" uid="uid://j7caslh27nor" path="res://Stations/Hob.tscn" id="4_ctden"]
[ext_resource type="PackedScene" uid="uid://e4i6o5oriecx" path="res://Items/PickupCube.tscn" id="6_eoxxy"]
[ext_resource type="Sky" uid="uid://c1abtpwhdm2d5" path="res://Textures/sky/NightSkyHDRI009_16K.tres" id="7_n8fyw"]
[ext_resource type="PackedScene" uid="uid://c0lknik4noobs" path="res://Items/BurgerBuns.tscn" id="8_rraok"]
[ext_resource type="PackedScene" uid="uid://c6rift56ql3f8" path="res://Stations/BurgerBunsDispenser.tscn" id="9_sq0s2"]
[ext_resource type="PackedScene" uid="uid://bp3v1jl8pctro" path="res://Containers/plate.tscn" id="10_ay2w6"]
[ext_resource type="PackedScene" uid="uid://dpot5qie20vf6" path="res://Items/burger.tscn" id="11_qn1ku"]
[ext_resource type="PackedScene" uid="uid://b3m2ag8g5rj4r" path="res://Items/hamburger.tscn" id="12_hfwnn"]
[ext_resource type="PackedScene" uid="uid://cwnwo4i28upap" path="res://Stations/raw_burger_dispenser.tscn" id="11_ctden"]
[ext_resource type="PackedScene" uid="uid://bbg7dwsbxxh1t" path="res://Scenes/cube_side_dispense.tscn" id="12_57ppd"]
[ext_resource type="PackedScene" uid="uid://ck5tuftqmyiue" path="res://Stations/plate_dispenser.tscn" id="13_irf4n"]
[ext_resource type="PackedScene" uid="uid://dvrk268s7gkxh" path="res://Stations/sink.tscn" id="13_o1b3t"]
[ext_resource type="PackedScene" uid="uid://cnjwtnhwh0i8q" path="res://Stations/dirt_station.tscn" id="14_irf4n"]
[ext_resource type="PackedScene" uid="uid://cfc4ho67u4r5e" path="res://Items/cooked_burger.tscn" id="15_ctden"]
[ext_resource type="PackedScene" uid="uid://efaec6ymgabo" path="res://Stations/Counter.tscn" id="15_di04w"]
[ext_resource type="PackedScene" uid="uid://caf0xanmxbshy" path="res://Stations/table.tscn" id="16_di04w"]
[sub_resource type="BoxShape3D" id="BoxShape3D_vlqg6"]
size = Vector3(5, 0.1, 5)
[sub_resource type="BoxMesh" id="BoxMesh_24d3s"]
material = ExtResource("3_irf4n")
size = Vector3(5, 0.1, 5)
[sub_resource type="Environment" id="Environment_bvwq1"]
background_mode = 2
sky = ExtResource("7_n8fyw")
ambient_light_source = 3
ambient_light_color = Color(1, 1, 1, 1)
ambient_light_sky_contribution = 0.9
reflected_light_source = 2
ssr_enabled = true
ssao_enabled = true
ssil_enabled = true
sdfgi_enabled = true
[sub_resource type="BoxShape3D" id="BoxShape3D_vlqg6"]
size = Vector3(20, 0.1, 20)
[sub_resource type="BoxMesh" id="BoxMesh_24d3s"]
material = ExtResource("3_irf4n")
size = Vector3(20, 0.1, 20)
[sub_resource type="BoxShape3D" id="BoxShape3D_24d3s"]
size = Vector3(5.1, 10, 0.1)
size = Vector3(20, 10, 0.1)
[node name="Main" type="Node3D" unique_id=1312265607]
script = ExtResource("1_57ppd")
[node name="WorldEnvironment" type="WorldEnvironment" parent="." unique_id=1177077250]
environment = SubResource("Environment_bvwq1")
[node name="XROrigin3D" parent="." unique_id=2055526621 instance=ExtResource("2_o1b3t")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.36171648, 0, 0.81835127)
@@ -55,132 +58,222 @@ shape = SubResource("BoxShape3D_vlqg6")
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.00018164515, 0.0006352663, -0.002532661)
mesh = SubResource("BoxMesh_24d3s")
[node name="Hob" parent="." unique_id=1687971542 instance=ExtResource("4_ctden")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.29336345, 0.8981018, -1.484)
[node name="InvisibleWalls" type="StaticBody3D" parent="." unique_id=315740174]
[node name="WorldEnvironment" type="WorldEnvironment" parent="." unique_id=1177077250]
environment = SubResource("Environment_bvwq1")
[node name="CollisionShape3D" type="CollisionShape3D" parent="InvisibleWalls" unique_id=33059670]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 4.688614, 8.838269)
shape = SubResource("BoxShape3D_24d3s")
[node name="BurgerBuns" parent="." unique_id=1088240294 instance=ExtResource("8_rraok")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1.8162017, 1.6081157, -1.4714175)
[node name="CollisionShape3D2" type="CollisionShape3D" parent="InvisibleWalls" unique_id=2018792171]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 4.688614, -10.243342)
shape = SubResource("BoxShape3D_24d3s")
[node name="BurgerBunsDispenser" parent="." unique_id=1720683779 instance=ExtResource("9_sq0s2")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1.832131, 0.40028095, -1.4813508)
[node name="CollisionShape3D3" type="CollisionShape3D" parent="InvisibleWalls" unique_id=757662929]
transform = Transform3D(-4.371139e-08, 0, -1, 0, 1, 0, 1, 0, -4.371139e-08, -9.807113, 4.688614, -0.018813243)
shape = SubResource("BoxShape3D_24d3s")
[node name="Plate" parent="." unique_id=190487773 instance=ExtResource("10_ay2w6")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1.5717233, 1.5454081, 1.5373346)
[node name="burger" parent="." unique_id=1417604760 instance=ExtResource("11_qn1ku")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.6888188, 1.4195822, -1.7110313)
[node name="burger2" parent="." unique_id=1584460510 instance=ExtResource("11_qn1ku")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.6931299, 1.5300478, -1.71225)
[node name="burger3" parent="." unique_id=1884095916 instance=ExtResource("11_qn1ku")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.69027674, 1.4969791, -1.7210286)
[node name="burger4" parent="." unique_id=1844818864 instance=ExtResource("11_qn1ku")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.69134104, 1.4543622, -1.7210286)
[node name="Hamburger" parent="." unique_id=761091445 instance=ExtResource("12_hfwnn")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1.9352558, 1.623975, 1.2447833)
[node name="PickableObject" parent="." unique_id=1675596942 instance=ExtResource("6_eoxxy")]
transform = Transform3D(1, 0, -2.2351742e-08, -2.9802322e-08, 1.0000001, 0, -2.6077032e-08, 1.4901161e-08, 1, 0.6225724, 1.4792972, -1.0473135)
[node name="PickableObject2" parent="." unique_id=713087634 instance=ExtResource("6_eoxxy")]
transform = Transform3D(1, 0, -2.2351742e-08, -2.9802322e-08, 1.0000001, -5.293956e-23, -2.6077032e-08, 1.4901161e-08, 1, 0.6359743, 1.4639391, -1.1673055)
[node name="PickableObject3" parent="." unique_id=879935619 instance=ExtResource("6_eoxxy")]
transform = Transform3D(1, 0, -2.2351742e-08, -2.9802322e-08, 1.0000001, 0, -2.6077032e-08, 1.4901161e-08, 1, 0.5142721, 1.4792972, -1.0473135)
[node name="PickableObject4" parent="." unique_id=198541902 instance=ExtResource("6_eoxxy")]
transform = Transform3D(1, 0, -2.2351742e-08, -2.9802322e-08, 1.0000001, -5.293956e-23, -2.6077032e-08, 1.4901161e-08, 1, 0.5276739, 1.4639391, -1.1673055)
[node name="Hamburger2" parent="." unique_id=1349934579 instance=ExtResource("12_hfwnn")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1.9857153, 1.5329368, 0.9472374)
[node name="PickableObject5" parent="." unique_id=1021333509 instance=ExtResource("6_eoxxy")]
transform = Transform3D(1, 0, -2.2351742e-08, -2.9802322e-08, 1.0000001, 0, -2.6077032e-08, 1.4901161e-08, 1, 0.73287535, 1.4792972, -1.0473135)
[node name="PickableObject6" parent="." unique_id=1268843669 instance=ExtResource("6_eoxxy")]
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.4639391, -1.1673055)
[node name="Sink" parent="." unique_id=2055277359 instance=ExtResource("13_o1b3t")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 1.3140475, 0.9061539, -1.4941733)
[node name="DirtStation" parent="." unique_id=160842153 instance=ExtResource("14_irf4n")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 2.0864775, 0.8981018, -1.244947)
[node name="Plate2" parent="." unique_id=356790445 instance=ExtResource("10_ay2w6")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1.5730225, 1.499024, 0.59790254)
[node name="CookedBurger" parent="." unique_id=1127807542 instance=ExtResource("15_ctden")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.30671906, 1.4131018, -1.0928738)
[node name="CookedBurger2" parent="." unique_id=160088590 instance=ExtResource("15_ctden")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.30671906, 1.4496142, -1.0928738)
[node name="CookedBurger3" parent="." unique_id=992183367 instance=ExtResource("15_ctden")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1.3344773, 1.4398065, -0.7096845)
[node name="CookedBurger4" parent="." unique_id=1837607086 instance=ExtResource("15_ctden")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.30671906, 1.525444, -1.0928738)
[node name="BurgerBuns2" parent="." unique_id=1210358958 instance=ExtResource("8_rraok")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1.3596323, 1.4110342, -0.22482127)
[node name="PickableObject7" parent="." unique_id=641653545 instance=ExtResource("6_eoxxy")]
transform = Transform3D(1, 0, -2.2351742e-08, -2.9802322e-08, 1.0000001, 0, -2.6077032e-08, 1.4901161e-08, 1, -1.3556751, 1.4792972, 0.28881657)
[node name="PickableObject8" parent="." unique_id=1733819363 instance=ExtResource("6_eoxxy")]
transform = Transform3D(1, 0, -2.2351742e-08, -2.9802322e-08, 1.0000001, -5.293956e-23, -2.6077032e-08, 1.4901161e-08, 1, -1.3422732, 1.4639391, 0.16882455)
[node name="PickableObject9" parent="." unique_id=12419746 instance=ExtResource("6_eoxxy")]
transform = Transform3D(1, 0, -2.2351742e-08, -2.9802322e-08, 1.0000001, 0, -2.6077032e-08, 1.4901161e-08, 1, -1.4639754, 1.4792972, 0.28881657)
[node name="PickableObject10" parent="." unique_id=313160217 instance=ExtResource("6_eoxxy")]
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.4639391, 0.16882455)
[node name="Counter" parent="." unique_id=1487893288 instance=ExtResource("15_di04w")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.7124918, 0.90304357, -1.4886917)
[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, -1.7648025, 0.90304357, -0.4458799)
[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, -1.7648025, 0.90304357, 0.55367994)
[node name="Counter4" parent="." unique_id=906748771 instance=ExtResource("15_di04w")]
transform = Transform3D(-4.371139e-08, 0, 1, 0, 1, 0, -1, 0, -4.371139e-08, -1.7648025, 0.90304357, 1.5539298)
[node name="CollisionShape3D4" type="CollisionShape3D" parent="InvisibleWalls" unique_id=1468386997]
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="Table" parent="." unique_id=1863572470 instance=ExtResource("16_di04w")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.50244665, 0.9030438, -0.20709503)
initial_thinking_time = 8.0
initial_primary_time = 40.0
initial_friend_time = 3.0
initial_eating_time = 3.0
transform = Transform3D(-1, 0, 8.742277e-08, 0, 1, 0, -8.742277e-08, 0, -1, 4.371851, 0.9030438, 2.043332)
[node name="Hamburger3" parent="." unique_id=369573848 instance=ExtResource("12_hfwnn")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1.7201865, 1.5329367, 0.14773655)
[node name="Hob" parent="." unique_id=1687971542 instance=ExtResource("4_ctden")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.5104445, 0.50655985, -1.5450908)
[node name="Plate3" parent="." unique_id=2004250522 instance=ExtResource("10_ay2w6")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1.5818124, 1.499024, -0.4634577)
[node name="Sink" parent="." unique_id=2055277359 instance=ExtResource("13_o1b3t")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 1.5311285, 0.51461196, -1.5552641)
[node name="StaticBody3D" type="StaticBody3D" parent="." unique_id=315740174]
[node name="DirtStation" parent="." unique_id=160842153 instance=ExtResource("14_irf4n")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 2.3035586, 0.50655985, -1.3060378)
[node name="CollisionShape3D" type="CollisionShape3D" parent="StaticBody3D" unique_id=33059670]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 4.688614, 2.5070028)
shape = SubResource("BoxShape3D_24d3s")
[node name="Counter" parent="." unique_id=1487893288 instance=ExtResource("15_di04w")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.49541074, 0.5115016, -1.5497825)
[node name="CollisionShape3D2" type="CollisionShape3D" parent="StaticBody3D" unique_id=2018792171]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 4.688614, -2.5446289)
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, -1.5477214, 0.5115016, -0.50697076)
[node name="CollisionShape3D3" type="CollisionShape3D" parent="StaticBody3D" unique_id=757662929]
transform = Transform3D(-4.371139e-08, 0, -1, 0, 1, 0, 1, 0, -4.371139e-08, -2.525816, 4.688614, -0.018813243)
shape = SubResource("BoxShape3D_24d3s")
[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, -1.5477214, 0.5115016, 0.49258912)
[node name="CollisionShape3D4" type="CollisionShape3D" parent="StaticBody3D" unique_id=1468386997]
transform = Transform3D(-4.371139e-08, 0, -1, 0, 1, 0, 1, 0, -4.371139e-08, 2.525816, 4.688614, -0.018813023)
shape = SubResource("BoxShape3D_24d3s")
[node name="Counter4" parent="Counter3" unique_id=1748373996 instance=ExtResource("15_di04w")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 2.0022283, 0, 1.1920929e-07)
[node name="BurgerBunsDispenser" parent="." unique_id=1720683779 instance=ExtResource("9_sq0s2")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1.5069376, 0.008738995, 1.4692857)
[node name="RawBurgerDispenser" parent="." unique_id=235630131 instance=ExtResource("11_ctden")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.46601868, 0.008738995, 1.514677)
[node name="CubeSideDispenser2" parent="." unique_id=200950572 instance=ExtResource("12_57ppd")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.48943835, 0.008738995, 1.5010021)
[node name="PlateDispenser" parent="." unique_id=710538846 instance=ExtResource("13_irf4n")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 1.5185561, 0.008738995, 1.5010021)
[node name="120pScale" type="Node3D" parent="." unique_id=391874704]
transform = Transform3D(1.2, 0, 0, 0, 1, 0, 0, 0, 1.2, 0, 0, -9.780844)
[node name="Hob" parent="120pScale" unique_id=662730978 instance=ExtResource("4_ctden")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.5104445, 0.50655985, 2.7905889)
[node name="Sink" parent="120pScale" unique_id=1712283042 instance=ExtResource("13_o1b3t")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 1.5311285, 0.51461196, 2.7804155)
[node name="DirtStation" parent="120pScale" unique_id=2020221472 instance=ExtResource("14_irf4n")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 2.3035586, 0.50655985, 3.0296416)
[node name="Counter" parent="120pScale" unique_id=777536364 instance=ExtResource("15_di04w")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.49541074, 0.5115016, 2.785897)
[node name="Counter2" parent="120pScale" unique_id=176818776 instance=ExtResource("15_di04w")]
transform = Transform3D(-4.371139e-08, 0, 1, 0, 1, 0, -1, 0, -4.371139e-08, -1.5477214, 0.5115016, 3.8287086)
[node name="Counter3" parent="120pScale" unique_id=1015688641 instance=ExtResource("15_di04w")]
transform = Transform3D(-4.371139e-08, 0, 1, 0, 1, 0, -1, 0, -4.371139e-08, -1.5477214, 0.5115016, 4.8282685)
[node name="Counter4" parent="120pScale/Counter3" unique_id=173290755 instance=ExtResource("15_di04w")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 2.0022283, 0, 1.1920929e-07)
[node name="BurgerBunsDispenser" parent="120pScale" unique_id=417029530 instance=ExtResource("9_sq0s2")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1.5069376, 0.008738995, 5.804965)
[node name="RawBurgerDispenser" parent="120pScale" unique_id=755472941 instance=ExtResource("11_ctden")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.46601868, 0.008738995, 5.8503566)
[node name="CubeSideDispenser2" parent="120pScale" unique_id=1477835376 instance=ExtResource("12_57ppd")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.48943835, 0.008738995, 5.8366814)
[node name="PlateDispenser" parent="120pScale" unique_id=1708099903 instance=ExtResource("13_irf4n")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 1.4638411, 0.008738995, 5.8702817)
[node name="Label3D" type="Label3D" parent="120pScale" unique_id=604601061]
transform = Transform3D(-4.371139e-08, 0, 1, 0, 1, 0, -1, 0, -4.371139e-08, -2.2435148, 2.335534, 4.6659527)
text = "120%
"
font_size = 46
[node name="80pScale" type="Node3D" parent="." unique_id=2061791473]
transform = Transform3D(0.8, 0, 0, 0, 1, 0, 0, 0, 0.8, 0, 0, 0.28955865)
[node name="Hob" parent="80pScale" unique_id=1891403697 instance=ExtResource("4_ctden")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.5104445, 0.50655985, 2.7905889)
[node name="Sink" parent="80pScale" unique_id=333923291 instance=ExtResource("13_o1b3t")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 1.5311285, 0.51461196, 2.7804155)
[node name="DirtStation" parent="80pScale" unique_id=1288624896 instance=ExtResource("14_irf4n")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 2.3035586, 0.50655985, 3.0296416)
[node name="Counter" parent="80pScale" unique_id=1461535152 instance=ExtResource("15_di04w")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.49541074, 0.5115016, 2.785897)
[node name="Counter2" parent="80pScale" unique_id=1842130256 instance=ExtResource("15_di04w")]
transform = Transform3D(-4.371139e-08, 0, 1, 0, 1, 0, -1, 0, -4.371139e-08, -1.5477214, 0.5115016, 3.8287086)
[node name="Counter3" parent="80pScale" unique_id=100608898 instance=ExtResource("15_di04w")]
transform = Transform3D(-4.371139e-08, 0, 1, 0, 1, 0, -1, 0, -4.371139e-08, -1.5477214, 0.5115016, 4.8282685)
[node name="Counter4" parent="80pScale/Counter3" unique_id=205099411 instance=ExtResource("15_di04w")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 2.0022283, 0, 1.1920929e-07)
[node name="BurgerBunsDispenser" parent="80pScale" unique_id=1496193985 instance=ExtResource("9_sq0s2")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1.5069376, 0.008738995, 5.804965)
[node name="RawBurgerDispenser" parent="80pScale" unique_id=612011076 instance=ExtResource("11_ctden")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.46601868, 0.008738995, 5.8503566)
[node name="CubeSideDispenser2" parent="80pScale" unique_id=384901968 instance=ExtResource("12_57ppd")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.48943835, 0.008738995, 5.8366814)
[node name="PlateDispenser" parent="80pScale" unique_id=1230329184 instance=ExtResource("13_irf4n")]
transform = Transform3D(0.99999994, 0, 0, 0, 1, 0, 0, 0, 0.99999994, 1.518556, 0.008738995, 5.7869906)
[node name="Label3D" type="Label3D" parent="80pScale" unique_id=941448791]
transform = Transform3D(-4.3711374e-08, 0, 0.99999964, 0, 1, 0, -0.99999964, 0, -4.3711374e-08, -2.1597714, 2.335534, 4.6659484)
text = "80%
"
font_size = 46
[node name="60pScale" type="Node3D" parent="." unique_id=1767900653]
transform = Transform3D(0.6, 0, 0, 0, 1, 0, 0, 0, 0.6, 0, 0, 3.9962738)
[node name="Hob" parent="60pScale" unique_id=1110757850 instance=ExtResource("4_ctden")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.5104445, 0.50655985, 2.7905889)
[node name="Sink" parent="60pScale" unique_id=1692043650 instance=ExtResource("13_o1b3t")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 1.5311285, 0.51461196, 2.7804155)
[node name="DirtStation" parent="60pScale" unique_id=1095305719 instance=ExtResource("14_irf4n")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 2.3035586, 0.50655985, 3.0296416)
[node name="Counter" parent="60pScale" unique_id=482904015 instance=ExtResource("15_di04w")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.49541074, 0.5115016, 2.785897)
[node name="Counter2" parent="60pScale" unique_id=1339102916 instance=ExtResource("15_di04w")]
transform = Transform3D(-4.371139e-08, 0, 1, 0, 1, 0, -1, 0, -4.371139e-08, -1.5477214, 0.5115016, 3.8287086)
[node name="Counter3" parent="60pScale" unique_id=112241594 instance=ExtResource("15_di04w")]
transform = Transform3D(-4.371139e-08, 0, 1, 0, 1, 0, -1, 0, -4.371139e-08, -1.5477214, 0.5115016, 4.8282685)
[node name="Counter4" parent="60pScale/Counter3" unique_id=1565091496 instance=ExtResource("15_di04w")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 2.0022283, 0, 1.1920929e-07)
[node name="BurgerBunsDispenser" parent="60pScale" unique_id=533207183 instance=ExtResource("9_sq0s2")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1.5069376, 0.008738995, 5.804965)
[node name="RawBurgerDispenser" parent="60pScale" unique_id=1003755733 instance=ExtResource("11_ctden")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.46601868, 0.008738995, 5.8503566)
[node name="CubeSideDispenser2" parent="60pScale" unique_id=1167014983 instance=ExtResource("12_57ppd")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.48943835, 0.008738995, 5.8366814)
[node name="PlateDispenser" parent="60pScale" unique_id=577890056 instance=ExtResource("13_irf4n")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 1.4638411, 0.008738995, 5.8702817)
[node name="Label3D" type="Label3D" parent="60pScale" unique_id=108085819]
transform = Transform3D(-4.371139e-08, 0, 1, 0, 1, 0, -1, 0, -4.371139e-08, -1.8827287, 2.335534, 4.665953)
text = "60%"
font_size = 46
[node name="50pScale" type="Node3D" parent="." unique_id=834529278]
transform = Transform3D(-0.5, 0, 7.54979e-08, 0, 1, 0, -7.54979e-08, 0, -0.5, 4.8798494, 0, 8.821305)
[node name="Hob" parent="50pScale" unique_id=193607269 instance=ExtResource("4_ctden")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.5104445, 0.50655985, 2.7905889)
[node name="Sink" parent="50pScale" unique_id=1409032259 instance=ExtResource("13_o1b3t")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 1.5311285, 0.51461196, 2.7804155)
[node name="DirtStation" parent="50pScale" unique_id=1640346888 instance=ExtResource("14_irf4n")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 2.3035586, 0.50655985, 3.0296416)
[node name="Counter" parent="50pScale" unique_id=217653424 instance=ExtResource("15_di04w")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.49541074, 0.5115016, 2.785897)
[node name="Counter2" parent="50pScale" unique_id=33532645 instance=ExtResource("15_di04w")]
transform = Transform3D(-4.371139e-08, 0, 1, 0, 1, 0, -1, 0, -4.371139e-08, -1.5477214, 0.5115016, 3.8287086)
[node name="Counter3" parent="50pScale" unique_id=195687577 instance=ExtResource("15_di04w")]
transform = Transform3D(-4.371139e-08, 0, 1, 0, 1, 0, -1, 0, -4.371139e-08, -1.5477214, 0.5115016, 4.8282685)
[node name="Counter4" parent="50pScale/Counter3" unique_id=544361476 instance=ExtResource("15_di04w")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 2.0022283, 0, 1.1920929e-07)
[node name="BurgerBunsDispenser" parent="50pScale" unique_id=1491805771 instance=ExtResource("9_sq0s2")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1.5069376, 0.008738995, 5.804965)
[node name="RawBurgerDispenser" parent="50pScale" unique_id=912918674 instance=ExtResource("11_ctden")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.46601868, 0.008738995, 5.8503566)
[node name="CubeSideDispenser2" parent="50pScale" unique_id=1841444767 instance=ExtResource("12_57ppd")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.48943835, 0.008738995, 5.8366814)
[node name="PlateDispenser" parent="50pScale" unique_id=1730806405 instance=ExtResource("13_irf4n")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 1.4638411, 0.008738995, 5.8702817)
[node name="Label3D" type="Label3D" parent="50pScale" unique_id=1266832827]
transform = Transform3D(-4.371139e-08, 0, 1, 0, 1, 0, -1, 0, -4.371139e-08, -1.2148323, 2.335534, 4.665949)
text = "50%"
font_size = 46
+67
View File
@@ -0,0 +1,67 @@
[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"]
[sub_resource type="SphereShape3D" id="SphereShape3D_xmbo2"]
radius = 0.3
[sub_resource type="CylinderShape3D" id="CylinderShape3D_24d3s"]
[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]
shape = SubResource("SphereShape3D_xmbo2")
[node name="CollisionShape3D" type="CollisionShape3D" parent="." unique_id=1974757539]
shape = SubResource("CylinderShape3D_24d3s")
[node name="CSGCombiner3D" type="CSGCombiner3D" parent="." unique_id=1172420592]
[node name="CSGCylinder3D" type="CSGCylinder3D" parent="CSGCombiner3D" unique_id=1073546772]
radius = 0.4
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")
+6 -3
View File
@@ -3,6 +3,7 @@
[ext_resource type="Script" uid="uid://cquqe4f1m1sw6" path="res://addons/godot-xr-tools/objects/snap_zone.gd" id="1_dlkho"]
[sub_resource type="BoxShape3D" id="BoxShape3D_24d3s"]
size = Vector3(1, 1, 1.0517578)
[sub_resource type="SphereShape3D" id="SphereShape3D_dlkho"]
radius = 0.3
@@ -15,7 +16,8 @@ albedo_color = Color(1.1759251, 0.741115, 0.5692133, 1)
[node name="Counter" type="StaticBody3D" unique_id=1487893288 groups=["station"]]
[node name="CollisionShape3D" type="CollisionShape3D" parent="." unique_id=692568688]
[node name="CollisionShape3DCuttingBoard" type="CollisionShape3D" parent="." unique_id=706340473]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0.025878906)
shape = SubResource("BoxShape3D_24d3s")
[node name="XRToolsSnapZone" type="Area3D" parent="." unique_id=1647380272 groups=["station"]]
@@ -31,6 +33,7 @@ transform = Transform3D(0.5, 0, 0, 0, 0.5, 0, 0, 0, 0.5, 0, -0.000975132, 0)
shape = SubResource("SphereShape3D_dlkho")
[node name="CSGCombiner3D" type="CSGCombiner3D" parent="." unique_id=451757283]
use_collision = true
[node name="CSGBox3D" type="CSGBox3D" parent="CSGCombiner3D" unique_id=305755330]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.045776367, 0)
@@ -64,8 +67,8 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.060837455, 0.12459713, 0.55
radius = 0.025492515
[node name="CSGBox3D6" type="CSGBox3D" parent="CSGCombiner3D" unique_id=187377667]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.060742255, 0.4885016, 0.0011152327)
size = Vector3(0.56365967, 0.092285156, 0.42160034)
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.060742255, 0.51602846, 0.0011152327)
size = Vector3(0.56365967, 0.037231445, 0.42160034)
material = SubResource("StandardMaterial3D_vlqg6")
[node name="CSGBox3D6" type="CSGBox3D" parent="CSGCombiner3D/CSGBox3D6" unique_id=1146824846]
+9 -4
View File
@@ -2,8 +2,10 @@
[ext_resource type="Script" uid="uid://bsn8vhv5adxdo" path="res://Stations/hob.gd" id="1_7jc4g"]
[ext_resource type="Script" uid="uid://cquqe4f1m1sw6" path="res://addons/godot-xr-tools/objects/snap_zone.gd" id="2_er1dp"]
[ext_resource type="PackedScene" uid="uid://bxbocxdaayvwx" path="res://UI/progress_bar.tscn" id="3_7uuqv"]
[ext_resource type="Script" uid="uid://bv7oracwmgre8" path="res://UI/progress_bar_3d.gd" id="3_zz9kp"]
[sub_resource type="BoxShape3D" id="BoxShape3D_24d3s"]
[sub_resource type="BoxShape3D" id="BoxShape3D_kdxnr"]
[sub_resource type="SphereShape3D" id="SphereShape3D_vlqg6"]
radius = 0.3
@@ -20,7 +22,7 @@ properties/1/replication_mode = 1
script = ExtResource("1_7jc4g")
[node name="CollisionShape3D" type="CollisionShape3D" parent="." unique_id=1283846023]
shape = SubResource("BoxShape3D_24d3s")
shape = SubResource("BoxShape3D_kdxnr")
[node name="XRToolsSnapZone" type="Area3D" parent="." unique_id=538157739]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.5270121, 0)
@@ -112,6 +114,9 @@ transform = Transform3D(0.94465846, 0, 0, 0, 0.94465846, 0, 0, 0, 0.94465846, -0
operation = 2
size = Vector3(0.9842529, 0.8349304, 0.072387695)
[node name="Sync" type="MultiplayerSynchronizer" parent="."]
root_path = NodePath("..")
[node name="Sync" type="MultiplayerSynchronizer" parent="." unique_id=768992259]
replication_config = SubResource("SceneReplicationConfig_np_hob")
[node name="ProgressBar3D" parent="." unique_id=654673176 instance=ExtResource("3_7uuqv")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.74736404, -0.09216304)
script = ExtResource("3_zz9kp")
+26 -5
View File
@@ -4,14 +4,29 @@ const RECIPE_MANAGER = preload("res://RecipeManager.gd")
@export var cook_speed = 1
@onready var snap_zone: XRToolsSnapZone = $XRToolsSnapZone
@onready var progress_bar: ProgressBar3D = $ProgressBar3D
var time_cooked = 0
var cooking_result = null
var cooking_result: String
var cooking_result_time = 0
func _ready() -> void:
if not progress_bar or progress_bar is not ProgressBar3D:
push_error("Hob missing reference to progressbar, or wrong type:", progress_bar)
snap_zone.has_picked_up.connect(_on_object_picked_up)
snap_zone.has_dropped.connect(_on_object_dropped)
_refresh_progress_bar()
func _refresh_progress_bar() -> void:
var progress := 0.0
if cooking_result and cooking_result_time > 0:
progress = clampf(float(time_cooked) / cooking_result_time, 0.0, 1.0)
#print("time_cooked: %s / cooking_result_time: %s = progress: %s" % [time_cooked, cooking_result_time, progress])
progress_bar.set_progress(progress)
progress_bar.set_bar_visible(not cooking_result.is_empty())
progress_bar.override_fill_color(Color.RED if cooking_result == "charcoal" else Color.GREEN)
func _on_object_picked_up(_item) -> void:
print("Hob: object picked up: ", _item)
@@ -23,21 +38,24 @@ func _on_object_picked_up(_item) -> void:
return
var result = RECIPE_MANAGER.get_cooking_result(_food_item.id)
if not result:
print("Hob: held a FoodItem that is not cookable, id: ", _food_item.id)
print("Hob: held a FoodItem that is not cookable, id: %s result: %s" % [_food_item.id, result])
return
cooking_result = result
cooking_result_time = RECIPE_MANAGER.get_cooking_time(_food_item.id)
print("Hob: set cooking_result ", cooking_result)
_refresh_progress_bar()
func _on_object_dropped() -> void:
print("Hob: object drop ")
time_cooked = 0
cooking_result = null
cooking_result = ""
cooking_result_time = 0
_refresh_progress_bar()
func convert_held_to_item(_item: PackedScene) -> void:
func convert_held_to_item(_item: String) -> void:
if not NetworkManager.owns_world():
return
print("Hob converting ", _item)
@@ -50,7 +68,7 @@ func convert_held_to_item(_item: PackedScene) -> void:
# Spawn the new item through the server so it replicates to every peer
# (including late joiners), in the old item's position.
var original_transform = old_pickable.global_transform
var new_scene_instance = NetworkManager.spawn_item(_item.resource_path, original_transform)
var new_scene_instance = NetworkManager.spawn_item(RECIPE_MANAGER.get_item_scene(_item).resource_path, original_transform)
# Drop and free the old item and pick up the new one
print("Hob freeing old_pickable ", old_pickable)
@@ -62,8 +80,11 @@ func convert_held_to_item(_item: PackedScene) -> void:
# If cooking something, progress cooking, when done, convert item
func _process(delta: float) -> void:
if cooking_result:
#print("Hob cooking_result: ", cooking_result)
time_cooked += cook_speed * delta
_refresh_progress_bar()
if time_cooked >= cooking_result_time:
time_cooked = 0
convert_held_to_item(cooking_result)
+102
View File
@@ -0,0 +1,102 @@
[gd_scene format=3 uid="uid://ck5tuftqmyiue"]
[ext_resource type="Script" uid="uid://0y6wnjcsum6" path="res://Stations/item_dispenser.gd" id="1_jm0ik"]
[ext_resource type="PackedScene" uid="uid://bp3v1jl8pctro" path="res://Containers/plate.tscn" id="2_tfo2i"]
[ext_resource type="Script" uid="uid://cquqe4f1m1sw6" path="res://addons/godot-xr-tools/objects/snap_zone.gd" id="3_lr065"]
[sub_resource type="SphereShape3D" id="SphereShape3D_xmbo2"]
radius = 0.3
[sub_resource type="CylinderShape3D" id="CylinderShape3D_24d3s"]
[node name="PlateDispenser" type="StaticBody3D" unique_id=710538846]
script = ExtResource("1_jm0ik")
item_scene = ExtResource("2_tfo2i")
[node name="XRToolsSnapZone" type="Area3D" parent="." unique_id=238176038]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.00070536137, 1.1603245, -0.002165556)
collision_layer = 65536
collision_mask = 65536
script = ExtResource("3_lr065")
snap_mode = 1
metadata/_custom_type_script = "uid://cquqe4f1m1sw6"
[node name="CollisionShape3D" type="CollisionShape3D" parent="XRToolsSnapZone" unique_id=1942470044]
shape = SubResource("SphereShape3D_xmbo2")
[node name="CollisionShape3D" type="CollisionShape3D" parent="." unique_id=831688237]
shape = SubResource("CylinderShape3D_24d3s")
[node name="CSGCombiner3D" type="CSGCombiner3D" parent="." unique_id=696108271]
[node name="CSGCylinder3D" type="CSGCylinder3D" parent="CSGCombiner3D" unique_id=1339763385]
radius = 0.4
sides = 32
[node name="Plates" type="Node3D" parent="." unique_id=1364909922]
[node name="CSGCombiner3D" type="CSGCombiner3D" parent="Plates" unique_id=2128650644]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.0289642, 0)
autosmooth = true
smoothing_angle = 103.9
[node name="CSGCylinder3D" type="CSGCylinder3D" parent="Plates/CSGCombiner3D" unique_id=472067854]
radius = 0.2
height = 0.03
sides = 16
[node name="CSGCylinder3D" type="CSGCylinder3D" parent="Plates/CSGCombiner3D/CSGCylinder3D" unique_id=7092994]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.010312311, 0)
operation = 2
radius = 0.15
height = 0.03
sides = 16
[node name="CSGCylinder3D2" type="CSGCylinder3D" parent="Plates/CSGCombiner3D" unique_id=23957958]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.027119078, 0)
radius = 0.15
height = 0.02
[node name="CSGCombiner3D2" type="CSGCombiner3D" parent="Plates" unique_id=404631280]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.0762081, 0)
autosmooth = true
smoothing_angle = 103.9
[node name="CSGCylinder3D" type="CSGCylinder3D" parent="Plates/CSGCombiner3D2" unique_id=943162425]
radius = 0.2
height = 0.03
sides = 16
[node name="CSGCylinder3D" type="CSGCylinder3D" parent="Plates/CSGCombiner3D2/CSGCylinder3D" unique_id=218364524]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.010312311, 0)
operation = 2
radius = 0.15
height = 0.03
sides = 16
[node name="CSGCylinder3D2" type="CSGCylinder3D" parent="Plates/CSGCombiner3D2" unique_id=1548327331]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.027119078, 0)
radius = 0.15
height = 0.02
[node name="CSGCombiner3D3" type="CSGCombiner3D" parent="Plates" unique_id=1506211353]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.1214186, 0)
autosmooth = true
smoothing_angle = 103.9
[node name="CSGCylinder3D" type="CSGCylinder3D" parent="Plates/CSGCombiner3D3" unique_id=739830577]
radius = 0.2
height = 0.03
sides = 16
[node name="CSGCylinder3D" type="CSGCylinder3D" parent="Plates/CSGCombiner3D3/CSGCylinder3D" unique_id=1882120753]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.010312311, 0)
operation = 2
radius = 0.15
height = 0.03
sides = 16
[node name="CSGCylinder3D2" type="CSGCylinder3D" parent="Plates/CSGCombiner3D3" unique_id=1904629745]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.027119078, 0)
radius = 0.15
height = 0.02
+94
View File
@@ -0,0 +1,94 @@
[gd_scene format=3 uid="uid://cwnwo4i28upap"]
[ext_resource type="Script" uid="uid://0y6wnjcsum6" path="res://Stations/item_dispenser.gd" id="1_gkb3v"]
[ext_resource type="PackedScene" uid="uid://dpot5qie20vf6" path="res://Items/burger.tscn" id="2_mep2a"]
[ext_resource type="Script" uid="uid://cquqe4f1m1sw6" path="res://addons/godot-xr-tools/objects/snap_zone.gd" id="3_3xuvi"]
[ext_resource type="Texture2D" uid="uid://cexxfyw03hr81" path="res://Textures/1.png" id="4_1f5le"]
[sub_resource type="SphereShape3D" id="SphereShape3D_xmbo2"]
radius = 0.3
[sub_resource type="CylinderShape3D" id="CylinderShape3D_24d3s"]
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_di04w"]
albedo_texture = ExtResource("4_1f5le")
[node name="RawBurgerDispenser" type="StaticBody3D" unique_id=235630131]
script = ExtResource("1_gkb3v")
item_scene = ExtResource("2_mep2a")
[node name="XRToolsSnapZone" type="Area3D" parent="." unique_id=1523586273]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.00070536137, 1.0645258, -0.002165556)
collision_layer = 65536
collision_mask = 65536
script = ExtResource("3_3xuvi")
snap_mode = 1
metadata/_custom_type_script = "uid://cquqe4f1m1sw6"
[node name="CollisionShape3D" type="CollisionShape3D" parent="XRToolsSnapZone" unique_id=2105824734]
shape = SubResource("SphereShape3D_xmbo2")
[node name="CollisionShape3D" type="CollisionShape3D" parent="." unique_id=378049928]
shape = SubResource("CylinderShape3D_24d3s")
[node name="CSGCombiner3D" type="CSGCombiner3D" parent="." unique_id=1275577257]
[node name="CSGCylinder3D" type="CSGCylinder3D" parent="CSGCombiner3D" unique_id=1973748218]
radius = 0.4
sides = 32
[node name="CSGCylinder3D2" type="CSGCylinder3D" parent="CSGCombiner3D" unique_id=590219609]
transform = Transform3D(1, 0, 0, 0, 0.9532462, 0.30219492, 0, -0.30219492, 0.9532462, -0.1276815, 1.0521446, -0.052202225)
radius = 0.08300781
height = 0.028435059
sides = 16
material = SubResource("StandardMaterial3D_di04w")
[node name="CSGCylinder3D3" type="CSGCylinder3D" parent="CSGCombiner3D" unique_id=177377476]
transform = Transform3D(1, 0, 0, 0, 0.9694763, 0.245185, 0, -0.245185, 0.9694763, 0.08106685, 1.0391599, -0.119440794)
radius = 0.08300781
height = 0.03
sides = 16
material = SubResource("StandardMaterial3D_di04w")
[node name="CSGCylinder3D4" type="CSGCylinder3D" parent="CSGCombiner3D" unique_id=622291452]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.19005477, 1.0198405, 0.049397707)
radius = 0.08300781
height = 0.03
sides = 16
material = SubResource("StandardMaterial3D_di04w")
[node name="CSGCylinder3D5" type="CSGCylinder3D" parent="CSGCombiner3D" unique_id=703594207]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.026051283, 1.0175319, 0.0042250156)
radius = 0.08300781
height = 0.03
sides = 16
material = SubResource("StandardMaterial3D_di04w")
[node name="CSGCylinder3D6" type="CSGCylinder3D" parent="CSGCombiner3D" unique_id=955808722]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.05739355, 1.0197641, 0.13219571)
radius = 0.08300781
height = 0.03
sides = 16
material = SubResource("StandardMaterial3D_di04w")
[node name="CSGCylinder3D7" type="CSGCylinder3D" parent="CSGCombiner3D" unique_id=1066788957]
transform = Transform3D(0.9111114, 0.40515354, 0.075673, -0.41123694, 0.8813372, 0.2326565, 0.027568169, -0.24309555, 0.9696106, 0.14799988, 1.0345665, 0.11710405)
radius = 0.08300781
height = 0.03
sides = 16
material = SubResource("StandardMaterial3D_di04w")
[node name="CSGCylinder3D8" type="CSGCylinder3D" parent="CSGCombiner3D" unique_id=553053058]
transform = Transform3D(0.9541017, 0.29948288, 0, -0.29948288, 0.9541017, 0, 0, 0, 1, 0.041060925, 1.0337045, 0.18304396)
radius = 0.08300781
height = 0.03
sides = 16
material = SubResource("StandardMaterial3D_di04w")
[node name="CSGCylinder3D9" type="CSGCylinder3D" parent="CSGCombiner3D" unique_id=980376661]
transform = Transform3D(0.8510151, 0.22759955, 0.47325662, -0.16729629, 0.97174567, -0.16649997, -0.49778044, 0.06251989, 0.8650468, 0.2036674, 1.0335208, -0.024382353)
radius = 0.08300781
height = 0.03
sides = 16
material = SubResource("StandardMaterial3D_di04w")
+47 -28
View File
@@ -1,40 +1,59 @@
extends StaticBody3D
const plate_wash_time: float = 3.0
@export var plate_scene : PackedScene
@export_range(0.0, 10.0, 0.1) var wash_speed: float = 1.0
@onready var snap_zone: XRToolsSnapZone = $XRToolsSnapZone
@onready var progress_bar: ProgressBar3D = $ProgressBar3D
var progress: float = 0.0
var time_washed: float = 0.0
var is_washing: bool = false
var plate: PlateController = null
func _ready() -> void:
if not plate_scene:
push_error("Sink is missing reference to plate scene")
if not progress_bar or progress_bar is not ProgressBar3D:
push_error("Sink missing reference to progressbar, or wrong type:", progress_bar)
snap_zone.has_picked_up.connect(_on_object_picked_up)
snap_zone.has_dropped.connect(_on_object_dropped)
progress_bar.override_fill_color(Color.DODGER_BLUE)
_refresh_progress_bar()
func _refresh_progress_bar() -> void:
progress_bar.set_progress(clampf(float(time_washed) / plate_wash_time, 0.0, 1.0))
progress_bar.set_bar_visible(is_washing)
func _on_object_picked_up(_item) -> void:
print("Sink: object picked up: ", _item)
plate = _item.get_node_or_null("PlateController") as PlateController
if plate:
is_washing = plate.is_dirty
func _on_object_dropped() -> void:
print("Sink: object drop ")
_reset_sink()
func _reset_sink():
time_washed = 0
is_washing = false
plate = null
_refresh_progress_bar()
func complete_washing():
plate.is_dirty = false
_reset_sink()
print("Sink washing complete!")
func _process(delta: float) -> void:
var item = snap_zone.picked_up_object
if not item:
progress = 0
return # Exit early since there's nothing to process
var plate: PlateController = item.get_node_or_null("PlateController") as PlateController
if plate:
# Not dirty? Nothing to wash
if not plate.is_dirty:
return
# Washing logic using the encapsulated property
if progress >= plate_wash_time:
plate.is_dirty = false # This automatically updates visibility and the container state!
print("Sink washing complete!")
else:
progress += wash_speed * delta
print("Sink washing plate: ", progress)
# Sink empty, reset progress
if not snap_zone.picked_up_object:
progress = 0
if is_washing:
time_washed += wash_speed * delta
_refresh_progress_bar()
print("Sink washing plate: ", time_washed)
if time_washed >= plate_wash_time:
complete_washing()
+6 -4
View File
@@ -2,7 +2,7 @@
[ext_resource type="Script" uid="uid://byh5j25mwt3oc" path="res://Stations/sink.gd" id="1_7hh4b"]
[ext_resource type="Script" uid="uid://cquqe4f1m1sw6" path="res://addons/godot-xr-tools/objects/snap_zone.gd" id="2_3ocod"]
[ext_resource type="PackedScene" uid="uid://bp3v1jl8pctro" path="res://Containers/plate.tscn" id="2_ai6d4"]
[ext_resource type="PackedScene" uid="uid://bxbocxdaayvwx" path="res://UI/progress_bar.tscn" id="4_1pinr"]
[sub_resource type="BoxShape3D" id="BoxShape3D_24d3s"]
@@ -16,7 +16,6 @@ properties/0/replication_mode = 1
[node name="Sink" type="StaticBody3D" unique_id=2055277359 groups=["station"]]
script = ExtResource("1_7hh4b")
plate_scene = ExtResource("2_ai6d4")
[node name="CollisionShape3D" type="CollisionShape3D" parent="." unique_id=964735164]
shape = SubResource("BoxShape3D_24d3s")
@@ -41,6 +40,7 @@ shape = SubResource("SphereShape3D_dlkho")
transform = Transform3D(1.1506689, 0, 0, 0, 2.334253, 0, 0, 0, 1, 0, 1.2831618, 0.06031096)
operation = 2
radial_segments = 20
smooth_faces = false
[node name="CSGTorus3D" type="CSGTorus3D" parent="CSGCombiner3D" unique_id=2055166617]
transform = Transform3D(-4.371139e-08, -1, 0, 1, -4.371139e-08, 0, 0, 0, 0.84928787, 0, 0.5107032, -0.20686007)
@@ -81,6 +81,8 @@ transform = Transform3D(1.3113414e-07, 0.12955962, 0.99157166, 8.8817837e-16, 0.
operation = 2
size = Vector3(1.4033203, 1.2053223, 0.352417)
[node name="Sync" type="MultiplayerSynchronizer" parent="."]
root_path = NodePath("..")
[node name="Sync" type="MultiplayerSynchronizer" parent="." unique_id=1601242574]
replication_config = SubResource("SceneReplicationConfig_np_sink")
[node name="ProgressBar3D" parent="." unique_id=654673176 instance=ExtResource("4_1pinr")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.8164611, -0.035980098)
+34 -15
View File
@@ -3,17 +3,17 @@ extends StaticBody3D
const GAME_MANAGER = preload("res://GameManager.gd")
@export var initial_thinking_time: float = 6
@export var initial_primary_time: float = 60
@export var initial_friend_time: float = 10
@export var initial_eating_time: float = 4
@export var thinking_duration: float = 6
@export var primary_duration: float = 23
@export var friend_duration: float = 10
@export var eating_duration: float = 4
@onready var label_3d: Label3D = $Label3D
@onready var label_3d_time: Label3D = $Label3DTime
@onready var snap_zones: Array[XRToolsSnapZone] = []
@onready var progress_bar: ProgressBar3D = $ProgressBar3D
const lbl_thinking: String = "Thinking..."
const lbl_waiting_primary: String = "Waiting for food"
const lbl_thinking: String = "..."
const lbl_gameover: String = "Game Over!"
const lbl_eating: String = "Eating..."
@@ -35,13 +35,18 @@ enum TableState {
## the same text. Use _setState(), never assign _state directly.
var _state: TableState = TableState.EMPTY: set = _set_state
var _state_time: float = 0.0: set = _set_state_time
var _state_duration: float = 0.0 # set in _set_state_time
var _unsatisfied_orders: Array[String] = []: set = _set_unsatisfied_orders
func _ready() -> void:
if not label_3d:
push_error("Table is missing reference to Label3D")
if not label_3d_time:
push_error("Table is missing reference to Label3DTime")
if not progress_bar or progress_bar is not ProgressBar3D:
push_error("Hob missing reference to progressbar, or wrong type:", progress_bar)
progress_bar.y_billboard = true
# Get snap_zones for plates, store in array snap_zones
for child in get_children():
@@ -64,7 +69,6 @@ func _on_object_picked_up(_item) -> void:
_absorb_item_if_correct(_item)
func _on_object_dropped() -> void:
print("Table: object dropped ")
@@ -128,14 +132,19 @@ func _setState(newState: TableState) -> void:
match newState:
TableState.EMPTY:
_state_time = 0.0
_state_duration = 0.0
TableState.THINKING:
_state_time = initial_eating_time
_state_time = eating_duration
_state_duration = eating_duration # Can't be done in _set_state(), will set duration inside timer
TableState.WAITING_PRIMARY:
_state_time = initial_primary_time
_state_time = primary_duration
_state_duration = primary_duration
TableState.WAITING_FRIEND:
_state_time = initial_friend_time
_state_time = friend_duration
_state_duration = friend_duration
TableState.EATING:
_state_time = initial_eating_time
_state_time = eating_duration
_state_duration = eating_duration
_state = newState
@@ -143,19 +152,29 @@ func _setState(newState: TableState) -> void:
## Pure presentation, driven off the current (locally authoritative or
## synced-from-server) state. Runs on every peer.
func _refresh_display() -> void:
if not label_3d:
return
match _state:
TableState.EMPTY:
progress_bar.set_bar_visible(false)
label_3d.text = "empty"
TableState.THINKING:
progress_bar.set_bar_visible(false)
label_3d.text = lbl_thinking
TableState.WAITING_PRIMARY, TableState.WAITING_FRIEND:
TableState.WAITING_PRIMARY:
label_3d.text = "%s\n%s" % [TableState.keys()[_state], "\n".join(_unsatisfied_orders)]
progress_bar.set_bar_visible(true)
progress_bar.override_fill_color(Color.RED if _state_time < 10 else Color.YELLOW)
TableState.WAITING_FRIEND:
label_3d.text = "%s\n%s" % [TableState.keys()[_state], "\n".join(_unsatisfied_orders)]
progress_bar.set_bar_visible(true)
progress_bar.override_fill_color(Color.RED if _state_time < 5 else Color.YELLOW)
TableState.EATING:
label_3d.text = lbl_eating
if label_3d_time:
progress_bar.set_bar_visible(false)
label_3d_time.text = "%.1f" % _state_time
print("_state_duration = ", _state_duration)
progress_bar.set_progress(clampf(float(_state_time) / _state_duration, 0.0, 1.0))
func _set_state(value: TableState) -> void:
+6 -1
View File
@@ -2,6 +2,7 @@
[ext_resource type="Script" uid="uid://caeikc7e3igkd" path="res://Stations/table.gd" id="1_2vcpj"]
[ext_resource type="Script" uid="uid://cquqe4f1m1sw6" path="res://addons/godot-xr-tools/objects/snap_zone.gd" id="1_8j1nt"]
[ext_resource type="PackedScene" uid="uid://bxbocxdaayvwx" path="res://UI/progress_bar.tscn" id="3_kjf1i"]
[sub_resource type="BoxShape3D" id="BoxShape3D_24d3s"]
@@ -162,10 +163,14 @@ vertical_alignment = 0
line_spacing = -15.0
[node name="Label3DTime" type="Label3D" parent="." unique_id=1534849507]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.3306234, 0)
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.4532461, 0)
pixel_size = 0.003
billboard = 2
text = "20.1s"
[node name="Sync" type="MultiplayerSynchronizer" parent="." unique_id=2000411505]
replication_config = SubResource("SceneReplicationConfig_np_table")
[node name="ProgressBar3D" parent="." unique_id=654673176 instance=ExtResource("3_kjf1i")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.3676775, 0)
y_billboard = true
+32
View File
@@ -0,0 +1,32 @@
[gd_scene format=3 uid="uid://bxbocxdaayvwx"]
[ext_resource type="Script" uid="uid://bv7oracwmgre8" path="res://UI/progress_bar_3d.gd" id="1_ng8tm"]
[sub_resource type="ViewportTexture" id="ViewportTexture_copv3"]
viewport_path = NodePath("Sprite3D/SubViewport")
[node name="ProgressBar3D" type="Node3D" unique_id=654673176]
script = ExtResource("1_ng8tm")
[node name="Sprite3D" type="Sprite3D" parent="." unique_id=1484008334]
pixel_size = 0.002
texture = SubResource("ViewportTexture_copv3")
[node name="SubViewport" type="SubViewport" parent="Sprite3D" unique_id=35936518]
transparent_bg = true
size = Vector2i(320, 80)
[node name="ProgressBar" type="ProgressBar" parent="Sprite3D/SubViewport" unique_id=727723524]
anchors_preset = 8
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_left = -150.0
offset_top = -13.5
offset_right = 150.0
offset_bottom = 36.5
grow_horizontal = 2
grow_vertical = 2
size_flags_horizontal = 4
size_flags_vertical = 4
+33
View File
@@ -0,0 +1,33 @@
extends Node3D
class_name ProgressBar3D
@export var y_billboard: bool = false
@onready var progress_bar: ProgressBar = $Sprite3D/SubViewport/ProgressBar
@onready var sprite_3d: Sprite3D = $Sprite3D
func _ready() -> void:
if not progress_bar:
push_error("Progressbar3D missing reference to ProgressBar")
if y_billboard:
$Sprite3D.billboard = BaseMaterial3D.BillboardMode.BILLBOARD_FIXED_Y
func set_progress(value: float) -> void:
print("ProgressBar set_progress: ", value)
progress_bar.value = clamp(value, 0.0, 1.0) * 100
func get_progress() -> float:
return progress_bar.value
func set_bar_visible(value: bool) -> void:
progress_bar.visible = value
func override_fill_color(color: Color) -> void:
var style_box := StyleBoxFlat.new()
style_box.bg_color = color
# Override the 'fill' StyleBox on the ProgressBar
progress_bar.add_theme_stylebox_override("fill", style_box)
+1
View File
@@ -0,0 +1 @@
uid://bv7oracwmgre8
+11 -3
View File
@@ -16,7 +16,8 @@
"dd822d14-88e5-4790-808e-7d2cf7f79133",
"784d5cd3-333a-40a9-b35f-3d0c73f00761",
"21bc19f1-ee3c-4bbb-ab9a-07ec6123a823",
"d93a31cd-d475-4c5a-87fc-983174b2594f"
"d93a31cd-d475-4c5a-87fc-983174b2594f",
"9d7ecbc4-db2a-4d09-9f40-ceed3cf98c00"
]
},
{
@@ -30,14 +31,14 @@
"uuid": "fab8a81b-7ca9-4026-96bb-ed66ea58ef2e",
"title": "Doing",
"tasks": [
"f8073eb2-8786-47b7-b63f-fa70c3f7115a",
"6942c45a-53a4-484f-9885-4f249cb4572b"
"f8073eb2-8786-47b7-b63f-fa70c3f7115a"
]
},
{
"uuid": "0d743057-955a-473a-8123-a3f805505d5d",
"title": "Done",
"tasks": [
"6942c45a-53a4-484f-9885-4f249cb4572b",
"a4dd35ae-dc8e-42a3-9044-bf1cb1af281a",
"1c3b9543-cb67-431d-bf71-c8753e816776",
"d9cebd68-792e-4d01-a916-7df5f128b4a8",
@@ -242,6 +243,13 @@
"description": "",
"category": "bf4ec62e-526e-4027-876f-0b22bd17f79a",
"steps": []
},
{
"uuid": "9d7ecbc4-db2a-4d09-9f40-ceed3cf98c00",
"title": "Add test that a hob can chain cook",
"description": "",
"category": "bf4ec62e-526e-4027-876f-0b22bd17f79a",
"steps": []
}
],
"layout": {
-2
View File
@@ -14,8 +14,6 @@ combining:
hamburger:
- [cooked_burger, burger_buns]
- [charcoal, charcoal]
charcoal:
- [cube, cube]
cooking:
cooked_burger: