Compare commits
21 Commits
1e1aa15b68
..
master
| Author | SHA1 | Date | |
|---|---|---|---|
| cd466c73b5 | |||
| acb96933a7 | |||
| d895bc0a47 | |||
| 4f9e22f0b9 | |||
| d83e276c52 | |||
| 0bb00735b2 | |||
| 4a8d5b879e | |||
| 1a7f641974 | |||
| f0bb044d12 | |||
| 08c3950583 | |||
| 9f33ee68c2 | |||
| 20a437681a | |||
| c18b09ab31 | |||
| 3153df7baa | |||
| 8ecde66441 | |||
| d7ccab2e3c | |||
| f28c987a3a | |||
| 9e0c3ed174 | |||
| 5ced240c43 | |||
| e65243055c | |||
| c159d26d4e |
@@ -0,0 +1,13 @@
|
|||||||
|
# Instructions
|
||||||
|
|
||||||
|
- Never do any commits.
|
||||||
|
- Keep answers short and concise.
|
||||||
|
- Don't do huge comments. Make them very short and only when necessary.
|
||||||
|
- Any comment that doesn't add more context than the code already provides should be omitted.
|
||||||
|
- Match the comment style of the rest of the project.
|
||||||
|
- Instead of commenting a block about what a function does, use short one-liner comments over sections of code within it. For example, where there are nested for loops and if statements, have one comment saying `# Find node based on criteria`.
|
||||||
|
- Always check syntax with the game engine.
|
||||||
|
- Read logs to confirm expected behavior when possible.
|
||||||
|
|
||||||
|
## About the project
|
||||||
|
- All players will always play as clients. The server will be headless.
|
||||||
@@ -19,9 +19,9 @@ var contained_items: Array[FoodItem] # Expose nice list of others to read
|
|||||||
func _ready() -> void:
|
func _ready() -> void:
|
||||||
area_3d.body_entered.connect(_on_body_entered)
|
area_3d.body_entered.connect(_on_body_entered)
|
||||||
if not area_3d:
|
if not area_3d:
|
||||||
push_error("Area3D node not found in container.gd")
|
SweetLogger.warning("{0} missing area_3d reference", [name])
|
||||||
if not xr_pickable:
|
if not xr_pickable:
|
||||||
push_error("XRPickable node not found in container.gd")
|
SweetLogger.warning("{0} missing xr_pickable reference", [name])
|
||||||
|
|
||||||
|
|
||||||
# Absorbing items is a server decision (the container's holder is server-
|
# Absorbing items is a server decision (the container's holder is server-
|
||||||
@@ -29,13 +29,13 @@ func _ready() -> void:
|
|||||||
func _on_body_entered(body: Node3D) -> void:
|
func _on_body_entered(body: Node3D) -> void:
|
||||||
if not NetworkManager.owns_world():
|
if not NetworkManager.owns_world():
|
||||||
return
|
return
|
||||||
SweetLogger.debug("enabled: {0}", [enabled])
|
SweetLogger.debug("Enabled: {0}", [enabled])
|
||||||
if not enabled:
|
if not enabled:
|
||||||
SweetLogger.debug("disabled in _on_body_entered body")
|
SweetLogger.debug("Disabled in _on_body_entered body")
|
||||||
return
|
return
|
||||||
if not body.is_in_group(target_group):
|
if not body.is_in_group(target_group):
|
||||||
return
|
return
|
||||||
SweetLogger.debug("body: {0}", [body])
|
SweetLogger.debug("Body: {0}", [body])
|
||||||
|
|
||||||
|
|
||||||
# If one of us is in a station
|
# If one of us is in a station
|
||||||
@@ -46,14 +46,14 @@ func _on_body_entered(body: Node3D) -> void:
|
|||||||
|
|
||||||
# If enough space, add item
|
# If enough space, add item
|
||||||
var food_item = body.get_node("FoodItem")
|
var food_item = body.get_node("FoodItem")
|
||||||
SweetLogger.debug("in station found {0} of type {1}: {2}", [target_group, FoodItem.Type.keys()[food_item.type], body.name], "container.gd", "_on_body_entered")
|
SweetLogger.debug("In station found {0} of type {1}: {2}", [target_group, FoodItem.Type.keys()[food_item.type], body.name], "container.gd", "_on_body_entered")
|
||||||
var meal_count := contained_items.filter(func(f): return f.type == FoodItem.Type.MEAL).size()
|
var meal_count := contained_items.filter(func(f): return f.type == FoodItem.Type.MEAL).size()
|
||||||
var side_count := contained_items.filter(func(f): return f.type == FoodItem.Type.SIDE).size()
|
var side_count := contained_items.filter(func(f): return f.type == FoodItem.Type.SIDE).size()
|
||||||
if food_item.type == FoodItem.Type.MEAL and meal_count < meal_positions.size():
|
if food_item.type == FoodItem.Type.MEAL and meal_count < meal_positions.size():
|
||||||
SweetLogger.debug("adding meal")
|
SweetLogger.debug("Adding meal")
|
||||||
_add_item(body)
|
_add_item(body)
|
||||||
if food_item.type == FoodItem.Type.SIDE and side_count < side_positions.size():
|
if food_item.type == FoodItem.Type.SIDE and side_count < side_positions.size():
|
||||||
SweetLogger.debug("adding side")
|
SweetLogger.debug("Adding side")
|
||||||
_add_item(body)
|
_add_item(body)
|
||||||
|
|
||||||
|
|
||||||
@@ -93,7 +93,7 @@ func _add_item(item: Node3D) -> void:
|
|||||||
NetworkManager.despawn_item(item)
|
NetworkManager.despawn_item(item)
|
||||||
# In case the container is on a table that needs to register this addition,
|
# In case the container is on a table that needs to register this addition,
|
||||||
# ask all table in scene to absorb any new items.
|
# ask all table in scene to absorb any new items.
|
||||||
SweetLogger.debug("group call absorb_items()")
|
SweetLogger.debug("Group call absorb_items()")
|
||||||
get_tree().call_group("table", "absorb_items")
|
get_tree().call_group("table", "absorb_items")
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ func get_food_items() -> Array[FoodItem]:
|
|||||||
|
|
||||||
func _ready() -> void:
|
func _ready() -> void:
|
||||||
if not dirty_node:
|
if not dirty_node:
|
||||||
push_error("Plate is missing its dirty_node")
|
SweetLogger.warning("{0} missing dirty_node reference", [name])
|
||||||
dirty_node.visible = is_dirty
|
dirty_node.visible = is_dirty
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+15
-55
@@ -1,94 +1,54 @@
|
|||||||
[gd_scene format=3 uid="uid://c0lknik4noobs"]
|
[gd_scene format=3 uid="uid://c0lknik4noobs"]
|
||||||
|
|
||||||
[ext_resource type="PackedScene" uid="uid://c8l60rnugru40" path="res://addons/godot-xr-tools/objects/pickable.tscn" id="1_g1t48"]
|
[ext_resource type="PackedScene" uid="uid://d8jo0402pgl6" path="res://abstract/food_item.tscn" id="1_food_item"]
|
||||||
[ext_resource type="PackedScene" uid="uid://ctw7nbntd5pcj" path="res://addons/godot-xr-tools/objects/grab_points/grab_point_hand_right.tscn" id="2_rwqhn"]
|
|
||||||
[ext_resource type="Animation" uid="uid://s1vqcxyqcvea" path="res://addons/godot-xr-tools/hands/animations/right/Grip 5.res" id="3_qaxva"]
|
|
||||||
[ext_resource type="Script" uid="uid://dvobm6vcfnqe8" path="res://addons/godot-xr-tools/hands/poses/hand_pose_settings.gd" id="4_wb51u"]
|
|
||||||
[ext_resource type="PackedScene" uid="uid://c25yxb0vt53vc" path="res://addons/godot-xr-tools/objects/grab_points/grab_point_hand_left.tscn" id="5_wqyr2"]
|
|
||||||
[ext_resource type="Animation" uid="uid://bediglpx0rj7i" path="res://addons/godot-xr-tools/hands/animations/left/Grip 5.res" id="6_ftab3"]
|
|
||||||
[ext_resource type="PackedScene" uid="uid://3lr2dhy62rhk" path="res://prefabs/combinable_item.tscn" id="7_wb51u"]
|
|
||||||
[ext_resource type="PackedScene" uid="uid://bfj80jh13t6e5" path="res://prefabs/food_item.tscn" id="8_t9y3x"]
|
|
||||||
[ext_resource type="PackedScene" uid="uid://b5ukku8i0hilb" path="res://prefabs/despawning_item.tscn" id="10_46e7r"]
|
|
||||||
[ext_resource type="Script" uid="uid://bwd0pe2udb5xo" path="res://Net/net_pickable.gd" id="20_netpk"]
|
|
||||||
|
|
||||||
[sub_resource type="CylinderShape3D" id="CylinderShape3D_vlqg6"]
|
[sub_resource type="CylinderShape3D" id="CylinderShape3D_vlqg6"]
|
||||||
height = 0.10708985
|
height = 0.10708985
|
||||||
radius = 0.107910156
|
radius = 0.107910156
|
||||||
|
|
||||||
[sub_resource type="Resource" id="Resource_wkb0k"]
|
|
||||||
script = ExtResource("4_wb51u")
|
|
||||||
closed_pose = ExtResource("3_qaxva")
|
|
||||||
metadata/_custom_type_script = "uid://dvobm6vcfnqe8"
|
|
||||||
|
|
||||||
[sub_resource type="Resource" id="Resource_j68hc"]
|
|
||||||
script = ExtResource("4_wb51u")
|
|
||||||
closed_pose = ExtResource("6_ftab3")
|
|
||||||
metadata/_custom_type_script = "uid://dvobm6vcfnqe8"
|
|
||||||
|
|
||||||
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_hoqox"]
|
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_hoqox"]
|
||||||
albedo_color = Color(0.6784191, 0.54546416, 0.016760282, 1)
|
albedo_color = Color(0.6784191, 0.54546416, 0.016760282, 1)
|
||||||
|
|
||||||
[sub_resource type="SceneReplicationConfig" id="SceneReplicationConfig_np_buns"]
|
[node name="BurgerBuns" unique_id=1088240294 instance=ExtResource("1_food_item")]
|
||||||
properties/0/path = NodePath(".:position")
|
|
||||||
properties/0/spawn = false
|
|
||||||
properties/0/replication_mode = 1
|
|
||||||
properties/1/path = NodePath(".:quaternion")
|
|
||||||
properties/1/spawn = false
|
|
||||||
properties/1/replication_mode = 1
|
|
||||||
properties/2/path = NodePath("NetPickable:net_held_by")
|
|
||||||
properties/2/spawn = true
|
|
||||||
properties/2/replication_mode = 1
|
|
||||||
|
|
||||||
[node name="BurgerBuns" unique_id=1088240294 instance=ExtResource("1_g1t48")]
|
|
||||||
second_hand_grab = 1
|
|
||||||
|
|
||||||
[node name="CollisionShape3D" parent="." index="0"]
|
[node name="CollisionShape3D" parent="." index="0"]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.05776599, 0)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.05776599, 0)
|
||||||
shape = SubResource("CylinderShape3D_vlqg6")
|
shape = SubResource("CylinderShape3D_vlqg6")
|
||||||
|
|
||||||
[node name="GrabPointHandRight" parent="." index="1" unique_id=141610509 instance=ExtResource("2_rwqhn")]
|
[node name="GrabPointHandLeft" parent="." index="1"]
|
||||||
transform = Transform3D(0.9978254, -0.06591213, 0, 0.06591213, 0.9978254, 0, 0, 0, 1, 0.08952884, 0.07439406, -0.056857675)
|
|
||||||
hand_pose = SubResource("Resource_wkb0k")
|
|
||||||
|
|
||||||
[node name="GrabPointHandLeft" parent="." index="2" unique_id=826213104 instance=ExtResource("5_wqyr2")]
|
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.08001605, 0.07612594, -0.05340144)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.08001605, 0.07612594, -0.05340144)
|
||||||
hand_pose = SubResource("Resource_j68hc")
|
|
||||||
|
|
||||||
[node name="CSGCombiner3DBuns" type="CSGCombiner3D" parent="." index="3" unique_id=178629624]
|
[node name="GrabPointHandRight" parent="." index="2"]
|
||||||
|
transform = Transform3D(0.9978254, -0.06591213, 0, 0.06591213, 0.9978254, 0, 0, 0, 1, 0.08952884, 0.07439406, -0.056857675)
|
||||||
|
|
||||||
|
[node name="FoodItem" parent="." index="3"]
|
||||||
|
id = "burger_buns"
|
||||||
|
type = 2
|
||||||
|
sell_value = 1
|
||||||
|
|
||||||
|
[node name="CSGCombiner3DBuns" type="CSGCombiner3D" parent="Model" index="0" unique_id=178629624]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.021904588, 0.025076538, -0.0044593215)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.021904588, 0.025076538, -0.0044593215)
|
||||||
autosmooth = true
|
autosmooth = true
|
||||||
smoothing_angle = 138.9
|
smoothing_angle = 138.9
|
||||||
|
|
||||||
[node name="CSGCylinder3D2" type="CSGCylinder3D" parent="CSGCombiner3DBuns" index="0" unique_id=110174152]
|
[node name="CSGCylinder3D2" type="CSGCylinder3D" parent="Model/CSGCombiner3DBuns" index="0" unique_id=110174152]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.004122257, 0)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.004122257, 0)
|
||||||
radius = 0.085
|
radius = 0.085
|
||||||
height = 0.04
|
height = 0.04
|
||||||
sides = 16
|
sides = 16
|
||||||
material = SubResource("StandardMaterial3D_hoqox")
|
material = SubResource("StandardMaterial3D_hoqox")
|
||||||
|
|
||||||
[node name="CSGCylinder3D3" type="CSGCylinder3D" parent="CSGCombiner3DBuns" index="1" unique_id=2003491826]
|
[node name="CSGCylinder3D3" type="CSGCylinder3D" parent="Model/CSGCombiner3DBuns" index="1" unique_id=2003491826]
|
||||||
transform = Transform3D(0.82770383, -0.5611652, 0, 0.5611652, 0.82770383, 0, 0, 0, 1, -0.048392475, 0.029736161, 0)
|
transform = Transform3D(0.82770383, -0.5611652, 0, 0.5611652, 0.82770383, 0, 0, 0, 1, -0.048392475, 0.029736161, 0)
|
||||||
radius = 0.085
|
radius = 0.085
|
||||||
height = 0.04
|
height = 0.04
|
||||||
sides = 16
|
sides = 16
|
||||||
material = SubResource("StandardMaterial3D_hoqox")
|
material = SubResource("StandardMaterial3D_hoqox")
|
||||||
|
|
||||||
[node name="CSGCylinder3D4" type="CSGCylinder3D" parent="CSGCombiner3DBuns/CSGCylinder3D3" index="0" unique_id=391028348]
|
[node name="CSGCylinder3D4" type="CSGCylinder3D" parent="Model/CSGCombiner3DBuns/CSGCylinder3D3" index="0" unique_id=391028348]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 5.9604645e-08, 0.040259957, 0)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 5.9604645e-08, 0.040259957, 0)
|
||||||
radius = 0.085
|
radius = 0.085
|
||||||
height = 0.04
|
height = 0.04
|
||||||
sides = 16
|
sides = 16
|
||||||
cone = true
|
cone = true
|
||||||
material = SubResource("StandardMaterial3D_hoqox")
|
material = SubResource("StandardMaterial3D_hoqox")
|
||||||
|
|
||||||
[node name="FoodItem" parent="." index="4" unique_id=123456789 instance=ExtResource("8_t9y3x")]
|
|
||||||
id = "burger_buns"
|
|
||||||
type = 2
|
|
||||||
|
|
||||||
[node name="CombinableItem" parent="." index="5" unique_id=996936271 instance=ExtResource("7_wb51u")]
|
|
||||||
|
|
||||||
[node name="NetPickable" type="MultiplayerSynchronizer" parent="." index="6" unique_id=2086885420]
|
|
||||||
replication_config = SubResource("SceneReplicationConfig_np_buns")
|
|
||||||
script = ExtResource("20_netpk")
|
|
||||||
|
|
||||||
[node name="DespawningItem" parent="." index="7" unique_id=303090111 instance=ExtResource("10_46e7r")]
|
|
||||||
|
|||||||
+7
-52
@@ -1,15 +1,6 @@
|
|||||||
[gd_scene format=3 uid="uid://cucc3gaqu2nab"]
|
[gd_scene format=3 uid="uid://cucc3gaqu2nab"]
|
||||||
|
|
||||||
[ext_resource type="PackedScene" uid="uid://c8l60rnugru40" path="res://addons/godot-xr-tools/objects/pickable.tscn" id="1_r73y2"]
|
[ext_resource type="PackedScene" uid="uid://d8jo0402pgl6" path="res://abstract/food_item.tscn" id="1_food_item"]
|
||||||
[ext_resource type="PackedScene" uid="uid://c25yxb0vt53vc" path="res://addons/godot-xr-tools/objects/grab_points/grab_point_hand_left.tscn" id="2_nfmuy"]
|
|
||||||
[ext_resource type="Animation" uid="uid://db62hs5s4n2b3" path="res://addons/godot-xr-tools/hands/animations/left/Grip 4.res" id="3_bsb6f"]
|
|
||||||
[ext_resource type="Script" uid="uid://dvobm6vcfnqe8" path="res://addons/godot-xr-tools/hands/poses/hand_pose_settings.gd" id="4_mgacb"]
|
|
||||||
[ext_resource type="PackedScene" uid="uid://ctw7nbntd5pcj" path="res://addons/godot-xr-tools/objects/grab_points/grab_point_hand_right.tscn" id="5_vw7i6"]
|
|
||||||
[ext_resource type="Animation" uid="uid://d1xnpyc08njjx" path="res://addons/godot-xr-tools/hands/animations/right/Grip 4.res" id="6_cp3eg"]
|
|
||||||
[ext_resource type="PackedScene" uid="uid://bfj80jh13t6e5" path="res://prefabs/food_item.tscn" id="7_mde49"]
|
|
||||||
[ext_resource type="PackedScene" uid="uid://3lr2dhy62rhk" path="res://prefabs/combinable_item.tscn" id="8_wmrff"]
|
|
||||||
[ext_resource type="PackedScene" uid="uid://b5ukku8i0hilb" path="res://prefabs/despawning_item.tscn" id="10_6ypk4"]
|
|
||||||
[ext_resource type="Script" uid="uid://bwd0pe2udb5xo" path="res://Net/net_pickable.gd" id="20_netpk"]
|
|
||||||
|
|
||||||
[sub_resource type="CylinderShape3D" id="CylinderShape3D_gkni8"]
|
[sub_resource type="CylinderShape3D" id="CylinderShape3D_gkni8"]
|
||||||
height = 0.1
|
height = 0.1
|
||||||
@@ -24,52 +15,16 @@ top_radius = 0.1
|
|||||||
bottom_radius = 0.1
|
bottom_radius = 0.1
|
||||||
height = 0.1
|
height = 0.1
|
||||||
|
|
||||||
[sub_resource type="Resource" id="Resource_lc22d"]
|
[node name="PickableObject" unique_id=1675596942 instance=ExtResource("1_food_item")]
|
||||||
script = ExtResource("4_mgacb")
|
|
||||||
closed_pose = ExtResource("3_bsb6f")
|
|
||||||
metadata/_custom_type_script = "uid://dvobm6vcfnqe8"
|
|
||||||
|
|
||||||
[sub_resource type="Resource" id="Resource_qyiot"]
|
|
||||||
script = ExtResource("4_mgacb")
|
|
||||||
closed_pose = ExtResource("6_cp3eg")
|
|
||||||
metadata/_custom_type_script = "uid://dvobm6vcfnqe8"
|
|
||||||
|
|
||||||
[sub_resource type="SceneReplicationConfig" id="SceneReplicationConfig_np_charcoal"]
|
|
||||||
properties/0/path = NodePath(".:position")
|
|
||||||
properties/0/spawn = false
|
|
||||||
properties/0/replication_mode = 1
|
|
||||||
properties/1/path = NodePath(".:quaternion")
|
|
||||||
properties/1/spawn = false
|
|
||||||
properties/1/replication_mode = 1
|
|
||||||
properties/2/path = NodePath("NetPickable:net_held_by")
|
|
||||||
properties/2/spawn = true
|
|
||||||
properties/2/replication_mode = 1
|
|
||||||
|
|
||||||
[node name="PickableObject" unique_id=1675596942 instance=ExtResource("1_r73y2")]
|
|
||||||
second_hand_grab = 1
|
|
||||||
|
|
||||||
[node name="CollisionShape3D" parent="." index="0"]
|
[node name="CollisionShape3D" parent="." index="0"]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0)
|
||||||
shape = SubResource("CylinderShape3D_gkni8")
|
shape = SubResource("CylinderShape3D_gkni8")
|
||||||
|
|
||||||
[node name="MeshInstance3D" type="MeshInstance3D" parent="." index="1" unique_id=1223689787]
|
[node name="FoodItem" parent="." index="3"]
|
||||||
mesh = SubResource("CylinderMesh_vebgy")
|
|
||||||
|
|
||||||
[node name="GrabPointHandLeft" parent="." index="2" unique_id=1571481674 instance=ExtResource("2_nfmuy")]
|
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.067650706, 0.04601878, -0.08606844)
|
|
||||||
hand_pose = SubResource("Resource_lc22d")
|
|
||||||
|
|
||||||
[node name="GrabPointHandRight" parent="." index="3" unique_id=514404634 instance=ExtResource("5_vw7i6")]
|
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.06531982, 0.042291984, -0.08604182)
|
|
||||||
hand_pose = SubResource("Resource_qyiot")
|
|
||||||
|
|
||||||
[node name="FoodItem" parent="." index="4" unique_id=345678912 instance=ExtResource("7_mde49")]
|
|
||||||
id = "charcoal"
|
id = "charcoal"
|
||||||
type = 2
|
type = 2
|
||||||
|
sell_value = 1
|
||||||
|
|
||||||
[node name="CombinableItem" parent="." index="5" unique_id=996936271 instance=ExtResource("8_wmrff")]
|
[node name="MeshInstance3D" type="MeshInstance3D" parent="Model" index="0" unique_id=1223689787]
|
||||||
|
mesh = SubResource("CylinderMesh_vebgy")
|
||||||
[node name="NetPickable" type="MultiplayerSynchronizer" parent="." index="6" unique_id=1070495412]
|
|
||||||
replication_config = SubResource("SceneReplicationConfig_np_charcoal")
|
|
||||||
script = ExtResource("20_netpk")
|
|
||||||
|
|
||||||
[node name="DespawningItem" parent="." index="7" unique_id=303090111 instance=ExtResource("10_6ypk4")]
|
|
||||||
|
|||||||
+7
-52
@@ -1,15 +1,6 @@
|
|||||||
[gd_scene format=3 uid="uid://e4i6o5oriecx"]
|
[gd_scene format=3 uid="uid://e4i6o5oriecx"]
|
||||||
|
|
||||||
[ext_resource type="PackedScene" uid="uid://c8l60rnugru40" path="res://addons/godot-xr-tools/objects/pickable.tscn" id="1_dbtw8"]
|
[ext_resource type="PackedScene" uid="uid://d8jo0402pgl6" path="res://abstract/food_item.tscn" id="1_food_item"]
|
||||||
[ext_resource type="PackedScene" uid="uid://c25yxb0vt53vc" path="res://addons/godot-xr-tools/objects/grab_points/grab_point_hand_left.tscn" id="2_pxnkq"]
|
|
||||||
[ext_resource type="Animation" uid="uid://db62hs5s4n2b3" path="res://addons/godot-xr-tools/hands/animations/left/Grip 4.res" id="3_iqyul"]
|
|
||||||
[ext_resource type="Script" uid="uid://dvobm6vcfnqe8" path="res://addons/godot-xr-tools/hands/poses/hand_pose_settings.gd" id="4_hc3f7"]
|
|
||||||
[ext_resource type="PackedScene" uid="uid://ctw7nbntd5pcj" path="res://addons/godot-xr-tools/objects/grab_points/grab_point_hand_right.tscn" id="5_a0a5b"]
|
|
||||||
[ext_resource type="Animation" uid="uid://d1xnpyc08njjx" path="res://addons/godot-xr-tools/hands/animations/right/Grip 4.res" id="6_bdp75"]
|
|
||||||
[ext_resource type="PackedScene" uid="uid://3lr2dhy62rhk" path="res://prefabs/combinable_item.tscn" id="7_bdp75"]
|
|
||||||
[ext_resource type="PackedScene" uid="uid://b5ukku8i0hilb" path="res://prefabs/despawning_item.tscn" id="10_uygc5"]
|
|
||||||
[ext_resource type="PackedScene" uid="uid://bfj80jh13t6e5" path="res://prefabs/food_item.tscn" id="11_vjw41"]
|
|
||||||
[ext_resource type="Script" uid="uid://bwd0pe2udb5xo" path="res://Net/net_pickable.gd" id="20_netpk"]
|
|
||||||
|
|
||||||
[sub_resource type="BoxShape3D" id="BoxShape3D_m1xbq"]
|
[sub_resource type="BoxShape3D" id="BoxShape3D_m1xbq"]
|
||||||
size = Vector3(0.1, 0.1, 0.1)
|
size = Vector3(0.1, 0.1, 0.1)
|
||||||
@@ -21,52 +12,16 @@ albedo_color = Color(0.1764706, 1, 1, 1)
|
|||||||
material = SubResource("StandardMaterial3D_24d3s")
|
material = SubResource("StandardMaterial3D_24d3s")
|
||||||
size = Vector3(0.1, 0.1, 0.1)
|
size = Vector3(0.1, 0.1, 0.1)
|
||||||
|
|
||||||
[sub_resource type="Resource" id="Resource_lc22d"]
|
[node name="PickableObject" unique_id=1675596942 groups=["platalbe_item"] instance=ExtResource("1_food_item")]
|
||||||
script = ExtResource("4_hc3f7")
|
|
||||||
closed_pose = ExtResource("3_iqyul")
|
|
||||||
metadata/_custom_type_script = "uid://dvobm6vcfnqe8"
|
|
||||||
|
|
||||||
[sub_resource type="Resource" id="Resource_qyiot"]
|
|
||||||
script = ExtResource("4_hc3f7")
|
|
||||||
closed_pose = ExtResource("6_bdp75")
|
|
||||||
metadata/_custom_type_script = "uid://dvobm6vcfnqe8"
|
|
||||||
|
|
||||||
[sub_resource type="SceneReplicationConfig" id="SceneReplicationConfig_np_cube"]
|
|
||||||
properties/0/path = NodePath(".:position")
|
|
||||||
properties/0/spawn = false
|
|
||||||
properties/0/replication_mode = 1
|
|
||||||
properties/1/path = NodePath(".:quaternion")
|
|
||||||
properties/1/spawn = false
|
|
||||||
properties/1/replication_mode = 1
|
|
||||||
properties/2/path = NodePath("NetPickable:net_held_by")
|
|
||||||
properties/2/spawn = true
|
|
||||||
properties/2/replication_mode = 1
|
|
||||||
|
|
||||||
[node name="PickableObject" unique_id=1675596942 groups=["platalbe_item"] instance=ExtResource("1_dbtw8")]
|
|
||||||
second_hand_grab = 1
|
|
||||||
|
|
||||||
[node name="CollisionShape3D" parent="." index="0"]
|
[node name="CollisionShape3D" parent="." index="0"]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0)
|
||||||
shape = SubResource("BoxShape3D_m1xbq")
|
shape = SubResource("BoxShape3D_m1xbq")
|
||||||
|
|
||||||
[node name="MeshInstance3D" type="MeshInstance3D" parent="." index="1" unique_id=1223689787]
|
[node name="FoodItem" parent="." index="3"]
|
||||||
mesh = SubResource("BoxMesh_vlqg6")
|
|
||||||
|
|
||||||
[node name="GrabPointHandLeft" parent="." index="2" unique_id=1571481674 instance=ExtResource("2_pxnkq")]
|
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.067650706, 0.04601878, -0.08606844)
|
|
||||||
hand_pose = SubResource("Resource_lc22d")
|
|
||||||
|
|
||||||
[node name="GrabPointHandRight" parent="." index="3" unique_id=514404634 instance=ExtResource("5_a0a5b")]
|
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.06531982, 0.042291984, -0.08604182)
|
|
||||||
hand_pose = SubResource("Resource_qyiot")
|
|
||||||
|
|
||||||
[node name="FoodItem" parent="." index="4" unique_id=63948206 instance=ExtResource("11_vjw41")]
|
|
||||||
id = "cube"
|
id = "cube"
|
||||||
type = 1
|
type = 1
|
||||||
|
sell_value = 1
|
||||||
|
|
||||||
[node name="CombinableItem" parent="." index="5" unique_id=996936271 instance=ExtResource("7_bdp75")]
|
[node name="MeshInstance3D" type="MeshInstance3D" parent="Model" index="0" unique_id=1223689787]
|
||||||
|
mesh = SubResource("BoxMesh_vlqg6")
|
||||||
[node name="NetPickable" type="MultiplayerSynchronizer" parent="." index="6" unique_id=1858332513]
|
|
||||||
replication_config = SubResource("SceneReplicationConfig_np_cube")
|
|
||||||
script = ExtResource("20_netpk")
|
|
||||||
|
|
||||||
[node name="DespawningItem" parent="." index="7" unique_id=303090111 instance=ExtResource("10_uygc5")]
|
|
||||||
|
|||||||
+12
-52
@@ -1,15 +1,7 @@
|
|||||||
[gd_scene format=3 uid="uid://dpot5qie20vf6"]
|
[gd_scene format=3 uid="uid://dpot5qie20vf6"]
|
||||||
|
|
||||||
[ext_resource type="PackedScene" uid="uid://c8l60rnugru40" path="res://addons/godot-xr-tools/objects/pickable.tscn" id="1_fco8w"]
|
[ext_resource type="PackedScene" uid="uid://d8jo0402pgl6" path="res://abstract/food_item.tscn" id="1_food_item"]
|
||||||
[ext_resource type="Texture2D" uid="uid://cexxfyw03hr81" path="res://textures/1.png" id="2_r8jvx"]
|
[ext_resource type="Texture2D" uid="uid://7jt8macx4f5m" path="res://textures/1.png" id="2_r8jvx"]
|
||||||
[ext_resource type="PackedScene" uid="uid://c25yxb0vt53vc" path="res://addons/godot-xr-tools/objects/grab_points/grab_point_hand_left.tscn" id="3_qixic"]
|
|
||||||
[ext_resource type="Animation" uid="uid://db62hs5s4n2b3" path="res://addons/godot-xr-tools/hands/animations/left/Grip 4.res" id="4_bw8vh"]
|
|
||||||
[ext_resource type="Script" uid="uid://dvobm6vcfnqe8" path="res://addons/godot-xr-tools/hands/poses/hand_pose_settings.gd" id="5_w8sii"]
|
|
||||||
[ext_resource type="PackedScene" uid="uid://ctw7nbntd5pcj" path="res://addons/godot-xr-tools/objects/grab_points/grab_point_hand_right.tscn" id="6_mvnl5"]
|
|
||||||
[ext_resource type="Animation" uid="uid://d1xnpyc08njjx" path="res://addons/godot-xr-tools/hands/animations/right/Grip 4.res" id="7_wqxjj"]
|
|
||||||
[ext_resource type="PackedScene" uid="uid://b5ukku8i0hilb" path="res://prefabs/despawning_item.tscn" id="10_l4hsd"]
|
|
||||||
[ext_resource type="PackedScene" uid="uid://bfj80jh13t6e5" path="res://prefabs/food_item.tscn" id="10_yxtxs"]
|
|
||||||
[ext_resource type="Script" uid="uid://bwd0pe2udb5xo" path="res://Net/net_pickable.gd" id="20_netpk"]
|
|
||||||
|
|
||||||
[sub_resource type="CylinderShape3D" id="CylinderShape3D_fco8w"]
|
[sub_resource type="CylinderShape3D" id="CylinderShape3D_fco8w"]
|
||||||
height = 0.0338974
|
height = 0.0338974
|
||||||
@@ -18,54 +10,22 @@ radius = 0.08544922
|
|||||||
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_bvwq1"]
|
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_bvwq1"]
|
||||||
albedo_texture = ExtResource("2_r8jvx")
|
albedo_texture = ExtResource("2_r8jvx")
|
||||||
|
|
||||||
[sub_resource type="Resource" id="Resource_lc22d"]
|
[node name="raw_burger" unique_id=1675596942 instance=ExtResource("1_food_item")]
|
||||||
script = ExtResource("5_w8sii")
|
|
||||||
closed_pose = ExtResource("4_bw8vh")
|
|
||||||
metadata/_custom_type_script = "uid://dvobm6vcfnqe8"
|
|
||||||
|
|
||||||
[sub_resource type="Resource" id="Resource_qyiot"]
|
|
||||||
script = ExtResource("5_w8sii")
|
|
||||||
closed_pose = ExtResource("7_wqxjj")
|
|
||||||
metadata/_custom_type_script = "uid://dvobm6vcfnqe8"
|
|
||||||
|
|
||||||
[sub_resource type="SceneReplicationConfig" id="SceneReplicationConfig_np_burger"]
|
|
||||||
properties/0/path = NodePath(".:position")
|
|
||||||
properties/0/spawn = false
|
|
||||||
properties/0/replication_mode = 1
|
|
||||||
properties/1/path = NodePath(".:quaternion")
|
|
||||||
properties/1/spawn = false
|
|
||||||
properties/1/replication_mode = 1
|
|
||||||
properties/2/path = NodePath("NetPickable:net_held_by")
|
|
||||||
properties/2/spawn = true
|
|
||||||
properties/2/replication_mode = 1
|
|
||||||
|
|
||||||
[node name="raw_burger" unique_id=1675596942 instance=ExtResource("1_fco8w")]
|
|
||||||
second_hand_grab = 1
|
|
||||||
|
|
||||||
[node name="CollisionShape3D" parent="." index="0"]
|
[node name="CollisionShape3D" parent="." index="0"]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.00077831745, 0)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.00077831745, 0)
|
||||||
shape = SubResource("CylinderShape3D_fco8w")
|
shape = SubResource("CylinderShape3D_fco8w")
|
||||||
|
|
||||||
[node name="CSGCylinder3D" type="CSGCylinder3D" parent="." index="1" unique_id=59319982]
|
[node name="FoodItem" parent="." index="3" unique_id=63948206]
|
||||||
|
id = "raw_burger"
|
||||||
|
type = 2
|
||||||
|
sell_value = 1
|
||||||
|
|
||||||
|
[node name="CombinableItem" parent="." index="8"]
|
||||||
|
enabled = false
|
||||||
|
|
||||||
|
[node name="CSGCylinder3D" type="CSGCylinder3D" parent="Model" parent_id_path=PackedInt32Array(1015960306) index="0" unique_id=59319982]
|
||||||
radius = 0.08300781
|
radius = 0.08300781
|
||||||
height = 0.03
|
height = 0.03
|
||||||
sides = 16
|
sides = 16
|
||||||
material = SubResource("StandardMaterial3D_bvwq1")
|
material = SubResource("StandardMaterial3D_bvwq1")
|
||||||
|
|
||||||
[node name="GrabPointHandLeft" parent="." index="2" unique_id=1571481674 instance=ExtResource("3_qixic")]
|
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.067650706, 0.04601878, -0.08606844)
|
|
||||||
hand_pose = SubResource("Resource_lc22d")
|
|
||||||
|
|
||||||
[node name="GrabPointHandRight" parent="." index="3" unique_id=514404634 instance=ExtResource("6_mvnl5")]
|
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.06531982, 0.042291984, -0.08604182)
|
|
||||||
hand_pose = SubResource("Resource_qyiot")
|
|
||||||
|
|
||||||
[node name="FoodItem" parent="." index="4" unique_id=63948206 instance=ExtResource("10_yxtxs")]
|
|
||||||
id = "raw_burger"
|
|
||||||
type = 2
|
|
||||||
|
|
||||||
[node name="NetPickable" type="MultiplayerSynchronizer" parent="." index="5" unique_id=1382968688]
|
|
||||||
replication_config = SubResource("SceneReplicationConfig_np_burger")
|
|
||||||
script = ExtResource("20_netpk")
|
|
||||||
|
|
||||||
[node name="DespawningItem" parent="." index="6" unique_id=303090111 instance=ExtResource("10_l4hsd")]
|
|
||||||
|
|||||||
+44
-84
@@ -1,254 +1,214 @@
|
|||||||
[gd_scene format=3 uid="uid://duwrbvwcqcuk3"]
|
[gd_scene format=3 uid="uid://duwrbvwcqcuk3"]
|
||||||
|
|
||||||
[ext_resource type="PackedScene" uid="uid://c25yxb0vt53vc" path="res://addons/godot-xr-tools/objects/grab_points/grab_point_hand_left.tscn" id="1_g660j"]
|
[ext_resource type="PackedScene" uid="uid://d8jo0402pgl6" path="res://abstract/food_item.tscn" id="1_food_item"]
|
||||||
[ext_resource type="Script" uid="uid://bfrlpbsqg5lqr" path="res://addons/godot-xr-tools/objects/pickable.gd" id="1_skw8o"]
|
|
||||||
[ext_resource type="Animation" uid="uid://db62hs5s4n2b3" path="res://addons/godot-xr-tools/hands/animations/left/Grip 4.res" id="2_skw8o"]
|
|
||||||
[ext_resource type="Script" uid="uid://dvobm6vcfnqe8" path="res://addons/godot-xr-tools/hands/poses/hand_pose_settings.gd" id="3_j0320"]
|
|
||||||
[ext_resource type="PackedScene" uid="uid://ctw7nbntd5pcj" path="res://addons/godot-xr-tools/objects/grab_points/grab_point_hand_right.tscn" id="4_krlan"]
|
|
||||||
[ext_resource type="Animation" uid="uid://d1xnpyc08njjx" path="res://addons/godot-xr-tools/hands/animations/right/Grip 4.res" id="5_ygjl7"]
|
|
||||||
[ext_resource type="PackedScene" uid="uid://bfj80jh13t6e5" path="res://prefabs/food_item.tscn" id="6_66ydo"]
|
|
||||||
[ext_resource type="PackedScene" uid="uid://3lr2dhy62rhk" path="res://prefabs/combinable_item.tscn" id="7_qlknf"]
|
|
||||||
[ext_resource type="Script" uid="uid://bwd0pe2udb5xo" path="res://Net/net_pickable.gd" id="8_do54s"]
|
|
||||||
[ext_resource type="PackedScene" uid="uid://b5ukku8i0hilb" path="res://prefabs/despawning_item.tscn" id="9_obvwg"]
|
|
||||||
|
|
||||||
[sub_resource type="BoxShape3D" id="BoxShape3D_m1xbq"]
|
[sub_resource type="BoxShape3D" id="BoxShape3D_m1xbq"]
|
||||||
size = Vector3(0.1, 0.1, 0.1)
|
size = Vector3(0.1, 0.1, 0.1)
|
||||||
|
|
||||||
[sub_resource type="Resource" id="Resource_lc22d"]
|
|
||||||
script = ExtResource("3_j0320")
|
|
||||||
closed_pose = ExtResource("2_skw8o")
|
|
||||||
metadata/_custom_type_script = "uid://dvobm6vcfnqe8"
|
|
||||||
|
|
||||||
[sub_resource type="Resource" id="Resource_qyiot"]
|
|
||||||
script = ExtResource("3_j0320")
|
|
||||||
closed_pose = ExtResource("5_ygjl7")
|
|
||||||
metadata/_custom_type_script = "uid://dvobm6vcfnqe8"
|
|
||||||
|
|
||||||
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_vlqg6"]
|
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_vlqg6"]
|
||||||
albedo_color = Color(1, 0.26, 0.26, 1)
|
albedo_color = Color(1, 0.26, 0.26, 1)
|
||||||
|
|
||||||
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_24d3s"]
|
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_24d3s"]
|
||||||
albedo_color = Color(0.66, 0.58300006, 0.19800001, 1)
|
albedo_color = Color(0.66, 0.58300006, 0.19800001, 1)
|
||||||
|
|
||||||
[sub_resource type="SceneReplicationConfig" id="SceneReplicationConfig_np_cube"]
|
[node name="Chips" unique_id=1675596942 groups=["platalbe_item"] instance=ExtResource("1_food_item")]
|
||||||
properties/0/path = NodePath(".:position")
|
|
||||||
properties/0/spawn = false
|
|
||||||
properties/0/replication_mode = 1
|
|
||||||
properties/1/path = NodePath(".:quaternion")
|
|
||||||
properties/1/spawn = false
|
|
||||||
properties/1/replication_mode = 1
|
|
||||||
properties/2/path = NodePath("NetPickable:net_held_by")
|
|
||||||
properties/2/spawn = true
|
|
||||||
properties/2/replication_mode = 1
|
|
||||||
|
|
||||||
[node name="Chips" type="RigidBody3D" unique_id=1028364693 groups=["platalbe_item"]]
|
|
||||||
collision_layer = 4
|
collision_layer = 4
|
||||||
collision_mask = 196615
|
collision_mask = 196615
|
||||||
freeze_mode = 1
|
freeze_mode = 1
|
||||||
script = ExtResource("1_skw8o")
|
|
||||||
second_hand_grab = 1
|
|
||||||
|
|
||||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="." unique_id=1621665718]
|
[node name="CollisionShape3D" parent="." index="0"]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0)
|
||||||
shape = SubResource("BoxShape3D_m1xbq")
|
shape = SubResource("BoxShape3D_m1xbq")
|
||||||
|
|
||||||
[node name="GrabPointHandLeft" parent="." unique_id=389569681 instance=ExtResource("1_g660j")]
|
[node name="GrabPointHandLeft" parent="." index="1"]
|
||||||
transform = Transform3D(0.99971306, 0.023955148, 0, -0.023955148, 0.99971306, 0, 0, 0, 1, -0.042430807, 0.04601878, -0.066400535)
|
transform = Transform3D(0.99971306, 0.023955148, 0, -0.023955148, 0.99971306, 0, 0, 0, 1, -0.042430807, 0.04601878, -0.066400535)
|
||||||
hand_pose = SubResource("Resource_lc22d")
|
|
||||||
|
|
||||||
[node name="GrabPointHandRight" parent="." unique_id=332233083 instance=ExtResource("4_krlan")]
|
[node name="GrabPointHandRight" parent="." index="2"]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.039321173, 0.042291984, -0.06561862)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.039321173, 0.042291984, -0.06561862)
|
||||||
hand_pose = SubResource("Resource_qyiot")
|
|
||||||
|
|
||||||
[node name="CSGCombiner3D" type="CSGCombiner3D" parent="." unique_id=965503334]
|
[node name="CSGCombiner3D" type="CSGCombiner3D" parent="Model" unique_id=965503334]
|
||||||
|
|
||||||
[node name="CSGCylinder3D" type="CSGCylinder3D" parent="CSGCombiner3D" unique_id=816650852]
|
[node name="CSGCylinder3D" type="CSGCylinder3D" parent="Model/CSGCombiner3D" unique_id=816650852]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 0.7, 0, -0.008749997, 0)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 0.7, 0, -0.008749997, 0)
|
||||||
radius = 0.055
|
radius = 0.055
|
||||||
height = 0.10250001
|
height = 0.10250001
|
||||||
sides = 32
|
sides = 32
|
||||||
material = SubResource("StandardMaterial3D_vlqg6")
|
material = SubResource("StandardMaterial3D_vlqg6")
|
||||||
|
|
||||||
[node name="CSGCylinder3D2" type="CSGCylinder3D" parent="CSGCombiner3D/CSGCylinder3D" unique_id=387203621]
|
[node name="CSGCylinder3D2" type="CSGCylinder3D" parent="Model/CSGCombiner3D/CSGCylinder3D" unique_id=387203621]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.00010003522, 0.004754007, -0.0005688625)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.00010003522, 0.004754007, -0.0005688625)
|
||||||
operation = 2
|
operation = 2
|
||||||
radius = 0.05
|
radius = 0.05
|
||||||
height = 0.0934961
|
height = 0.0934961
|
||||||
sides = 32
|
sides = 32
|
||||||
|
|
||||||
[node name="CSGBox3D" type="CSGBox3D" parent="CSGCombiner3D" unique_id=93328108]
|
[node name="CSGBox3D" type="CSGBox3D" parent="Model/CSGCombiner3D" unique_id=93328108]
|
||||||
transform = Transform3D(0.7620723, -0.15403531, 0.62890285, 0.14065021, 0.98747945, 0.07142768, -0.632031, 0.034022264, 0.77419585, 0, 0.023602298, 0)
|
transform = Transform3D(0.7620723, -0.15403531, 0.62890285, 0.14065021, 0.98747945, 0.07142768, -0.632031, 0.034022264, 0.77419585, 0, 0.023602298, 0)
|
||||||
size = Vector3(0.01, 0.1472046, 0.01)
|
size = Vector3(0.01, 0.1472046, 0.01)
|
||||||
material = SubResource("StandardMaterial3D_24d3s")
|
material = SubResource("StandardMaterial3D_24d3s")
|
||||||
|
|
||||||
[node name="CSGBox3D2" type="CSGBox3D" parent="CSGCombiner3D" unique_id=916963062]
|
[node name="CSGBox3D2" type="CSGBox3D" parent="Model/CSGCombiner3D" unique_id=916963062]
|
||||||
transform = Transform3D(0.8856182, 0, -0.46441403, 0, 1, 0, 0.46441403, 0, 0.8856182, -0.025303185, 0.017004399, -0.011429907)
|
transform = Transform3D(0.8856182, 0, -0.46441403, 0, 1, 0, 0.46441403, 0, 0.8856182, -0.025303185, 0.017004399, -0.011429907)
|
||||||
size = Vector3(0.01, 0.1340088, 0.012324219)
|
size = Vector3(0.01, 0.1340088, 0.012324219)
|
||||||
material = SubResource("StandardMaterial3D_24d3s")
|
material = SubResource("StandardMaterial3D_24d3s")
|
||||||
|
|
||||||
[node name="CSGBox3D3" type="CSGBox3D" parent="CSGCombiner3D" unique_id=2028227382]
|
[node name="CSGBox3D3" type="CSGBox3D" parent="Model/CSGCombiner3D" unique_id=2028227382]
|
||||||
transform = Transform3D(0.9982952, 0.058366816, 0, -0.058366816, 0.9982952, 0, 0, 0, 1, 0.01182463, 0.014508067, -0.020026028)
|
transform = Transform3D(0.9982952, 0.058366816, 0, -0.058366816, 0.9982952, 0, 0, 0, 1, 0.01182463, 0.014508067, -0.020026028)
|
||||||
size = Vector3(0.005488281, 0.12901612, 0.01)
|
size = Vector3(0.005488281, 0.12901612, 0.01)
|
||||||
material = SubResource("StandardMaterial3D_24d3s")
|
material = SubResource("StandardMaterial3D_24d3s")
|
||||||
|
|
||||||
[node name="CSGBox3D4" type="CSGBox3D" parent="CSGCombiner3D" unique_id=281966004]
|
[node name="CSGBox3D4" type="CSGBox3D" parent="Model/CSGCombiner3D" unique_id=281966004]
|
||||||
transform = Transform3D(0.7529522, 0.17319141, -0.63487613, -0.17018878, 0.98317415, 0.06636462, 0.6356876, 0.058079403, 0.7697584, 0.030878175, 0.017004376, 0.0073254704)
|
transform = Transform3D(0.7529522, 0.17319141, -0.63487613, -0.17018878, 0.98317415, 0.06636462, 0.6356876, 0.058079403, 0.7697584, 0.030878175, 0.017004376, 0.0073254704)
|
||||||
size = Vector3(0.01, 0.1340088, 0.01)
|
size = Vector3(0.01, 0.1340088, 0.01)
|
||||||
material = SubResource("StandardMaterial3D_24d3s")
|
material = SubResource("StandardMaterial3D_24d3s")
|
||||||
|
|
||||||
[node name="CSGBox3D5" type="CSGBox3D" parent="CSGCombiner3D" unique_id=1396476812]
|
[node name="CSGBox3D5" type="CSGBox3D" parent="Model/CSGCombiner3D" unique_id=1396476812]
|
||||||
transform = Transform3D(0.9059609, 0.09732082, -0.4120236, 0.057229556, 0.93613446, 0.3469537, 0.41947538, -0.33790648, 0.8425318, 0.022142533, 0.013039222, 0.0003975192)
|
transform = Transform3D(0.9059609, 0.09732082, -0.4120236, 0.057229556, 0.93613446, 0.3469537, 0.41947538, -0.33790648, 0.8425318, 0.022142533, 0.013039222, 0.0003975192)
|
||||||
size = Vector3(0.01, 0.1340088, 0.01)
|
size = Vector3(0.01, 0.1340088, 0.01)
|
||||||
material = SubResource("StandardMaterial3D_24d3s")
|
material = SubResource("StandardMaterial3D_24d3s")
|
||||||
|
|
||||||
[node name="CSGBox3D6" type="CSGBox3D" parent="CSGCombiner3D" unique_id=799991689]
|
[node name="CSGBox3D6" type="CSGBox3D" parent="Model/CSGCombiner3D" unique_id=799991689]
|
||||||
transform = Transform3D(0.84679973, -0.153204, -0.5093709, 0.13128299, 0.9881946, -0.07896996, 0.5154561, 0, 0.856916, -0.035753187, 0.02232056, 0.006355174)
|
transform = Transform3D(0.84679973, -0.153204, -0.5093709, 0.13128299, 0.9881946, -0.07896996, 0.5154561, 0, 0.856916, -0.035753187, 0.02232056, 0.006355174)
|
||||||
size = Vector3(0.010739746, 0.14464112, 0.01)
|
size = Vector3(0.010739746, 0.14464112, 0.01)
|
||||||
material = SubResource("StandardMaterial3D_24d3s")
|
material = SubResource("StandardMaterial3D_24d3s")
|
||||||
|
|
||||||
[node name="CSGBox3D7" type="CSGBox3D" parent="CSGCombiner3D" unique_id=1801209773]
|
[node name="CSGBox3D7" type="CSGBox3D" parent="Model/CSGCombiner3D" unique_id=1801209773]
|
||||||
transform = Transform3D(0.97630554, 0.034820024, 0.21357699, 0, 0.98696935, -0.16090819, -0.21639681, 0.15709558, 0.96358365, 0.013860466, 0.019146731, 0.016792327)
|
transform = Transform3D(0.97630554, 0.034820024, 0.21357699, 0, 0.98696935, -0.16090819, -0.21639681, 0.15709558, 0.96358365, 0.013860466, 0.019146731, 0.016792327)
|
||||||
size = Vector3(0.01, 0.13829346, 0.01)
|
size = Vector3(0.01, 0.13829346, 0.01)
|
||||||
material = SubResource("StandardMaterial3D_24d3s")
|
material = SubResource("StandardMaterial3D_24d3s")
|
||||||
|
|
||||||
[node name="CSGBox3D8" type="CSGBox3D" parent="CSGCombiner3D" unique_id=1457970557]
|
[node name="CSGBox3D8" type="CSGBox3D" parent="Model/CSGCombiner3D" unique_id=1457970557]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.014735691, 0.014813228, 0.009678945)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.014735691, 0.014813228, 0.009678945)
|
||||||
size = Vector3(0.01, 0.12962647, 0.01)
|
size = Vector3(0.01, 0.12962647, 0.01)
|
||||||
material = SubResource("StandardMaterial3D_24d3s")
|
material = SubResource("StandardMaterial3D_24d3s")
|
||||||
|
|
||||||
[node name="CSGBox3D9" type="CSGBox3D" parent="CSGCombiner3D" unique_id=1215031746]
|
[node name="CSGBox3D9" type="CSGBox3D" parent="Model/CSGCombiner3D" unique_id=1215031746]
|
||||||
transform = Transform3D(0.98743933, -0.15799865, 0, 0.15799865, 0.98743933, 0, 0, 0, 1, -0.00090237334, 0.017004391, -0.023620732)
|
transform = Transform3D(0.98743933, -0.15799865, 0, 0.15799865, 0.98743933, 0, 0, 0, 1, -0.00090237334, 0.017004391, -0.023620732)
|
||||||
size = Vector3(0.01, 0.1340088, 0.01)
|
size = Vector3(0.01, 0.1340088, 0.01)
|
||||||
material = SubResource("StandardMaterial3D_24d3s")
|
material = SubResource("StandardMaterial3D_24d3s")
|
||||||
|
|
||||||
[node name="CSGBox3D10" type="CSGBox3D" parent="CSGCombiner3D" unique_id=532075410]
|
[node name="CSGBox3D10" type="CSGBox3D" parent="Model/CSGCombiner3D" unique_id=532075410]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.021327257, 0.013287356, 0.022823062)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.021327257, 0.013287356, 0.022823062)
|
||||||
size = Vector3(0.010739746, 0.12657471, 0.01)
|
size = Vector3(0.010739746, 0.12657471, 0.01)
|
||||||
material = SubResource("StandardMaterial3D_24d3s")
|
material = SubResource("StandardMaterial3D_24d3s")
|
||||||
|
|
||||||
[node name="CSGBox3D11" type="CSGBox3D" parent="CSGCombiner3D" unique_id=2073146495]
|
[node name="CSGBox3D11" type="CSGBox3D" parent="Model/CSGCombiner3D" unique_id=2073146495]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.03040018, 0.009017946, 0.020780522)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.03040018, 0.009017946, 0.020780522)
|
||||||
size = Vector3(0.01, 0.11803589, 0.01)
|
size = Vector3(0.01, 0.11803589, 0.01)
|
||||||
material = SubResource("StandardMaterial3D_24d3s")
|
material = SubResource("StandardMaterial3D_24d3s")
|
||||||
|
|
||||||
[node name="CSGBox3D12" type="CSGBox3D" parent="CSGCombiner3D" unique_id=75858017]
|
[node name="CSGBox3D12" type="CSGBox3D" parent="Model/CSGCombiner3D" unique_id=75858017]
|
||||||
transform = Transform3D(0.97359693, 0, 0.22827391, 0.051342297, 0.9743782, -0.21897686, -0.22242515, 0.22491528, 0.9486517, -0.0036671162, 0.017004391, 0.02201752)
|
transform = Transform3D(0.97359693, 0, 0.22827391, 0.051342297, 0.9743782, -0.21897686, -0.22242515, 0.22491528, 0.9486517, -0.0036671162, 0.017004391, 0.02201752)
|
||||||
size = Vector3(0.01, 0.1340088, 0.01)
|
size = Vector3(0.01, 0.1340088, 0.01)
|
||||||
material = SubResource("StandardMaterial3D_24d3s")
|
material = SubResource("StandardMaterial3D_24d3s")
|
||||||
|
|
||||||
[node name="CSGBox3D13" type="CSGBox3D" parent="CSGCombiner3D" unique_id=632405164]
|
[node name="CSGBox3D13" type="CSGBox3D" parent="Model/CSGCombiner3D" unique_id=632405164]
|
||||||
transform = Transform3D(0.77419585, 0, 0.6329461, 0, 0.52134585, 0, -0.6329461, 0, 0.77419585, 0, -0.007927237, 0)
|
transform = Transform3D(0.77419585, 0, 0.6329461, 0, 0.52134585, 0, -0.6329461, 0, 0.77419585, 0, -0.007927237, 0)
|
||||||
size = Vector3(0.01, 0.1472046, 0.01)
|
size = Vector3(0.01, 0.1472046, 0.01)
|
||||||
material = SubResource("StandardMaterial3D_24d3s")
|
material = SubResource("StandardMaterial3D_24d3s")
|
||||||
|
|
||||||
[node name="CSGBox3D14" type="CSGBox3D" parent="CSGCombiner3D" unique_id=1656744815]
|
[node name="CSGBox3D14" type="CSGBox3D" parent="Model/CSGCombiner3D" unique_id=1656744815]
|
||||||
transform = Transform3D(-0.8283986, -0.2356963, 0.46195662, -0.27667236, 0.7057101, 0.1542864, -0.48704025, 0, -0.8733795, 0.021192847, -0.004947574, 0.01600693)
|
transform = Transform3D(-0.8283986, -0.2356963, 0.46195662, -0.27667236, 0.7057101, 0.1542864, -0.48704025, 0, -0.8733795, 0.021192847, -0.004947574, 0.01600693)
|
||||||
size = Vector3(0.01, 0.1340088, 0.01)
|
size = Vector3(0.01, 0.1340088, 0.01)
|
||||||
material = SubResource("StandardMaterial3D_24d3s")
|
material = SubResource("StandardMaterial3D_24d3s")
|
||||||
|
|
||||||
[node name="CSGBox3D15" type="CSGBox3D" parent="CSGCombiner3D" unique_id=1543269420]
|
[node name="CSGBox3D15" type="CSGBox3D" parent="Model/CSGCombiner3D" unique_id=1543269420]
|
||||||
transform = Transform3D(-0.91507524, 0.2995426, 0.023545321, 0.40246198, 0.68106806, -0.010355539, -0.025721962, -5.579416e-10, -0.99966913, -0.01809039, 0.0024462799, 0.0042534657)
|
transform = Transform3D(-0.91507524, 0.2995426, 0.023545321, 0.40246198, 0.68106806, -0.010355539, -0.025721962, -5.579416e-10, -0.99966913, -0.01809039, 0.0024462799, 0.0042534657)
|
||||||
size = Vector3(0.005488281, 0.15618286, 0.01)
|
size = Vector3(0.005488281, 0.15618286, 0.01)
|
||||||
material = SubResource("StandardMaterial3D_24d3s")
|
material = SubResource("StandardMaterial3D_24d3s")
|
||||||
|
|
||||||
[node name="CSGBox3D16" type="CSGBox3D" parent="CSGCombiner3D" unique_id=254315930]
|
[node name="CSGBox3D16" type="CSGBox3D" parent="Model/CSGCombiner3D" unique_id=254315930]
|
||||||
transform = Transform3D(-0.92201805, 0, 0.38714674, 0, 0.7440292, 0, -0.38714674, 0, -0.92201805, -0.03251951, -0.0049475897, 0.0013081154)
|
transform = Transform3D(-0.92201805, 0, 0.38714674, 0, 0.7440292, 0, -0.38714674, 0, -0.92201805, -0.03251951, -0.0049475897, 0.0013081154)
|
||||||
size = Vector3(0.01, 0.1340088, 0.01)
|
size = Vector3(0.01, 0.1340088, 0.01)
|
||||||
material = SubResource("StandardMaterial3D_24d3s")
|
material = SubResource("StandardMaterial3D_24d3s")
|
||||||
|
|
||||||
[node name="CSGBox3D17" type="CSGBox3D" parent="CSGCombiner3D" unique_id=1486469355]
|
[node name="CSGBox3D17" type="CSGBox3D" parent="Model/CSGCombiner3D" unique_id=1486469355]
|
||||||
transform = Transform3D(-0.99966913, 0, 0.025721963, 0, 0.7440292, 0, -0.025721963, 0, -0.99966913, -0.023322525, -0.0049475795, -0.00594615)
|
transform = Transform3D(-0.99966913, 0, 0.025721963, 0, 0.7440292, 0, -0.025721963, 0, -0.99966913, -0.023322525, -0.0049475795, -0.00594615)
|
||||||
size = Vector3(0.01, 0.1340088, 0.01)
|
size = Vector3(0.01, 0.1340088, 0.01)
|
||||||
material = SubResource("StandardMaterial3D_24d3s")
|
material = SubResource("StandardMaterial3D_24d3s")
|
||||||
|
|
||||||
[node name="CSGBox3D18" type="CSGBox3D" parent="CSGCombiner3D" unique_id=630552823]
|
[node name="CSGBox3D18" type="CSGBox3D" parent="Model/CSGCombiner3D" unique_id=630552823]
|
||||||
transform = Transform3D(-0.83532625, 0.10253985, 0.5321998, 0.116231225, 0.7369294, -0.07405278, -0.5373271, 0, -0.84337395, 0.032662854, -0.0009921952, -0.0025184364)
|
transform = Transform3D(-0.83532625, 0.10253985, 0.5321998, 0.116231225, 0.7369294, -0.07405278, -0.5373271, 0, -0.84337395, 0.032662854, -0.0009921952, -0.0025184364)
|
||||||
size = Vector3(0.010739746, 0.14464112, 0.01)
|
size = Vector3(0.010739746, 0.14464112, 0.01)
|
||||||
material = SubResource("StandardMaterial3D_24d3s")
|
material = SubResource("StandardMaterial3D_24d3s")
|
||||||
|
|
||||||
[node name="CSGBox3D19" type="CSGBox3D" parent="CSGCombiner3D" unique_id=239318459]
|
[node name="CSGBox3D19" type="CSGBox3D" parent="Model/CSGCombiner3D" unique_id=239318459]
|
||||||
transform = Transform3D(-0.9815485, 0, -0.19121267, 0, 0.74402916, 0, 0.19121267, 0, -0.9815485, -0.016665924, -0.0033536162, -0.014228297)
|
transform = Transform3D(-0.9815485, 0, -0.19121267, 0, 0.74402916, 0, 0.19121267, 0, -0.9815485, -0.016665924, -0.0033536162, -0.014228297)
|
||||||
size = Vector3(0.01, 0.13829346, 0.01)
|
size = Vector3(0.01, 0.13829346, 0.01)
|
||||||
material = SubResource("StandardMaterial3D_24d3s")
|
material = SubResource("StandardMaterial3D_24d3s")
|
||||||
|
|
||||||
[node name="CSGBox3D20" type="CSGBox3D" parent="CSGCombiner3D" unique_id=928371372]
|
[node name="CSGBox3D20" type="CSGBox3D" parent="Model/CSGCombiner3D" unique_id=928371372]
|
||||||
transform = Transform3D(-0.99966913, 0, 0.025721963, 0, 0.7440292, 0, -0.025721963, 0, -0.99966913, 0.011737803, -0.00657787, -0.006381719)
|
transform = Transform3D(-0.99966913, 0, 0.025721963, 0, 0.7440292, 0, -0.025721963, 0, -0.99966913, 0.011737803, -0.00657787, -0.006381719)
|
||||||
size = Vector3(0.01, 0.12962647, 0.01)
|
size = Vector3(0.01, 0.12962647, 0.01)
|
||||||
material = SubResource("StandardMaterial3D_24d3s")
|
material = SubResource("StandardMaterial3D_24d3s")
|
||||||
|
|
||||||
[node name="CSGBox3D21" type="CSGBox3D" parent="CSGCombiner3D" unique_id=226684342]
|
[node name="CSGBox3D21" type="CSGBox3D" parent="Model/CSGCombiner3D" unique_id=226684342]
|
||||||
transform = Transform3D(-0.99966913, 0, 0.025721963, 0, 0.7440292, 0, -0.025721963, 0, -0.99966913, 0.0084346505, -0.0049475795, 0.026858818)
|
transform = Transform3D(-0.99966913, 0, 0.025721963, 0, 0.7440292, 0, -0.025721963, 0, -0.99966913, 0.0084346505, -0.0049475795, 0.026858818)
|
||||||
size = Vector3(0.01, 0.1340088, 0.01)
|
size = Vector3(0.01, 0.1340088, 0.01)
|
||||||
material = SubResource("StandardMaterial3D_24d3s")
|
material = SubResource("StandardMaterial3D_24d3s")
|
||||||
|
|
||||||
[node name="CSGBox3D22" type="CSGBox3D" parent="CSGCombiner3D" unique_id=1692336606]
|
[node name="CSGBox3D22" type="CSGBox3D" parent="Model/CSGCombiner3D" unique_id=1692336606]
|
||||||
transform = Transform3D(-0.99966913, 0, 0.025721963, 0, 0.7440292, 0, -0.025721963, 0, -0.99966913, 0.01866528, -0.0077131614, -0.019351937)
|
transform = Transform3D(-0.99966913, 0, 0.025721963, 0, 0.7440292, 0, -0.025721963, 0, -0.99966913, 0.01866528, -0.0077131614, -0.019351937)
|
||||||
size = Vector3(0.010739746, 0.12657471, 0.01)
|
size = Vector3(0.010739746, 0.12657471, 0.01)
|
||||||
material = SubResource("StandardMaterial3D_24d3s")
|
material = SubResource("StandardMaterial3D_24d3s")
|
||||||
|
|
||||||
[node name="CSGBox3D23" type="CSGBox3D" parent="CSGCombiner3D" unique_id=1460106852]
|
[node name="CSGBox3D23" type="CSGBox3D" parent="Model/CSGCombiner3D" unique_id=1460106852]
|
||||||
transform = Transform3D(-0.99966913, 0, 0.025721963, 0, 0.7440292, 0, -0.025721963, 0, -0.99966913, -0.03309758, -0.010889728, -0.018640606)
|
transform = Transform3D(-0.99966913, 0, 0.025721963, 0, 0.7440292, 0, -0.025721963, 0, -0.99966913, -0.03309758, -0.010889728, -0.018640606)
|
||||||
size = Vector3(0.01, 0.11803589, 0.01)
|
size = Vector3(0.01, 0.11803589, 0.01)
|
||||||
material = SubResource("StandardMaterial3D_24d3s")
|
material = SubResource("StandardMaterial3D_24d3s")
|
||||||
|
|
||||||
[node name="CSGBox3D24" type="CSGBox3D" parent="CSGCombiner3D" unique_id=814233916]
|
[node name="CSGBox3D24" type="CSGBox3D" parent="Model/CSGCombiner3D" unique_id=814233916]
|
||||||
transform = Transform3D(-0.9791465, 0, -0.20315555, 0, 0.74402934, 0, 0.20315555, 0, -0.9791465, 0.0009902613, -0.0049475795, -0.019000916)
|
transform = Transform3D(-0.9791465, 0, -0.20315555, 0, 0.74402934, 0, 0.20315555, 0, -0.9791465, 0.0009902613, -0.0049475795, -0.019000916)
|
||||||
size = Vector3(0.01, 0.1340088, 0.01)
|
size = Vector3(0.01, 0.1340088, 0.01)
|
||||||
material = SubResource("StandardMaterial3D_24d3s")
|
material = SubResource("StandardMaterial3D_24d3s")
|
||||||
|
|
||||||
[node name="CSGBox3D25" type="CSGBox3D" parent="CSGCombiner3D" unique_id=1206566850]
|
[node name="CSGBox3D25" type="CSGBox3D" parent="Model/CSGCombiner3D" unique_id=1206566850]
|
||||||
transform = Transform3D(0.9997566, 0, -0.022063702, 0, 0.7440293, 0, 0.022063702, 0, 0.9997566, 0.034941338, -0.0049475897, -0.015364999)
|
transform = Transform3D(0.9997566, 0, -0.022063702, 0, 0.7440293, 0, 0.022063702, 0, 0.9997566, 0.034941338, -0.0049475897, -0.015364999)
|
||||||
size = Vector3(0.01, 0.1340088, 0.01)
|
size = Vector3(0.01, 0.1340088, 0.01)
|
||||||
material = SubResource("StandardMaterial3D_24d3s")
|
material = SubResource("StandardMaterial3D_24d3s")
|
||||||
|
|
||||||
[node name="CSGBox3D26" type="CSGBox3D" parent="CSGCombiner3D" unique_id=782469494]
|
[node name="CSGBox3D26" type="CSGBox3D" parent="Model/CSGCombiner3D" unique_id=782469494]
|
||||||
transform = Transform3D(0.9394602, 0, 0.34265807, 0, 0.7440292, 0, -0.34265807, 0, 0.9394602, 0.029045265, -0.0049475795, -0.0052434783)
|
transform = Transform3D(0.9394602, 0, 0.34265807, 0, 0.7440292, 0, -0.34265807, 0, 0.9394602, 0.029045265, -0.0049475795, -0.0052434783)
|
||||||
size = Vector3(0.01, 0.1340088, 0.01)
|
size = Vector3(0.01, 0.1340088, 0.01)
|
||||||
material = SubResource("StandardMaterial3D_24d3s")
|
material = SubResource("StandardMaterial3D_24d3s")
|
||||||
|
|
||||||
[node name="CSGBox3D27" type="CSGBox3D" parent="CSGCombiner3D" unique_id=615899037]
|
[node name="CSGBox3D27" type="CSGBox3D" parent="Model/CSGCombiner3D" unique_id=615899037]
|
||||||
transform = Transform3D(0.9816637, 0, -0.19062132, 0, 0.74402916, 0, 0.19062132, 0, 0.9816637, -0.024296898, -0.0009921952, 0.012097965)
|
transform = Transform3D(0.9816637, 0, -0.19062132, 0, 0.74402916, 0, 0.19062132, 0, 0.9816637, -0.024296898, -0.0009921952, 0.012097965)
|
||||||
size = Vector3(0.010739746, 0.14464112, 0.01)
|
size = Vector3(0.010739746, 0.14464112, 0.01)
|
||||||
material = SubResource("StandardMaterial3D_24d3s")
|
material = SubResource("StandardMaterial3D_24d3s")
|
||||||
|
|
||||||
[node name="CSGBox3D28" type="CSGBox3D" parent="CSGCombiner3D" unique_id=1440223352]
|
[node name="CSGBox3D28" type="CSGBox3D" parent="Model/CSGCombiner3D" unique_id=1440223352]
|
||||||
transform = Transform3D(0.84304994, 0, 0.537835, 0, 0.74402916, 0, -0.537835, 0, 0.84304994, 0.025889535, -0.0033536162, 0.0049027367)
|
transform = Transform3D(0.84304994, 0, 0.537835, 0, 0.74402916, 0, -0.537835, 0, 0.84304994, 0.025889535, -0.0033536162, 0.0049027367)
|
||||||
size = Vector3(0.01, 0.13829346, 0.01)
|
size = Vector3(0.01, 0.13829346, 0.01)
|
||||||
material = SubResource("StandardMaterial3D_24d3s")
|
material = SubResource("StandardMaterial3D_24d3s")
|
||||||
|
|
||||||
[node name="CSGBox3D29" type="CSGBox3D" parent="CSGCombiner3D" unique_id=1162134484]
|
[node name="CSGBox3D29" type="CSGBox3D" parent="Model/CSGCombiner3D" unique_id=1162134484]
|
||||||
transform = Transform3D(0.9394602, 0, 0.34265807, 0, 0.7440292, 0, -0.34265807, 0, 0.9394602, -0.0034128763, -0.00657787, 0.0080187)
|
transform = Transform3D(0.9394602, 0, 0.34265807, 0, 0.7440292, 0, -0.34265807, 0, 0.9394602, -0.0034128763, -0.00657787, 0.0080187)
|
||||||
size = Vector3(0.01, 0.12962647, 0.01)
|
size = Vector3(0.01, 0.12962647, 0.01)
|
||||||
material = SubResource("StandardMaterial3D_24d3s")
|
material = SubResource("StandardMaterial3D_24d3s")
|
||||||
|
|
||||||
[node name="CSGBox3D30" type="CSGBox3D" parent="CSGCombiner3D" unique_id=939036040]
|
[node name="CSGBox3D30" type="CSGBox3D" parent="Model/CSGCombiner3D" unique_id=939036040]
|
||||||
transform = Transform3D(0.9394602, 0, 0.34265807, 0, 0.7440292, 0, -0.34265807, 0, 0.9394602, -0.0018274263, -0.0049475795, -0.028005121)
|
transform = Transform3D(0.9394602, 0, 0.34265807, 0, 0.7440292, 0, -0.34265807, 0, 0.9394602, -0.0018274263, -0.0049475795, -0.028005121)
|
||||||
size = Vector3(0.01, 0.1340088, 0.01)
|
size = Vector3(0.01, 0.1340088, 0.01)
|
||||||
material = SubResource("StandardMaterial3D_24d3s")
|
material = SubResource("StandardMaterial3D_24d3s")
|
||||||
|
|
||||||
[node name="CSGBox3D31" type="CSGBox3D" parent="CSGCombiner3D" unique_id=1952616270]
|
[node name="CSGBox3D31" type="CSGBox3D" parent="Model/CSGCombiner3D" unique_id=1952616270]
|
||||||
transform = Transform3D(0.9394602, 0, 0.34265807, 0, 0.7440292, 0, -0.34265807, 0, 0.9394602, -0.0051014535, -0.0077131614, 0.022625728)
|
transform = Transform3D(0.9394602, 0, 0.34265807, 0, 0.7440292, 0, -0.34265807, 0, 0.9394602, -0.0051014535, -0.0077131614, 0.022625728)
|
||||||
size = Vector3(0.010739746, 0.12657471, 0.01)
|
size = Vector3(0.010739746, 0.12657471, 0.01)
|
||||||
material = SubResource("StandardMaterial3D_24d3s")
|
material = SubResource("StandardMaterial3D_24d3s")
|
||||||
|
|
||||||
[node name="CSGBox3D32" type="CSGBox3D" parent="CSGCombiner3D" unique_id=1868626634]
|
[node name="CSGBox3D32" type="CSGBox3D" parent="Model/CSGCombiner3D" unique_id=1868626634]
|
||||||
transform = Transform3D(0.9394602, 0, 0.34265807, 0, 0.7440292, 0, -0.34265807, 0, 0.9394602, 0.042794522, -0.010889728, 0.0029820204)
|
transform = Transform3D(0.9394602, 0, 0.34265807, 0, 0.7440292, 0, -0.34265807, 0, 0.9394602, 0.042794522, -0.010889728, 0.0029820204)
|
||||||
size = Vector3(0.01, 0.11803589, 0.01)
|
size = Vector3(0.01, 0.11803589, 0.01)
|
||||||
material = SubResource("StandardMaterial3D_24d3s")
|
material = SubResource("StandardMaterial3D_24d3s")
|
||||||
|
|
||||||
[node name="CSGBox3D33" type="CSGBox3D" parent="CSGCombiner3D" unique_id=529418367]
|
[node name="CSGBox3D33" type="CSGBox3D" parent="Model/CSGCombiner3D" unique_id=529418367]
|
||||||
transform = Transform3D(0.8364357, 0, 0.54806507, 0, 0.74402934, 0, -0.54806507, 0, 0.8364357, 0.011213522, -0.0049475795, 0.015817564)
|
transform = Transform3D(0.8364357, 0, 0.54806507, 0, 0.74402934, 0, -0.54806507, 0, 0.8364357, 0.011213522, -0.0049475795, 0.015817564)
|
||||||
size = Vector3(0.01, 0.1340088, 0.01)
|
size = Vector3(0.01, 0.1340088, 0.01)
|
||||||
material = SubResource("StandardMaterial3D_24d3s")
|
material = SubResource("StandardMaterial3D_24d3s")
|
||||||
|
|
||||||
[node name="FoodItem" parent="." unique_id=63948206 instance=ExtResource("6_66ydo")]
|
|
||||||
|
[node name="FoodItem" parent="." index="3"]
|
||||||
id = "chips"
|
id = "chips"
|
||||||
type = 1
|
type = 1
|
||||||
sell_value = 2
|
sell_value = 2
|
||||||
|
|
||||||
[node name="CombinableItem" parent="." unique_id=996936271 instance=ExtResource("7_qlknf")]
|
|
||||||
|
|
||||||
[node name="NetPickable" type="MultiplayerSynchronizer" parent="." unique_id=1263255707]
|
|
||||||
replication_config = SubResource("SceneReplicationConfig_np_cube")
|
|
||||||
script = ExtResource("8_do54s")
|
|
||||||
|
|
||||||
[node name="DespawningItem" parent="." unique_id=303090111 instance=ExtResource("9_obvwg")]
|
|
||||||
|
|||||||
+22
-57
@@ -1,136 +1,101 @@
|
|||||||
[gd_scene format=3 uid="uid://bpvp20hiagxxb"]
|
[gd_scene format=3 uid="uid://bpvp20hiagxxb"]
|
||||||
|
|
||||||
[ext_resource type="PackedScene" uid="uid://c8l60rnugru40" path="res://addons/godot-xr-tools/objects/pickable.tscn" id="1_of0s8"]
|
[ext_resource type="PackedScene" uid="uid://d8jo0402pgl6" path="res://abstract/food_item.tscn" id="1_food_item"]
|
||||||
[ext_resource type="PackedScene" uid="uid://c25yxb0vt53vc" path="res://addons/godot-xr-tools/objects/grab_points/grab_point_hand_left.tscn" id="2_cllfo"]
|
|
||||||
[ext_resource type="Animation" uid="uid://db62hs5s4n2b3" path="res://addons/godot-xr-tools/hands/animations/left/Grip 4.res" id="3_qjifl"]
|
|
||||||
[ext_resource type="Script" uid="uid://dvobm6vcfnqe8" path="res://addons/godot-xr-tools/hands/poses/hand_pose_settings.gd" id="4_1hoyy"]
|
|
||||||
[ext_resource type="PackedScene" uid="uid://ctw7nbntd5pcj" path="res://addons/godot-xr-tools/objects/grab_points/grab_point_hand_right.tscn" id="5_83pbl"]
|
|
||||||
[ext_resource type="Animation" uid="uid://d1xnpyc08njjx" path="res://addons/godot-xr-tools/hands/animations/right/Grip 4.res" id="6_bwaw5"]
|
|
||||||
[ext_resource type="PackedScene" uid="uid://bfj80jh13t6e5" path="res://prefabs/food_item.tscn" id="7_7a0yr"]
|
|
||||||
[ext_resource type="Script" uid="uid://bwd0pe2udb5xo" path="res://Net/net_pickable.gd" id="8_wbxrg"]
|
|
||||||
[ext_resource type="PackedScene" uid="uid://b5ukku8i0hilb" path="res://prefabs/despawning_item.tscn" id="9_jlkrg"]
|
|
||||||
|
|
||||||
[sub_resource type="BoxShape3D" id="BoxShape3D_of0s8"]
|
[sub_resource type="BoxShape3D" id="BoxShape3D_of0s8"]
|
||||||
size = Vector3(0.10456543, 0.1, 0.035327148)
|
size = Vector3(0.10456543, 0.1, 0.035327148)
|
||||||
|
|
||||||
[sub_resource type="Resource" id="Resource_lc22d"]
|
|
||||||
script = ExtResource("4_1hoyy")
|
|
||||||
closed_pose = ExtResource("3_qjifl")
|
|
||||||
metadata/_custom_type_script = "uid://dvobm6vcfnqe8"
|
|
||||||
|
|
||||||
[sub_resource type="Resource" id="Resource_qyiot"]
|
|
||||||
script = ExtResource("4_1hoyy")
|
|
||||||
closed_pose = ExtResource("6_bwaw5")
|
|
||||||
metadata/_custom_type_script = "uid://dvobm6vcfnqe8"
|
|
||||||
|
|
||||||
[sub_resource type="SceneReplicationConfig" id="SceneReplicationConfig_np_burger"]
|
|
||||||
properties/0/path = NodePath(".:position")
|
|
||||||
properties/0/spawn = false
|
|
||||||
properties/0/replication_mode = 1
|
|
||||||
properties/1/path = NodePath(".:quaternion")
|
|
||||||
properties/1/spawn = false
|
|
||||||
properties/1/replication_mode = 1
|
|
||||||
properties/2/path = NodePath("NetPickable:net_held_by")
|
|
||||||
properties/2/spawn = true
|
|
||||||
properties/2/replication_mode = 1
|
|
||||||
|
|
||||||
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_of0s8"]
|
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_of0s8"]
|
||||||
albedo_color = Color(0.7546, 0.77, 0.30799997, 1)
|
albedo_color = Color(0.7546, 0.77, 0.30799997, 1)
|
||||||
|
|
||||||
[node name="ChoppedPotato" unique_id=1675596942 instance=ExtResource("1_of0s8")]
|
[node name="ChoppedPotato" unique_id=1675596942 instance=ExtResource("1_food_item")]
|
||||||
second_hand_grab = 1
|
|
||||||
|
|
||||||
[node name="CollisionShape3D" parent="." index="0"]
|
[node name="CollisionShape3D" parent="." index="0"]
|
||||||
transform = Transform3D(1, 0, 0, 0, -4.371139e-08, -1, 0, 1, -4.371139e-08, 0.0022827126, 0.010339355, -0.0028051804)
|
transform = Transform3D(1, 0, 0, 0, -4.371139e-08, -1, 0, 1, -4.371139e-08, 0.0022827126, 0.010339355, -0.0028051804)
|
||||||
shape = SubResource("BoxShape3D_of0s8")
|
shape = SubResource("BoxShape3D_of0s8")
|
||||||
|
|
||||||
[node name="GrabPointHandLeft" parent="." index="1" unique_id=1571481674 instance=ExtResource("2_cllfo")]
|
[node name="GrabPointHandLeft" parent="." index="1"]
|
||||||
transform = Transform3D(0.4877618, 0.85191125, -0.19062005, -0.8708042, 0.49020204, -0.0374375, 0.06154889, 0.1842533, 0.98094976, 0.028727118, 0.03771837, -0.06794037)
|
transform = Transform3D(0.4877618, 0.85191125, -0.19062005, -0.8708042, 0.49020204, -0.0374375, 0.06154889, 0.1842533, 0.98094976, 0.028727118, 0.03771837, -0.06794037)
|
||||||
hand_pose = SubResource("Resource_lc22d")
|
|
||||||
|
|
||||||
[node name="GrabPointHandRight" parent="." index="2" unique_id=514404634 instance=ExtResource("5_83pbl")]
|
[node name="GrabPointHandRight" parent="." index="2"]
|
||||||
transform = Transform3D(0.35819444, -0.933647, 0, 0.92118585, 0.35341373, -0.16283518, 0.1520306, 0.05832667, 0.98665327, -0.02374028, 0.05081141, -0.06576714)
|
transform = Transform3D(0.35819444, -0.933647, 0, 0.92118585, 0.35341373, -0.16283518, 0.1520306, 0.05832667, 0.98665327, -0.02374028, 0.05081141, -0.06576714)
|
||||||
hand_pose = SubResource("Resource_qyiot")
|
|
||||||
|
|
||||||
[node name="FoodItem" parent="." index="3" unique_id=63948206 instance=ExtResource("7_7a0yr")]
|
[node name="FoodItem" parent="." index="3"]
|
||||||
id = "chopped_potato"
|
id = "chopped_potato"
|
||||||
type = 2
|
type = 2
|
||||||
sell_value = 0
|
sell_value = 0
|
||||||
|
|
||||||
[node name="NetPickable" type="MultiplayerSynchronizer" parent="." index="4" unique_id=1382968688]
|
[node name="CombinableItem" parent="." index="8"]
|
||||||
replication_config = SubResource("SceneReplicationConfig_np_burger")
|
enabled = false
|
||||||
script = ExtResource("8_wbxrg")
|
|
||||||
|
|
||||||
[node name="DespawningItem" parent="." index="5" unique_id=303090111 instance=ExtResource("9_jlkrg")]
|
[node name="CSGCombiner3D" type="CSGCombiner3D" parent="Model" index="0" unique_id=1632388374]
|
||||||
|
|
||||||
[node name="CSGCombiner3D" type="CSGCombiner3D" parent="." index="6" unique_id=1632388374]
|
[node name="CSGBox3D3" type="CSGBox3D" parent="Model/CSGCombiner3D" index="0" unique_id=333574743]
|
||||||
|
|
||||||
[node name="CSGBox3D3" type="CSGBox3D" parent="CSGCombiner3D" index="0" unique_id=333574743]
|
|
||||||
transform = Transform3D(0.9982952, 0.058366816, 0, 2.5512945e-09, -4.363687e-08, -1, -0.058366816, 0.9982952, -4.371139e-08, 0.017540446, 0.012680878, -0.007841777)
|
transform = Transform3D(0.9982952, 0.058366816, 0, 2.5512945e-09, -4.363687e-08, -1, -0.058366816, 0.9982952, -4.371139e-08, 0.017540446, 0.012680878, -0.007841777)
|
||||||
size = Vector3(0.012, 0.0737854, 0.012)
|
size = Vector3(0.012, 0.0737854, 0.012)
|
||||||
material = SubResource("StandardMaterial3D_of0s8")
|
material = SubResource("StandardMaterial3D_of0s8")
|
||||||
|
|
||||||
[node name="CSGBox3D10" type="CSGBox3D" parent="CSGCombiner3D" index="1" unique_id=1055117011]
|
[node name="CSGBox3D10" type="CSGBox3D" parent="Model/CSGCombiner3D" index="1" unique_id=1055117011]
|
||||||
transform = Transform3D(1, 0, 0, 0, -4.371139e-08, -1, 0, 1, -4.371139e-08, -0.043418147, 0.013074134, 0.00018549338)
|
transform = Transform3D(1, 0, 0, 0, -4.371139e-08, -1, 0, 1, -4.371139e-08, -0.043418147, 0.013074134, 0.00018549338)
|
||||||
size = Vector3(0.012, 0.048638918, 0.012)
|
size = Vector3(0.012, 0.048638918, 0.012)
|
||||||
material = SubResource("StandardMaterial3D_of0s8")
|
material = SubResource("StandardMaterial3D_of0s8")
|
||||||
|
|
||||||
[node name="CSGBox3D11" type="CSGBox3D" parent="CSGCombiner3D" index="2" unique_id=12997588]
|
[node name="CSGBox3D11" type="CSGBox3D" parent="Model/CSGCombiner3D" index="2" unique_id=12997588]
|
||||||
transform = Transform3D(1, 0, 0, 0, -4.371139e-08, -1, 0, 1, -4.371139e-08, 0.0347388, 0, -0.0042848364)
|
transform = Transform3D(1, 0, 0, 0, -4.371139e-08, -1, 0, 1, -4.371139e-08, 0.0347388, 0, -0.0042848364)
|
||||||
size = Vector3(0.012, 0.11803589, 0.012)
|
size = Vector3(0.012, 0.11803589, 0.012)
|
||||||
material = SubResource("StandardMaterial3D_of0s8")
|
material = SubResource("StandardMaterial3D_of0s8")
|
||||||
|
|
||||||
[node name="CSGBox3D16" type="CSGBox3D" parent="CSGCombiner3D" index="3" unique_id=520084094]
|
[node name="CSGBox3D16" type="CSGBox3D" parent="Model/CSGCombiner3D" index="3" unique_id=520084094]
|
||||||
transform = Transform3D(-0.9220182, 0, 0.38714683, 0.38714683, -3.2522554e-08, 0.9220182, 1.6922723e-08, 0.7440293, 4.030269e-08, -0.03251951, 0, -0.0066871783)
|
transform = Transform3D(-0.9220182, 0, 0.38714683, 0.38714683, -3.2522554e-08, 0.9220182, 1.6922723e-08, 0.7440293, 4.030269e-08, -0.03251951, 0, -0.0066871783)
|
||||||
size = Vector3(0.012, 0.1340088, 0.012)
|
size = Vector3(0.012, 0.1340088, 0.012)
|
||||||
material = SubResource("StandardMaterial3D_of0s8")
|
material = SubResource("StandardMaterial3D_of0s8")
|
||||||
|
|
||||||
[node name="CSGBox3D18" type="CSGBox3D" parent="CSGCombiner3D" index="4" unique_id=1713154750]
|
[node name="CSGBox3D18" type="CSGBox3D" parent="Model/CSGCombiner3D" index="4" unique_id=1713154750]
|
||||||
transform = Transform3D(-0.83532625, 0.10253985, 0.5321998, 0.5373272, -3.183022e-08, 0.8433741, 0.11623128, 0.7369294, -0.07405276, 0.012299374, 0, -0.0027317838)
|
transform = Transform3D(-0.83532625, 0.10253985, 0.5321998, 0.5373272, -3.183022e-08, 0.8433741, 0.11623128, 0.7369294, -0.07405276, 0.012299374, 0, -0.0027317838)
|
||||||
size = Vector3(0.012, 0.14464112, 0.012)
|
size = Vector3(0.012, 0.14464112, 0.012)
|
||||||
material = SubResource("StandardMaterial3D_of0s8")
|
material = SubResource("StandardMaterial3D_of0s8")
|
||||||
|
|
||||||
[node name="CSGBox3D19" type="CSGBox3D" parent="CSGCombiner3D" index="5" unique_id=1856457460]
|
[node name="CSGBox3D19" type="CSGBox3D" parent="Model/CSGCombiner3D" index="5" unique_id=1856457460]
|
||||||
transform = Transform3D(-0.9815485, 0, -0.19121267, -0.19121267, -3.2522546e-08, 0.9815485, -8.358171e-09, 0.74402916, 4.2904848e-08, 0.0047408585, 0.015360672, -0.0050932043)
|
transform = Transform3D(-0.9815485, 0, -0.19121267, -0.19121267, -3.2522546e-08, 0.9815485, -8.358171e-09, 0.74402916, 4.2904848e-08, 0.0047408585, 0.015360672, -0.0050932043)
|
||||||
size = Vector3(0.012, 0.13829346, 0.012)
|
size = Vector3(0.012, 0.13829346, 0.012)
|
||||||
material = SubResource("StandardMaterial3D_of0s8")
|
material = SubResource("StandardMaterial3D_of0s8")
|
||||||
|
|
||||||
[node name="CSGBox3D21" type="CSGBox3D" parent="CSGCombiner3D" index="6" unique_id=1085994272]
|
[node name="CSGBox3D21" type="CSGBox3D" parent="Model/CSGCombiner3D" index="6" unique_id=1085994272]
|
||||||
transform = Transform3D(-0.99966913, 0, 0.025721963, 0.025721963, -3.252255e-08, 0.99966913, 1.1243427e-09, 0.7440292, 4.3696925e-08, 0.0084346505, -1.2525464e-10, -0.0038216766)
|
transform = Transform3D(-0.99966913, 0, 0.025721963, 0.025721963, -3.252255e-08, 0.99966913, 1.1243427e-09, 0.7440292, 4.3696925e-08, 0.0084346505, -1.2525464e-10, -0.0038216766)
|
||||||
size = Vector3(0.012, 0.14171143, 0.012)
|
size = Vector3(0.012, 0.14171143, 0.012)
|
||||||
material = SubResource("StandardMaterial3D_of0s8")
|
material = SubResource("StandardMaterial3D_of0s8")
|
||||||
|
|
||||||
[node name="CSGBox3D24" type="CSGBox3D" parent="CSGCombiner3D" index="7" unique_id=799603447]
|
[node name="CSGBox3D24" type="CSGBox3D" parent="Model/CSGCombiner3D" index="7" unique_id=799603447]
|
||||||
transform = Transform3D(-0.95734614, -0.16150172, -0.19071358, -0.19483496, -0.0018292161, 0.980833, -0.21337205, 0.7262875, -0.039937917, -0.015636567, 0.016941056, -0.0038651554)
|
transform = Transform3D(-0.95734614, -0.16150172, -0.19071358, -0.19483496, -0.0018292161, 0.980833, -0.21337205, 0.7262875, -0.039937917, -0.015636567, 0.016941056, -0.0038651554)
|
||||||
size = Vector3(0.012, 0.1340088, 0.012)
|
size = Vector3(0.012, 0.1340088, 0.012)
|
||||||
material = SubResource("StandardMaterial3D_of0s8")
|
material = SubResource("StandardMaterial3D_of0s8")
|
||||||
|
|
||||||
[node name="CSGBox3D26" type="CSGBox3D" parent="CSGCombiner3D" index="8" unique_id=129671681]
|
[node name="CSGBox3D26" type="CSGBox3D" parent="Model/CSGCombiner3D" index="8" unique_id=129671681]
|
||||||
transform = Transform3D(0.9394602, 0, 0.34265804, 0.34265804, -3.252255e-08, -0.9394602, 1.497806e-08, 0.7440292, -4.106511e-08, 0.033136886, 0.017579898, -0.0066871676)
|
transform = Transform3D(0.9394602, 0, 0.34265804, 0.34265804, -3.252255e-08, -0.9394602, 1.497806e-08, 0.7440292, -4.106511e-08, 0.033136886, 0.017579898, -0.0066871676)
|
||||||
size = Vector3(0.012, 0.1340088, 0.012)
|
size = Vector3(0.012, 0.1340088, 0.012)
|
||||||
material = SubResource("StandardMaterial3D_of0s8")
|
material = SubResource("StandardMaterial3D_of0s8")
|
||||||
|
|
||||||
[node name="CSGBox3D27" type="CSGBox3D" parent="CSGCombiner3D" index="9" unique_id=17129382]
|
[node name="CSGBox3D27" type="CSGBox3D" parent="Model/CSGCombiner3D" index="9" unique_id=17129382]
|
||||||
transform = Transform3D(0.9816637, 0, -0.19062133, -0.19062132, -3.2522546e-08, -0.98166364, -8.332322e-09, 0.74402916, -4.2909882e-08, -0.019075055, -4.3606386e-05, -0.0027317842)
|
transform = Transform3D(0.9816637, 0, -0.19062133, -0.19062132, -3.2522546e-08, -0.98166364, -8.332322e-09, 0.74402916, -4.2909882e-08, -0.019075055, -4.3606386e-05, -0.0027317842)
|
||||||
size = Vector3(0.012, 0.14464112, 0.012)
|
size = Vector3(0.012, 0.14464112, 0.012)
|
||||||
material = SubResource("StandardMaterial3D_of0s8")
|
material = SubResource("StandardMaterial3D_of0s8")
|
||||||
|
|
||||||
[node name="CSGBox3D28" type="CSGBox3D" parent="CSGCombiner3D" index="10" unique_id=1557637409]
|
[node name="CSGBox3D28" type="CSGBox3D" parent="Model/CSGCombiner3D" index="10" unique_id=1557637409]
|
||||||
transform = Transform3D(0.84304994, 0, 0.537835, 0.537835, -3.2522546e-08, -0.84304994, 2.3509514e-08, 0.74402916, -3.6850885e-08, 0.047794472, 0.016187795, -0.0034102863)
|
transform = Transform3D(0.84304994, 0, 0.537835, 0.537835, -3.2522546e-08, -0.84304994, 2.3509514e-08, 0.74402916, -3.6850885e-08, 0.047794472, 0.016187795, -0.0034102863)
|
||||||
size = Vector3(0.012, 0.11199341, 0.012)
|
size = Vector3(0.012, 0.11199341, 0.012)
|
||||||
material = SubResource("StandardMaterial3D_of0s8")
|
material = SubResource("StandardMaterial3D_of0s8")
|
||||||
|
|
||||||
[node name="CSGBox3D30" type="CSGBox3D" parent="CSGCombiner3D" index="11" unique_id=1187654453]
|
[node name="CSGBox3D30" type="CSGBox3D" parent="Model/CSGCombiner3D" index="11" unique_id=1187654453]
|
||||||
transform = Transform3D(0.9394602, 0, 0.34265804, 0.34265804, -3.252255e-08, -0.9394602, 1.497806e-08, 0.7440292, -4.106511e-08, -0.005314119, 0, 0.009267362)
|
transform = Transform3D(0.9394602, 0, 0.34265804, 0.34265804, -3.252255e-08, -0.9394602, 1.497806e-08, 0.7440292, -4.106511e-08, -0.005314119, 0, 0.009267362)
|
||||||
size = Vector3(0.012, 0.1340088, 0.012)
|
size = Vector3(0.012, 0.1340088, 0.012)
|
||||||
material = SubResource("StandardMaterial3D_of0s8")
|
material = SubResource("StandardMaterial3D_of0s8")
|
||||||
|
|
||||||
[node name="CSGBox3D32" type="CSGBox3D" parent="CSGCombiner3D" index="12" unique_id=733217969]
|
[node name="CSGBox3D32" type="CSGBox3D" parent="Model/CSGCombiner3D" index="12" unique_id=733217969]
|
||||||
transform = Transform3D(0.9394602, 0, 0.34265804, 0.34265804, -3.252255e-08, -0.9394602, 1.497806e-08, 0.7440292, -4.106511e-08, 0.050648127, 9.4238846e-11, -0.0005330723)
|
transform = Transform3D(0.9394602, 0, 0.34265804, 0.34265804, -3.252255e-08, -0.9394602, 1.497806e-08, 0.7440292, -4.106511e-08, 0.050648127, 9.4238846e-11, -0.0005330723)
|
||||||
size = Vector3(0.012, 0.1122406, 0.012)
|
size = Vector3(0.012, 0.1122406, 0.012)
|
||||||
material = SubResource("StandardMaterial3D_of0s8")
|
material = SubResource("StandardMaterial3D_of0s8")
|
||||||
|
|
||||||
[node name="CSGBox3D29" type="CSGBox3D" parent="CSGCombiner3D" index="13" unique_id=1376406225]
|
[node name="CSGBox3D29" type="CSGBox3D" parent="Model/CSGCombiner3D" index="13" unique_id=1376406225]
|
||||||
transform = Transform3D(0.9816637, 0, -0.19062133, -0.19062132, -3.2522546e-08, -0.98166364, -8.332322e-09, 0.74402916, -4.2909882e-08, -0.04667829, -4.360572e-05, -0.0065923333)
|
transform = Transform3D(0.9816637, 0, -0.19062133, -0.19062132, -3.2522546e-08, -0.98166364, -8.332322e-09, 0.74402916, -4.2909882e-08, -0.04667829, -4.360572e-05, -0.0065923333)
|
||||||
size = Vector3(0.012, 0.10369263, 0.012)
|
size = Vector3(0.012, 0.10369263, 0.012)
|
||||||
material = SubResource("StandardMaterial3D_of0s8")
|
material = SubResource("StandardMaterial3D_of0s8")
|
||||||
|
|||||||
@@ -1,15 +1,6 @@
|
|||||||
[gd_scene format=3 uid="uid://cfc4ho67u4r5e"]
|
[gd_scene format=3 uid="uid://cfc4ho67u4r5e"]
|
||||||
|
|
||||||
[ext_resource type="PackedScene" uid="uid://c8l60rnugru40" path="res://addons/godot-xr-tools/objects/pickable.tscn" id="1_ut7mg"]
|
[ext_resource type="PackedScene" uid="uid://d8jo0402pgl6" path="res://abstract/food_item.tscn" id="1_food_item"]
|
||||||
[ext_resource type="PackedScene" uid="uid://c25yxb0vt53vc" path="res://addons/godot-xr-tools/objects/grab_points/grab_point_hand_left.tscn" id="3_pkevi"]
|
|
||||||
[ext_resource type="Animation" uid="uid://db62hs5s4n2b3" path="res://addons/godot-xr-tools/hands/animations/left/Grip 4.res" id="4_dq7qw"]
|
|
||||||
[ext_resource type="Script" uid="uid://dvobm6vcfnqe8" path="res://addons/godot-xr-tools/hands/poses/hand_pose_settings.gd" id="5_ychvb"]
|
|
||||||
[ext_resource type="PackedScene" uid="uid://ctw7nbntd5pcj" path="res://addons/godot-xr-tools/objects/grab_points/grab_point_hand_right.tscn" id="6_etdv2"]
|
|
||||||
[ext_resource type="Animation" uid="uid://d1xnpyc08njjx" path="res://addons/godot-xr-tools/hands/animations/right/Grip 4.res" id="7_rl64h"]
|
|
||||||
[ext_resource type="PackedScene" uid="uid://b5ukku8i0hilb" path="res://prefabs/despawning_item.tscn" id="10_6p8pj"]
|
|
||||||
[ext_resource type="PackedScene" uid="uid://3lr2dhy62rhk" path="res://prefabs/combinable_item.tscn" id="10_ut7mg"]
|
|
||||||
[ext_resource type="PackedScene" uid="uid://bfj80jh13t6e5" path="res://prefabs/food_item.tscn" id="10_zz42p"]
|
|
||||||
[ext_resource type="Script" uid="uid://bwd0pe2udb5xo" path="res://Net/net_pickable.gd" id="20_netpk"]
|
|
||||||
|
|
||||||
[sub_resource type="CylinderShape3D" id="CylinderShape3D_fco8w"]
|
[sub_resource type="CylinderShape3D" id="CylinderShape3D_fco8w"]
|
||||||
height = 0.04777527
|
height = 0.04777527
|
||||||
@@ -18,56 +9,19 @@ radius = 0.08300781
|
|||||||
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_6l01i"]
|
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_6l01i"]
|
||||||
albedo_color = Color(0.29, 0.101500005, 0, 1)
|
albedo_color = Color(0.29, 0.101500005, 0, 1)
|
||||||
|
|
||||||
[sub_resource type="Resource" id="Resource_lc22d"]
|
[node name="CookedBurger" unique_id=1675596942 instance=ExtResource("1_food_item")]
|
||||||
script = ExtResource("5_ychvb")
|
|
||||||
closed_pose = ExtResource("4_dq7qw")
|
|
||||||
metadata/_custom_type_script = "uid://dvobm6vcfnqe8"
|
|
||||||
|
|
||||||
[sub_resource type="Resource" id="Resource_qyiot"]
|
|
||||||
script = ExtResource("5_ychvb")
|
|
||||||
closed_pose = ExtResource("7_rl64h")
|
|
||||||
metadata/_custom_type_script = "uid://dvobm6vcfnqe8"
|
|
||||||
|
|
||||||
[sub_resource type="SceneReplicationConfig" id="SceneReplicationConfig_np_cookedburger"]
|
|
||||||
properties/0/path = NodePath(".:position")
|
|
||||||
properties/0/spawn = false
|
|
||||||
properties/0/replication_mode = 1
|
|
||||||
properties/1/path = NodePath(".:quaternion")
|
|
||||||
properties/1/spawn = false
|
|
||||||
properties/1/replication_mode = 1
|
|
||||||
properties/2/path = NodePath("NetPickable:net_held_by")
|
|
||||||
properties/2/spawn = true
|
|
||||||
properties/2/replication_mode = 1
|
|
||||||
|
|
||||||
[node name="CookedBurger" unique_id=1675596942 instance=ExtResource("1_ut7mg")]
|
|
||||||
second_hand_grab = 1
|
|
||||||
|
|
||||||
[node name="CollisionShape3D" parent="." index="0"]
|
[node name="CollisionShape3D" parent="." index="0"]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.0072289705, 0)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.0072289705, 0)
|
||||||
shape = SubResource("CylinderShape3D_fco8w")
|
shape = SubResource("CylinderShape3D_fco8w")
|
||||||
|
|
||||||
[node name="CSGCylinder3D" type="CSGCylinder3D" parent="." index="1" unique_id=59319982]
|
[node name="FoodItem" parent="." index="3"]
|
||||||
|
id = "cooked_burger"
|
||||||
|
type = 2
|
||||||
|
sell_value = 1
|
||||||
|
|
||||||
|
[node name="CSGCylinder3D" type="CSGCylinder3D" parent="Model" index="0" unique_id=59319982]
|
||||||
radius = 0.08300781
|
radius = 0.08300781
|
||||||
height = 0.03
|
height = 0.03
|
||||||
sides = 16
|
sides = 16
|
||||||
material = SubResource("StandardMaterial3D_6l01i")
|
material = SubResource("StandardMaterial3D_6l01i")
|
||||||
|
|
||||||
[node name="GrabPointHandLeft" parent="." index="2" unique_id=1571481674 instance=ExtResource("3_pkevi")]
|
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.067650706, 0.04601878, -0.08606844)
|
|
||||||
hand_pose = SubResource("Resource_lc22d")
|
|
||||||
|
|
||||||
[node name="GrabPointHandRight" parent="." index="3" unique_id=514404634 instance=ExtResource("6_etdv2")]
|
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.06531982, 0.042291984, -0.08604182)
|
|
||||||
hand_pose = SubResource("Resource_qyiot")
|
|
||||||
|
|
||||||
[node name="FoodItem" parent="." index="4" unique_id=234567891 instance=ExtResource("10_zz42p")]
|
|
||||||
id = "cooked_burger"
|
|
||||||
type = 2
|
|
||||||
|
|
||||||
[node name="CombinableItem" parent="." index="5" unique_id=996936271 instance=ExtResource("10_ut7mg")]
|
|
||||||
|
|
||||||
[node name="NetPickable" type="MultiplayerSynchronizer" parent="." index="6" unique_id=925955029]
|
|
||||||
replication_config = SubResource("SceneReplicationConfig_np_cookedburger")
|
|
||||||
script = ExtResource("20_netpk")
|
|
||||||
|
|
||||||
[node name="DespawningItem" parent="." index="7" unique_id=303090111 instance=ExtResource("10_6p8pj")]
|
|
||||||
|
|||||||
+33
-61
@@ -1,41 +1,11 @@
|
|||||||
[gd_scene format=3 uid="uid://dgk88esxip5xi"]
|
[gd_scene format=3 uid="uid://dgk88esxip5xi"]
|
||||||
|
|
||||||
[ext_resource type="PackedScene" uid="uid://c8l60rnugru40" path="res://addons/godot-xr-tools/objects/pickable.tscn" id="1_apu43"]
|
[ext_resource type="PackedScene" uid="uid://d8jo0402pgl6" path="res://abstract/food_item.tscn" id="1_food_item"]
|
||||||
[ext_resource type="PackedScene" uid="uid://c25yxb0vt53vc" path="res://addons/godot-xr-tools/objects/grab_points/grab_point_hand_left.tscn" id="2_ti0k8"]
|
|
||||||
[ext_resource type="Animation" uid="uid://db62hs5s4n2b3" path="res://addons/godot-xr-tools/hands/animations/left/Grip 4.res" id="3_xyohi"]
|
|
||||||
[ext_resource type="Script" uid="uid://dvobm6vcfnqe8" path="res://addons/godot-xr-tools/hands/poses/hand_pose_settings.gd" id="4_4iajw"]
|
|
||||||
[ext_resource type="PackedScene" uid="uid://ctw7nbntd5pcj" path="res://addons/godot-xr-tools/objects/grab_points/grab_point_hand_right.tscn" id="5_kni1i"]
|
|
||||||
[ext_resource type="Animation" uid="uid://d1xnpyc08njjx" path="res://addons/godot-xr-tools/hands/animations/right/Grip 4.res" id="6_b3is5"]
|
|
||||||
[ext_resource type="Script" uid="uid://bwd0pe2udb5xo" path="res://Net/net_pickable.gd" id="8_2ao4o"]
|
|
||||||
|
|
||||||
[sub_resource type="CylinderShape3D" id="CylinderShape3D_fco8w"]
|
[sub_resource type="CylinderShape3D" id="CylinderShape3D_fco8w"]
|
||||||
height = 0.29805934
|
height = 0.29805934
|
||||||
radius = 0.025390625
|
radius = 0.025390625
|
||||||
|
|
||||||
[sub_resource type="BoxShape3D" id="BoxShape3D_vlqg6"]
|
|
||||||
size = Vector3(0.01, 0.062841795, 0.18769531)
|
|
||||||
|
|
||||||
[sub_resource type="Resource" id="Resource_lc22d"]
|
|
||||||
script = ExtResource("4_4iajw")
|
|
||||||
closed_pose = ExtResource("3_xyohi")
|
|
||||||
metadata/_custom_type_script = "uid://dvobm6vcfnqe8"
|
|
||||||
|
|
||||||
[sub_resource type="Resource" id="Resource_qyiot"]
|
|
||||||
script = ExtResource("4_4iajw")
|
|
||||||
closed_pose = ExtResource("6_b3is5")
|
|
||||||
metadata/_custom_type_script = "uid://dvobm6vcfnqe8"
|
|
||||||
|
|
||||||
[sub_resource type="SceneReplicationConfig" id="SceneReplicationConfig_np_burger"]
|
|
||||||
properties/0/path = NodePath(".:position")
|
|
||||||
properties/0/spawn = false
|
|
||||||
properties/0/replication_mode = 1
|
|
||||||
properties/1/path = NodePath(".:quaternion")
|
|
||||||
properties/1/spawn = false
|
|
||||||
properties/1/replication_mode = 1
|
|
||||||
properties/2/path = NodePath("NetPickable:net_held_by")
|
|
||||||
properties/2/spawn = true
|
|
||||||
properties/2/replication_mode = 1
|
|
||||||
|
|
||||||
[sub_resource type="Gradient" id="Gradient_s6exe"]
|
[sub_resource type="Gradient" id="Gradient_s6exe"]
|
||||||
interpolation_mode = 2
|
interpolation_mode = 2
|
||||||
offsets = PackedFloat32Array(0.0088495575, 0.76106197)
|
offsets = PackedFloat32Array(0.0088495575, 0.76106197)
|
||||||
@@ -57,67 +27,60 @@ albedo_color = Color(0.6, 0.6, 0.6, 1)
|
|||||||
metallic = 1.0
|
metallic = 1.0
|
||||||
metallic_specular = 1.0
|
metallic_specular = 1.0
|
||||||
|
|
||||||
[node name="Knife" unique_id=1675596942 groups=["chopping_tool"] instance=ExtResource("1_apu43")]
|
[sub_resource type="BoxShape3D" id="BoxShape3D_vlqg6"]
|
||||||
second_hand_grab = 1
|
size = Vector3(0.01, 0.062841795, 0.18769531)
|
||||||
|
|
||||||
|
[node name="Knife" unique_id=1675596942 groups=["chopping_tool"] instance=ExtResource("1_food_item")]
|
||||||
|
|
||||||
[node name="CollisionShape3D" parent="." index="0"]
|
[node name="CollisionShape3D" parent="." index="0"]
|
||||||
transform = Transform3D(1, 0, 0, 0, -4.371139e-08, -1, 0, 1, -4.371139e-08, 0, 2.8164342e-09, -0.0644325)
|
transform = Transform3D(1, 0, 0, 0, -4.371139e-08, -1, 0, 1, -4.371139e-08, 0, 2.8164342e-09, -0.0644325)
|
||||||
shape = SubResource("CylinderShape3D_fco8w")
|
shape = SubResource("CylinderShape3D_fco8w")
|
||||||
|
|
||||||
[node name="Area3D" type="Area3D" parent="." index="1" unique_id=1995926098 groups=["chopping_tool"]]
|
[node name="GrabPointHandLeft" parent="." index="1" unique_id=1571481674]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -0.05011083)
|
|
||||||
collision_layer = 513
|
|
||||||
collision_mask = 0
|
|
||||||
|
|
||||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="Area3D" index="0" unique_id=1593629505]
|
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.018579103, -0.1395939)
|
|
||||||
shape = SubResource("BoxShape3D_vlqg6")
|
|
||||||
|
|
||||||
[node name="GrabPointHandLeft" parent="." index="2" unique_id=1571481674 instance=ExtResource("2_ti0k8")]
|
|
||||||
transform = Transform3D(1, 0, 0, 0, 0.80581045, 0.5921736, 0, -0.5921736, 0.80581045, -0.0055686757, -0.027660534, -0.06972287)
|
transform = Transform3D(1, 0, 0, 0, 0.80581045, 0.5921736, 0, -0.5921736, 0.80581045, -0.0055686757, -0.027660534, -0.06972287)
|
||||||
hand_pose = SubResource("Resource_lc22d")
|
|
||||||
|
|
||||||
[node name="GrabPointHandRight" parent="." index="3" unique_id=514404634 instance=ExtResource("5_kni1i")]
|
[node name="GrabPointHandRight" parent="." index="2" unique_id=514404634]
|
||||||
transform = Transform3D(1, 0, 0, 0, 0.7906625, 0.6122523, 0, -0.6122523, 0.7906625, -0.00973678, -0.036154382, -0.07772979)
|
transform = Transform3D(1, 0, 0, 0, 0.7906625, 0.6122523, 0, -0.6122523, 0.7906625, -0.00973678, -0.036154382, -0.07772979)
|
||||||
hand_pose = SubResource("Resource_qyiot")
|
|
||||||
|
|
||||||
[node name="NetPickable" type="MultiplayerSynchronizer" parent="." index="4" unique_id=1382968688]
|
[node name="DespawningItem" parent="." index="5" unique_id=303090111]
|
||||||
replication_config = SubResource("SceneReplicationConfig_np_burger")
|
enabled = false
|
||||||
script = ExtResource("8_2ao4o")
|
|
||||||
|
|
||||||
[node name="CSGCombiner3D" type="CSGCombiner3D" parent="." index="5" unique_id=1632388374]
|
[node name="CombinableItem" parent="." index="6" unique_id=996936271]
|
||||||
|
enabled = false
|
||||||
|
|
||||||
|
[node name="CSGCombiner3D" type="CSGCombiner3D" parent="Model" parent_id_path=PackedInt32Array(1015960306) index="0" unique_id=1632388374]
|
||||||
transform = Transform3D(0.45, 0, 0, 0, 0.45, 0, 0, 0, 0.45, 0, 0, 0)
|
transform = Transform3D(0.45, 0, 0, 0, 0.45, 0, 0, 0, 0.45, 0, 0, 0)
|
||||||
|
|
||||||
[node name="CSGCylinder3D" type="CSGCylinder3D" parent="CSGCombiner3D" index="0" unique_id=73312047]
|
[node name="CSGCylinder3D" type="CSGCylinder3D" parent="Model/CSGCombiner3D" index="0" unique_id=73312047]
|
||||||
transform = Transform3D(1, 0, 0, 0, -4.371139e-08, 1, 0, -1, -4.371139e-08, 0, 1.9443882e-09, 0.044482417)
|
transform = Transform3D(1, 0, 0, 0, -4.371139e-08, 1, 0, -1, -4.371139e-08, 0, 1.9443882e-09, 0.044482417)
|
||||||
radius = 0.05
|
radius = 0.05
|
||||||
height = 0.28896484
|
height = 0.28896484
|
||||||
sides = 16
|
sides = 16
|
||||||
material = SubResource("StandardMaterial3D_24d3s")
|
material = SubResource("StandardMaterial3D_24d3s")
|
||||||
|
|
||||||
[node name="CSGBox3D2" type="CSGBox3D" parent="CSGCombiner3D/CSGCylinder3D" index="0" unique_id=1092536616]
|
[node name="CSGBox3D2" type="CSGBox3D" parent="Model/CSGCombiner3D/CSGCylinder3D" index="0" unique_id=1092536616]
|
||||||
transform = Transform3D(1, 0, 0, 0, -4.3711392e-08, -1, 0, 1, -4.3711392e-08, -0.06291181, -0.003074348, 0.003173826)
|
transform = Transform3D(1, 0, 0, 0, -4.3711392e-08, -1, 0, 1, -4.3711392e-08, -0.06291181, -0.003074348, 0.003173826)
|
||||||
operation = 2
|
operation = 2
|
||||||
size = Vector3(0.06698901, 0.08496094, 0.3070221)
|
size = Vector3(0.06698901, 0.08496094, 0.3070221)
|
||||||
material = SubResource("StandardMaterial3D_24d3s")
|
material = SubResource("StandardMaterial3D_24d3s")
|
||||||
|
|
||||||
[node name="CSGBox3D3" type="CSGBox3D" parent="CSGCombiner3D/CSGCylinder3D" index="1" unique_id=611507380]
|
[node name="CSGBox3D3" type="CSGBox3D" parent="Model/CSGCombiner3D/CSGCylinder3D" index="1" unique_id=611507380]
|
||||||
transform = Transform3D(1, 0, 0, 0, -4.3711392e-08, -1, 0, 1, -4.3711392e-08, 0.057669085, -0.00014465302, 0.003173826)
|
transform = Transform3D(1, 0, 0, 0, -4.3711392e-08, -1, 0, 1, -4.3711392e-08, 0.057669085, -0.00014465302, 0.003173826)
|
||||||
operation = 2
|
operation = 2
|
||||||
size = Vector3(0.051974364, 0.08496094, 0.30897522)
|
size = Vector3(0.051974364, 0.08496094, 0.30897522)
|
||||||
material = SubResource("StandardMaterial3D_24d3s")
|
material = SubResource("StandardMaterial3D_24d3s")
|
||||||
|
|
||||||
[node name="CSGCylinder3D2" type="CSGCylinder3D" parent="CSGCombiner3D/CSGCylinder3D" index="2" unique_id=1981876218]
|
[node name="CSGCylinder3D2" type="CSGCylinder3D" parent="Model/CSGCombiner3D/CSGCylinder3D" index="2" unique_id=1981876218]
|
||||||
transform = Transform3D(-4.3711392e-08, 1, 0, 4.3711392e-08, 1.9106857e-15, -1, -1, -4.3711392e-08, -4.3711392e-08, 0.0014698628, 0.062123798, 0.00029686643)
|
transform = Transform3D(-4.3711392e-08, 1, 0, 4.3711392e-08, 1.9106857e-15, -1, -1, -4.3711392e-08, -4.3711392e-08, 0.0014698628, 0.062123798, 0.00029686643)
|
||||||
radius = 0.016
|
radius = 0.016
|
||||||
height = 0.06318359
|
height = 0.06318359
|
||||||
|
|
||||||
[node name="CSGCylinder3D3" type="CSGCylinder3D" parent="CSGCombiner3D/CSGCylinder3D" index="3" unique_id=1905314362]
|
[node name="CSGCylinder3D3" type="CSGCylinder3D" parent="Model/CSGCombiner3D/CSGCylinder3D" index="3" unique_id=1905314362]
|
||||||
transform = Transform3D(-4.3711392e-08, 1, 0, 4.3711392e-08, 1.9106857e-15, -1, -1, -4.3711392e-08, -4.3711392e-08, 0.0014698628, -0.049634382, 0.00029686154)
|
transform = Transform3D(-4.3711392e-08, 1, 0, 4.3711392e-08, 1.9106857e-15, -1, -1, -4.3711392e-08, -4.3711392e-08, 0.0014698628, -0.049634382, 0.00029686154)
|
||||||
radius = 0.016
|
radius = 0.016
|
||||||
height = 0.06318359
|
height = 0.06318359
|
||||||
|
|
||||||
[node name="CSGCylinder3D4" type="CSGCylinder3D" parent="CSGCombiner3D/CSGCylinder3D" index="4" unique_id=905243368]
|
[node name="CSGCylinder3D4" type="CSGCylinder3D" parent="Model/CSGCombiner3D/CSGCylinder3D" index="4" unique_id=905243368]
|
||||||
transform = Transform3D(-6.070399e-08, 1, 0, 1.3887457, 4.3711392e-08, 8.7422784e-08, 1.21408e-07, 3.8213714e-15, -1, 0.0017506231, -0.10254226, -0.07109782)
|
transform = Transform3D(-6.070399e-08, 1, 0, 1.3887457, 4.3711392e-08, 8.7422784e-08, 1.21408e-07, 3.8213714e-15, -1, 0.0017506231, -0.10254226, -0.07109782)
|
||||||
operation = 2
|
operation = 2
|
||||||
radius = 0.032226563
|
radius = 0.032226563
|
||||||
@@ -125,7 +88,7 @@ height = 0.07854004
|
|||||||
sides = 32
|
sides = 32
|
||||||
material = SubResource("StandardMaterial3D_24d3s")
|
material = SubResource("StandardMaterial3D_24d3s")
|
||||||
|
|
||||||
[node name="CSGCylinder3D5" type="CSGCylinder3D" parent="CSGCombiner3D/CSGCylinder3D" index="5" unique_id=1873534320]
|
[node name="CSGCylinder3D5" type="CSGCylinder3D" parent="Model/CSGCombiner3D/CSGCylinder3D" index="5" unique_id=1873534320]
|
||||||
transform = Transform3D(-1.0240791e-07, 1, 0, 2.34282, 4.3711392e-08, 8.7422784e-08, 2.0481582e-07, 3.8213714e-15, -1, 0.0017506231, 0.089636564, -0.07143875)
|
transform = Transform3D(-1.0240791e-07, 1, 0, 2.34282, 4.3711392e-08, 8.7422784e-08, 2.0481582e-07, 3.8213714e-15, -1, 0.0017506231, 0.089636564, -0.07143875)
|
||||||
operation = 2
|
operation = 2
|
||||||
radius = 0.032226563
|
radius = 0.032226563
|
||||||
@@ -133,7 +96,7 @@ height = 0.07854004
|
|||||||
sides = 32
|
sides = 32
|
||||||
material = SubResource("StandardMaterial3D_24d3s")
|
material = SubResource("StandardMaterial3D_24d3s")
|
||||||
|
|
||||||
[node name="CSGCylinder3D6" type="CSGCylinder3D" parent="CSGCombiner3D/CSGCylinder3D" index="6" unique_id=471254428]
|
[node name="CSGCylinder3D6" type="CSGCylinder3D" parent="Model/CSGCombiner3D/CSGCylinder3D" index="6" unique_id=471254428]
|
||||||
transform = Transform3D(-1.0240791e-07, 1, 0, 2.34282, 4.3711392e-08, 8.7422784e-08, 2.0481582e-07, 3.8213714e-15, -1, 0.0017506231, -0.079547666, -0.07143876)
|
transform = Transform3D(-1.0240791e-07, 1, 0, 2.34282, 4.3711392e-08, 8.7422784e-08, 2.0481582e-07, 3.8213714e-15, -1, 0.0017506231, -0.079547666, -0.07143876)
|
||||||
operation = 2
|
operation = 2
|
||||||
radius = 0.032226563
|
radius = 0.032226563
|
||||||
@@ -141,18 +104,27 @@ height = 0.07854004
|
|||||||
sides = 32
|
sides = 32
|
||||||
material = SubResource("StandardMaterial3D_24d3s")
|
material = SubResource("StandardMaterial3D_24d3s")
|
||||||
|
|
||||||
[node name="CSGBox3DBlade" type="CSGBox3D" parent="CSGCombiner3D" index="1" unique_id=94519802]
|
[node name="CSGBox3DBlade" type="CSGBox3D" parent="Model/CSGCombiner3D" index="1" unique_id=94519802]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.005445559, -0.18191797)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.005445559, -0.18191797)
|
||||||
size = Vector3(0.007, 0.08954346, 0.6364492)
|
size = Vector3(0.007, 0.08954346, 0.6364492)
|
||||||
material = SubResource("StandardMaterial3D_vlqg6")
|
material = SubResource("StandardMaterial3D_vlqg6")
|
||||||
|
|
||||||
[node name="CSGTorus3D" type="CSGTorus3D" parent="CSGCombiner3D/CSGBox3DBlade" index="0" unique_id=555698965]
|
[node name="CSGTorus3D" type="CSGTorus3D" parent="Model/CSGCombiner3D/CSGBox3DBlade" index="0" unique_id=555698965]
|
||||||
transform = Transform3D(-4.3711392e-08, 1, 0, -1, -4.3711392e-08, 0, 0, 0, 0.90598416, 0, 0.25891897, -0.12508947)
|
transform = Transform3D(-4.3711392e-08, 1, 0, -1, -4.3711392e-08, 0, 0, 0, 0.90598416, 0, 0.25891897, -0.12508947)
|
||||||
operation = 2
|
operation = 2
|
||||||
outer_radius = 0.3
|
outer_radius = 0.3
|
||||||
sides = 64
|
sides = 64
|
||||||
|
|
||||||
[node name="CSGBox3D5" type="CSGBox3D" parent="CSGCombiner3D/CSGBox3DBlade/CSGTorus3D" index="0" unique_id=720590378]
|
[node name="CSGBox3D5" type="CSGBox3D" parent="Model/CSGCombiner3D/CSGBox3DBlade/CSGTorus3D" index="0" unique_id=720590378]
|
||||||
transform = Transform3D(-4.3710607e-08, -0.9973613, 0.0724587, 0.99998987, -4.3595673e-08, 3.1672265e-09, 0, 0.034851935, 0.47972566, 0.25730363, -0.003919763, 0.23939973)
|
transform = Transform3D(-4.3710607e-08, -0.9973613, 0.0724587, 0.99998987, -4.3595673e-08, 3.1672265e-09, 0, 0.034851935, 0.47972566, 0.25730363, -0.003919763, 0.23939973)
|
||||||
operation = 2
|
operation = 2
|
||||||
size = Vector3(0.40247935, 0.2781372, 0.97288764)
|
size = Vector3(0.40247935, 0.2781372, 0.97288764)
|
||||||
|
|
||||||
|
[node name="Area3D" type="Area3D" parent="." index="9" unique_id=1995926098 groups=["chopping_tool"]]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -0.05011083)
|
||||||
|
collision_layer = 513
|
||||||
|
collision_mask = 0
|
||||||
|
|
||||||
|
[node name="CollisionShape3D" type="CollisionShape3D" parent="Area3D" index="0" unique_id=1593629505]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.018579103, -0.1395939)
|
||||||
|
shape = SubResource("BoxShape3D_vlqg6")
|
||||||
|
|||||||
+10
-45
@@ -1,78 +1,43 @@
|
|||||||
[gd_scene format=3 uid="uid://drwuhqb3pjtiy"]
|
[gd_scene format=3 uid="uid://drwuhqb3pjtiy"]
|
||||||
|
|
||||||
[ext_resource type="PackedScene" uid="uid://c8l60rnugru40" path="res://addons/godot-xr-tools/objects/pickable.tscn" id="1_wihyv"]
|
[ext_resource type="PackedScene" uid="uid://d8jo0402pgl6" path="res://abstract/food_item.tscn" id="1_food_item"]
|
||||||
[ext_resource type="PackedScene" uid="uid://c25yxb0vt53vc" path="res://addons/godot-xr-tools/objects/grab_points/grab_point_hand_left.tscn" id="3_a8yvn"]
|
|
||||||
[ext_resource type="Animation" uid="uid://db62hs5s4n2b3" path="res://addons/godot-xr-tools/hands/animations/left/Grip 4.res" id="4_d124x"]
|
|
||||||
[ext_resource type="Script" uid="uid://dvobm6vcfnqe8" path="res://addons/godot-xr-tools/hands/poses/hand_pose_settings.gd" id="5_7epdb"]
|
|
||||||
[ext_resource type="PackedScene" uid="uid://ctw7nbntd5pcj" path="res://addons/godot-xr-tools/objects/grab_points/grab_point_hand_right.tscn" id="6_14hae"]
|
|
||||||
[ext_resource type="Animation" uid="uid://d1xnpyc08njjx" path="res://addons/godot-xr-tools/hands/animations/right/Grip 4.res" id="7_hkms5"]
|
|
||||||
[ext_resource type="PackedScene" uid="uid://bfj80jh13t6e5" path="res://prefabs/food_item.tscn" id="8_35g7i"]
|
|
||||||
[ext_resource type="Script" uid="uid://bwd0pe2udb5xo" path="res://Net/net_pickable.gd" id="9_x0uku"]
|
|
||||||
[ext_resource type="PackedScene" uid="uid://b5ukku8i0hilb" path="res://prefabs/despawning_item.tscn" id="10_fj22u"]
|
|
||||||
|
|
||||||
[sub_resource type="CylinderShape3D" id="CylinderShape3D_fco8w"]
|
[sub_resource type="CylinderShape3D" id="CylinderShape3D_fco8w"]
|
||||||
height = 0.16196387
|
height = 0.16196387
|
||||||
radius = 0.07080078
|
radius = 0.07080078
|
||||||
|
|
||||||
[sub_resource type="Resource" id="Resource_lc22d"]
|
|
||||||
script = ExtResource("5_7epdb")
|
|
||||||
closed_pose = ExtResource("4_d124x")
|
|
||||||
metadata/_custom_type_script = "uid://dvobm6vcfnqe8"
|
|
||||||
|
|
||||||
[sub_resource type="Resource" id="Resource_qyiot"]
|
|
||||||
script = ExtResource("5_7epdb")
|
|
||||||
closed_pose = ExtResource("7_hkms5")
|
|
||||||
metadata/_custom_type_script = "uid://dvobm6vcfnqe8"
|
|
||||||
|
|
||||||
[sub_resource type="SceneReplicationConfig" id="SceneReplicationConfig_np_burger"]
|
|
||||||
properties/0/path = NodePath(".:position")
|
|
||||||
properties/0/spawn = false
|
|
||||||
properties/0/replication_mode = 1
|
|
||||||
properties/1/path = NodePath(".:quaternion")
|
|
||||||
properties/1/spawn = false
|
|
||||||
properties/1/replication_mode = 1
|
|
||||||
properties/2/path = NodePath("NetPickable:net_held_by")
|
|
||||||
properties/2/spawn = true
|
|
||||||
properties/2/replication_mode = 1
|
|
||||||
|
|
||||||
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_d4wpw"]
|
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_d4wpw"]
|
||||||
albedo_color = Color(0.48, 0.34336, 0.1872, 1)
|
albedo_color = Color(0.48, 0.34336, 0.1872, 1)
|
||||||
|
|
||||||
[node name="Potato" unique_id=1675596942 instance=ExtResource("1_wihyv")]
|
[node name="Potato" unique_id=1675596942 instance=ExtResource("1_food_item")]
|
||||||
second_hand_grab = 1
|
|
||||||
|
|
||||||
[node name="CollisionShape3D" parent="." index="0"]
|
[node name="CollisionShape3D" parent="." index="0"]
|
||||||
transform = Transform3D(1, 0, 0, 0, -4.371139e-08, -1, 0, 1, -4.371139e-08, 0, 1.2261836e-10, -0.0028051808)
|
transform = Transform3D(1, 0, 0, 0, -4.371139e-08, -1, 0, 1, -4.371139e-08, 0, 1.2261836e-10, -0.0028051808)
|
||||||
shape = SubResource("CylinderShape3D_fco8w")
|
shape = SubResource("CylinderShape3D_fco8w")
|
||||||
|
|
||||||
[node name="GrabPointHandLeft" parent="." index="1" unique_id=1571481674 instance=ExtResource("3_a8yvn")]
|
[node name="GrabPointHandLeft" parent="." index="1"]
|
||||||
transform = Transform3D(1, 0, 0, 0, -0.5343598, -0.84525716, 0, 0.84525716, -0.5343598, -0.03287975, 0.03671424, 0.10207943)
|
transform = Transform3D(1, 0, 0, 0, -0.5343598, -0.84525716, 0, 0.84525716, -0.5343598, -0.03287975, 0.03671424, 0.10207943)
|
||||||
hand_pose = SubResource("Resource_lc22d")
|
|
||||||
|
|
||||||
[node name="GrabPointHandRight" parent="." index="2" unique_id=514404634 instance=ExtResource("6_14hae")]
|
[node name="GrabPointHandRight" parent="." index="2"]
|
||||||
transform = Transform3D(1, 0, 0, 0, -0.7457213, -0.66625804, 0, 0.66625804, -0.7457213, 0.03408891, 0.014529038, 0.10517749)
|
transform = Transform3D(1, 0, 0, 0, -0.7457213, -0.66625804, 0, 0.66625804, -0.7457213, 0.03408891, 0.014529038, 0.10517749)
|
||||||
hand_pose = SubResource("Resource_qyiot")
|
|
||||||
|
|
||||||
[node name="FoodItem" parent="." index="3" unique_id=63948206 instance=ExtResource("8_35g7i")]
|
[node name="FoodItem" parent="." index="3"]
|
||||||
id = "potato"
|
id = "potato"
|
||||||
type = 2
|
type = 2
|
||||||
sell_value = 0
|
sell_value = 0
|
||||||
|
|
||||||
[node name="NetPickable" type="MultiplayerSynchronizer" parent="." index="4" unique_id=1382968688]
|
[node name="CombinableItem" parent="." index="8"]
|
||||||
replication_config = SubResource("SceneReplicationConfig_np_burger")
|
enabled = false
|
||||||
script = ExtResource("9_x0uku")
|
|
||||||
|
|
||||||
[node name="DespawningItem" parent="." index="5" unique_id=303090111 instance=ExtResource("10_fj22u")]
|
[node name="CSGCombiner3DPotato" type="CSGCombiner3D" parent="Model" index="0" unique_id=1632388374]
|
||||||
|
|
||||||
[node name="CSGCombiner3DPotato" type="CSGCombiner3D" parent="." index="6" unique_id=1632388374]
|
[node name="CSGSphere3D" type="CSGSphere3D" parent="Model/CSGCombiner3DPotato" index="0" unique_id=125051486]
|
||||||
|
|
||||||
[node name="CSGSphere3D" type="CSGSphere3D" parent="CSGCombiner3DPotato" index="0" unique_id=125051486]
|
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -0.03307341)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -0.03307341)
|
||||||
radius = 0.06
|
radius = 0.06
|
||||||
radial_segments = 32
|
radial_segments = 32
|
||||||
material = SubResource("StandardMaterial3D_d4wpw")
|
material = SubResource("StandardMaterial3D_d4wpw")
|
||||||
|
|
||||||
[node name="CSGSphere3D2" type="CSGSphere3D" parent="CSGCombiner3DPotato" index="1" unique_id=837168454]
|
[node name="CSGSphere3D2" type="CSGSphere3D" parent="Model/CSGCombiner3DPotato" index="1" unique_id=837168454]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0.03243477)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0.03243477)
|
||||||
radius = 0.053
|
radius = 0.053
|
||||||
radial_segments = 32
|
radial_segments = 32
|
||||||
|
|||||||
@@ -68,7 +68,6 @@ func _exit_tree() -> void:
|
|||||||
|
|
||||||
|
|
||||||
func _on_session_started(_is_server: bool) -> void:
|
func _on_session_started(_is_server: bool) -> void:
|
||||||
NetworkManager.gate_existing_stations()
|
|
||||||
_populate_world_if_owner()
|
_populate_world_if_owner()
|
||||||
|
|
||||||
|
|
||||||
@@ -104,10 +103,14 @@ func _populate_world_if_owner() -> void:
|
|||||||
layout.queue_free()
|
layout.queue_free()
|
||||||
_remove_authored(authored)
|
_remove_authored(authored)
|
||||||
NetworkManager.log_line("Populating world: %d stations, %d items" % [stations.size(), items.size()])
|
NetworkManager.log_line("Populating world: %d stations, %d items" % [stations.size(), items.size()])
|
||||||
|
# One frame between spawns - MultiplayerSpawner corrupts replication when
|
||||||
|
# several nodes register for sync in the same frame (godotengine/godot#96914).
|
||||||
for d in stations:
|
for d in stations:
|
||||||
NetworkManager.spawn_item(d["scene"], d["xform"], d["name"], d["props"])
|
NetworkManager.spawn_item(d["scene"], d["xform"], d["name"], d["props"])
|
||||||
|
await get_tree().process_frame
|
||||||
for d in items:
|
for d in items:
|
||||||
NetworkManager.spawn_item(d["scene"], d["xform"], d["name"], d["props"])
|
NetworkManager.spawn_item(d["scene"], d["xform"], d["name"], d["props"])
|
||||||
|
await get_tree().process_frame
|
||||||
NetworkManager.log_line("World populated")
|
NetworkManager.log_line("World populated")
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+41
-6
@@ -24,6 +24,12 @@ var _original_freeze_mode: RigidBody3D.FreezeMode
|
|||||||
# branch of apply_held_state() clears while someone else is holding the item.
|
# branch of apply_held_state() clears while someone else is holding the item.
|
||||||
var _original_enabled: bool
|
var _original_enabled: bool
|
||||||
|
|
||||||
|
# Intent set by external game logic (e.g. a station enabling/disabling a tool),
|
||||||
|
# independent of hold state. apply_held_state() is the sole writer of the
|
||||||
|
# pickable's actual `enabled` property, so this is how other systems express
|
||||||
|
# "should be enabled" without fighting that reconciliation every tick.
|
||||||
|
var _tool_enabled: bool = true
|
||||||
|
|
||||||
# Whether the "our own hand still holds this" guard has already been logged for
|
# Whether the "our own hand still holds this" guard has already been logged for
|
||||||
# the current grab. apply_held_state() runs every network tick, so without this
|
# the current grab. apply_held_state() runs every network tick, so without this
|
||||||
# the guard message repeats for as long as you hold the item.
|
# the guard message repeats for as long as you hold the item.
|
||||||
@@ -33,8 +39,24 @@ var _grab_race_logged := false
|
|||||||
func _ready() -> void:
|
func _ready() -> void:
|
||||||
_pickable = get_parent() as XRToolsPickable
|
_pickable = get_parent() as XRToolsPickable
|
||||||
if not _pickable:
|
if not _pickable:
|
||||||
push_error("NetPickable must be a child of an XRToolsPickable")
|
SweetLogger.error("{0} must be a child of an XRToolsPickable", [name])
|
||||||
return
|
return
|
||||||
|
|
||||||
|
# Configure Multiplayer Synchronizer
|
||||||
|
# This overwrites any changes made in the inspector.
|
||||||
|
replication_config = SceneReplicationConfig.new()
|
||||||
|
var properties: Array[NodePath] = [".:position", ".:quaternion", ".:enabled", ".:visible"]
|
||||||
|
for property_path in properties:
|
||||||
|
replication_config.add_property(property_path)
|
||||||
|
replication_config.property_set_replication_mode(property_path, SceneReplicationConfig.REPLICATION_MODE_ALWAYS)
|
||||||
|
replication_config.property_set_spawn(property_path, false)
|
||||||
|
# Unlike the properties above, this one is replicated at spawn too, so a
|
||||||
|
# late joiner sees the current holder immediately.
|
||||||
|
var held_by_path := NodePath("NetPickable:net_held_by")
|
||||||
|
replication_config.add_property(held_by_path)
|
||||||
|
replication_config.property_set_replication_mode(held_by_path, SceneReplicationConfig.REPLICATION_MODE_ALWAYS)
|
||||||
|
replication_config.property_set_spawn(held_by_path, true)
|
||||||
|
|
||||||
_original_freeze_mode = _pickable.freeze_mode
|
_original_freeze_mode = _pickable.freeze_mode
|
||||||
_original_enabled = _pickable.enabled
|
_original_enabled = _pickable.enabled
|
||||||
_pickable.picked_up.connect(_on_picked_up)
|
_pickable.picked_up.connect(_on_picked_up)
|
||||||
@@ -47,6 +69,17 @@ func _ready() -> void:
|
|||||||
apply_held_state.call_deferred()
|
apply_held_state.call_deferred()
|
||||||
|
|
||||||
|
|
||||||
|
## Called by external game logic (e.g. Counter._enable_tool/_disable_tool) to
|
||||||
|
## express whether this item should be usable right now, independent of hold
|
||||||
|
## state. Reapplies immediately so the change takes effect without waiting for
|
||||||
|
## the next net_held_by tick.
|
||||||
|
func set_tool_enabled(value: bool) -> void:
|
||||||
|
if _tool_enabled == value:
|
||||||
|
return
|
||||||
|
_tool_enabled = value
|
||||||
|
apply_held_state()
|
||||||
|
|
||||||
|
|
||||||
func _set_net_held_by(value: int) -> void:
|
func _set_net_held_by(value: int) -> void:
|
||||||
var old := net_held_by
|
var old := net_held_by
|
||||||
net_held_by = value
|
net_held_by = value
|
||||||
@@ -95,10 +128,11 @@ func apply_held_state() -> void:
|
|||||||
# e.g. a plate still got marked dirty) while pick_up() bailed out on
|
# e.g. a plate still got marked dirty) while pick_up() bailed out on
|
||||||
# the disabled item, leaving the zone holding an item with no grab
|
# the disabled item, leaving the zone holding an item with no grab
|
||||||
# driver that then fell out of the station.
|
# driver that then fell out of the station.
|
||||||
if _pickable.enabled != _original_enabled:
|
var want_enabled_authority := _original_enabled and _tool_enabled
|
||||||
|
if _pickable.enabled != want_enabled_authority:
|
||||||
if NetworkManager.is_online():
|
if NetworkManager.is_online():
|
||||||
SweetLogger.debug("{0}: reclaiming ownership, restoring enabled {1}->{2}", [_pickable.name, _pickable.enabled, _original_enabled])
|
SweetLogger.debug("{0}: reclaiming ownership, restoring enabled {1}->{2}", [_pickable.name, _pickable.enabled, want_enabled_authority])
|
||||||
_pickable.enabled = _original_enabled
|
_pickable.enabled = want_enabled_authority
|
||||||
return
|
return
|
||||||
# A net_held_by/position sync update can race ahead of the
|
# A net_held_by/position sync update can race ahead of the
|
||||||
# authority-handoff RPC that's about to confirm a grab we just made
|
# authority-handoff RPC that's about to confirm a grab we just made
|
||||||
@@ -116,7 +150,8 @@ func apply_held_state() -> void:
|
|||||||
# Someone else owns it: stop simulating locally, just follow the sync.
|
# Someone else owns it: stop simulating locally, just follow the sync.
|
||||||
if _pickable.is_picked_up():
|
if _pickable.is_picked_up():
|
||||||
if NetworkManager.is_online():
|
if NetworkManager.is_online():
|
||||||
SweetLogger.debug("{0}: was held by {1} on this peer, but authority now says peer {2} owns it — force-dropping", [_pickable.name, _holder_desc(), net_held_by])
|
# Jon's note: When we get this warning, it usually mean a client-side snapzone is not disabled, and is fighting the server over the item.
|
||||||
|
SweetLogger.warning("{0}: was held by {1} on this peer, but authority now says peer {2} owns it — force-dropping", [_pickable.name, _holder_desc(), net_held_by])
|
||||||
_pickable.drop()
|
_pickable.drop()
|
||||||
# Bail out when we're already in the follow-the-sync state. Without this the
|
# Bail out when we're already in the follow-the-sync state. Without this the
|
||||||
# writes below (and the line logged with them) repeated every tick for every
|
# writes below (and the line logged with them) repeated every tick for every
|
||||||
@@ -124,7 +159,7 @@ func apply_held_state() -> void:
|
|||||||
# physics-property writes per item per tick. The comparison also means we
|
# physics-property writes per item per tick. The comparison also means we
|
||||||
# still re-apply if something else perturbs the state (e.g. let_go()
|
# still re-apply if something else perturbs the state (e.g. let_go()
|
||||||
# restoring the collision mask after a force-drop).
|
# restoring the collision mask after a force-drop).
|
||||||
var want_enabled := (net_held_by == 0)
|
var want_enabled := (net_held_by == 0) and _tool_enabled
|
||||||
if _pickable.freeze \
|
if _pickable.freeze \
|
||||||
and _pickable.freeze_mode == RigidBody3D.FREEZE_MODE_KINEMATIC \
|
and _pickable.freeze_mode == RigidBody3D.FREEZE_MODE_KINEMATIC \
|
||||||
and _pickable.collision_mask == 0 \
|
and _pickable.collision_mask == 0 \
|
||||||
|
|||||||
+2
-72
@@ -154,7 +154,7 @@ func _despawn_static_item(path: NodePath) -> void:
|
|||||||
func _spawn_item_from_data(data: Variant) -> Node:
|
func _spawn_item_from_data(data: Variant) -> Node:
|
||||||
var scene: PackedScene = load(data["scene"])
|
var scene: PackedScene = load(data["scene"])
|
||||||
if not scene:
|
if not scene:
|
||||||
push_error("spawn_item: could not load scene %s" % str(data.get("scene")))
|
SweetLogger.error("Could not load scene {0}", [str(data.get("scene"))])
|
||||||
return null
|
return null
|
||||||
var inst := scene.instantiate()
|
var inst := scene.instantiate()
|
||||||
if inst is Node3D:
|
if inst is Node3D:
|
||||||
@@ -163,62 +163,8 @@ func _spawn_item_from_data(data: Variant) -> Node:
|
|||||||
inst.name = data["name"]
|
inst.name = data["name"]
|
||||||
for key in data.get("props", {}):
|
for key in data.get("props", {}):
|
||||||
inst.set(key, data["props"][key])
|
inst.set(key, data["props"][key])
|
||||||
if not owns_world():
|
|
||||||
_gate_station(inst)
|
|
||||||
# ...and again once the node is in the tree. Gating before _ready() is what
|
|
||||||
# keeps a station from ever ticking on a client, but a station's own
|
|
||||||
# _ready() runs afterwards and can undo it (table.gd re-arms its state
|
|
||||||
# machine with set_process(true)). The deferred pass runs after every
|
|
||||||
# _ready() in this frame and re-asserts the gate.
|
|
||||||
_gate_station.call_deferred(inst)
|
|
||||||
return inst
|
return inst
|
||||||
|
|
||||||
|
|
||||||
# Stations run their own logic and auto-grab (XRToolsSnapZone with
|
|
||||||
# snap_mode=RANGE) identically on every peer by default, which would let each
|
|
||||||
# peer independently grab/simulate the same shared object. Disable both on
|
|
||||||
# every peer except the one that owns world logic; the server-authoritative
|
|
||||||
# item-authority RPCs are what let clients still grab a server-held item by
|
|
||||||
# hand. Runs before the node enters the tree, so its own _ready() sees the
|
|
||||||
# final (disabled) state.
|
|
||||||
#
|
|
||||||
# Group contract (see also _station_snap_zones): "station" marks the body that
|
|
||||||
# runs the station's script, "station_zone" marks its snap zones. Station scenes
|
|
||||||
# wrap that body in a Node3D (for StationMovement), and spawn_item hands us that
|
|
||||||
# wrapper, so accept either and recurse — a type check on the node we're handed
|
|
||||||
# silently gated nothing for stations whose root isn't the body itself.
|
|
||||||
func _gate_station(node: Node) -> void:
|
|
||||||
if not node.is_in_group("station"):
|
|
||||||
for child in node.find_children("*", "", true, false):
|
|
||||||
if child.is_in_group("station"):
|
|
||||||
_gate_station(child)
|
|
||||||
return
|
|
||||||
# Only report a gate that actually changed something: this runs a second time
|
|
||||||
# (deferred) for every spawned station, and on a re-gate that found nothing to
|
|
||||||
# do there is nothing worth logging.
|
|
||||||
var changed := node.is_processing()
|
|
||||||
for zone in node.find_children("*", "XRToolsSnapZone", true, false):
|
|
||||||
changed = changed or zone.enabled or zone.is_processing()
|
|
||||||
zone.enabled = false
|
|
||||||
zone.set_process(false)
|
|
||||||
node.set_process(false)
|
|
||||||
if changed:
|
|
||||||
log_line("gated station (non-owner peer): %s" % node.name)
|
|
||||||
|
|
||||||
|
|
||||||
## Gate every station already sitting in the scene tree, for peers that don't
|
|
||||||
## own world logic. Stations that arrive through spawn_item() are gated as they
|
|
||||||
## are built (see _spawn_item_from_data), but ones baked into a scene file never
|
|
||||||
## pass through there — leaving a client running its own snap zones, which then
|
|
||||||
## grab items straight out of the local hand and fight the server's
|
|
||||||
## authoritative placement. Idempotent, so it's safe on every session start.
|
|
||||||
func gate_existing_stations() -> void:
|
|
||||||
if owns_world():
|
|
||||||
return
|
|
||||||
for station in get_tree().get_nodes_in_group("station"):
|
|
||||||
_gate_station(station)
|
|
||||||
|
|
||||||
|
|
||||||
# --- Item grab-authority transfer -----------------------------------------
|
# --- Item grab-authority transfer -----------------------------------------
|
||||||
|
|
||||||
## Called by NetPickable when this peer grabs an item by hand. Godot rejects
|
## Called by NetPickable when this peer grabs an item by hand. Godot rejects
|
||||||
@@ -420,22 +366,6 @@ func owns_world() -> bool:
|
|||||||
return not is_online() or is_server()
|
return not is_online() or is_server()
|
||||||
|
|
||||||
|
|
||||||
# --- Station work-progress seam -------------------------------------------
|
|
||||||
|
|
||||||
## Reusable entry point for a client to contribute work to a station (e.g. a
|
|
||||||
## future chopping/gesture station). The client detects the gesture locally and
|
|
||||||
## calls this; the server validates and accumulates. Timer-driven stations like
|
|
||||||
## the Hob don't need it, but it is the drop-in seam for input-driven ones.
|
|
||||||
@rpc("any_peer", "reliable")
|
|
||||||
func submit_work(station_path: NodePath, amount: float) -> void:
|
|
||||||
if not is_server():
|
|
||||||
return
|
|
||||||
var station := get_node_or_null(station_path)
|
|
||||||
if station and station.has_method("add_work"):
|
|
||||||
log_line("submit_work: peer %d contributed %.2f to %s" % [multiplayer.get_remote_sender_id(), amount, station.name])
|
|
||||||
station.add_work(multiplayer.get_remote_sender_id(), amount)
|
|
||||||
|
|
||||||
|
|
||||||
## Called by the world scene once it's ready, passing its spawners. Must run
|
## Called by the world scene once it's ready, passing its spawners. Must run
|
||||||
## before world_ready()/host()/join() on every peer so the custom spawn
|
## before world_ready()/host()/join() on every peer so the custom spawn
|
||||||
## function is installed before any spawn packet can arrive.
|
## function is installed before any spawn packet can arrive.
|
||||||
@@ -544,7 +474,7 @@ func _on_player_absent(peer_id: int) -> void:
|
|||||||
# --- Command-line driven test bootstrap -----------------------------------
|
# --- Command-line driven test bootstrap -----------------------------------
|
||||||
|
|
||||||
func _handle_cmdline() -> void:
|
func _handle_cmdline() -> void:
|
||||||
SweetLogger.info("Networkmanager _handle_cmdline()")
|
SweetLogger.debug("->[]")
|
||||||
var args := OS.get_cmdline_args()
|
var args := OS.get_cmdline_args()
|
||||||
if args.has("--server"):
|
if args.has("--server"):
|
||||||
log_line("cmdline: --server")
|
log_line("cmdline: --server")
|
||||||
|
|||||||
@@ -7,25 +7,46 @@ func _ready() -> void:
|
|||||||
|
|
||||||
|
|
||||||
func _on_game_state_changed(new_state: GameManager.GameState) -> void:
|
func _on_game_state_changed(new_state: GameManager.GameState) -> void:
|
||||||
SweetLogger.info("game_state_changed to {0}", [GameManager.GameState.keys()[new_state]], "build_mode_controller.gd", "_on_game_state_changed")
|
SweetLogger.info("Game state changed to {0}", [GameManager.GameState.keys()[new_state]], "build_mode_controller.gd", "_on_game_state_changed")
|
||||||
if new_state == GameManager.GameState.BUILDING:
|
if new_state == GameManager.GameState.BUILDING:
|
||||||
despawn_unheld_pickables()
|
despawn_unheld_pickables()
|
||||||
|
if not NetworkManager.owns_world():
|
||||||
|
return
|
||||||
|
if new_state == GameManager.GameState.BUILDING:
|
||||||
|
_set_stations_enabled(false)
|
||||||
|
elif new_state == GameManager.GameState.RUNNING:
|
||||||
|
_set_stations_enabled(true)
|
||||||
|
|
||||||
|
|
||||||
# Despawn all food_items unless it's in a "persistent_inventory" snap_zone
|
# Only single-snap_zone Station-derived stations use the generic `enabled`
|
||||||
|
# toggle here. Table is Station-derived too now (SharedInventoryStation), but
|
||||||
|
# it has multiple snap_zones and manages their enabling itself via its own
|
||||||
|
# FSM (_set_snap_zones_enabled) - toggling only the base `snap_zone` here
|
||||||
|
# would desync it from the rest of Table's zones, so it's excluded.
|
||||||
|
func _set_stations_enabled(value: bool) -> void:
|
||||||
|
for station in get_tree().get_nodes_in_group("station"):
|
||||||
|
if station is Station and not station is Table:
|
||||||
|
station.enabled = value
|
||||||
|
|
||||||
|
|
||||||
|
# Despawn all despawnable pickables unless it's in a "persistent_inventory"
|
||||||
|
# snap_zone. Permanent fixtures (e.g. a station's knife) opt out entirely by
|
||||||
|
# having no DespawningItem child, or a disabled one.
|
||||||
func despawn_unheld_pickables():
|
func despawn_unheld_pickables():
|
||||||
var root = get_tree().get_root()
|
var root = get_tree().get_root()
|
||||||
var pickables: Array[Node] = []
|
var pickables: Array[Node] = []
|
||||||
_collect_pickables(root, pickables)
|
_collect_pickables(root, pickables)
|
||||||
for pickable in pickables:
|
for pickable in pickables:
|
||||||
if not Helper.find_food_item(pickable):
|
var despawning_item := pickable.get_node_or_null("DespawningItem") as DespawningItem
|
||||||
|
if not despawning_item or not despawning_item.enabled:
|
||||||
continue
|
continue
|
||||||
var held_by: Node = pickable.get_picked_up_by()
|
var held_by: Node = pickable.get_picked_up_by()
|
||||||
if not held_by:
|
if not held_by:
|
||||||
NetworkManager.despawn_item(pickable)
|
NetworkManager.despawn_item(pickable)
|
||||||
continue
|
continue
|
||||||
if not held_by.is_in_group("persistent_inventory"):
|
if not held_by.is_in_group("persistent_inventory"):
|
||||||
SweetLogger.debug("despawn_unheld_pickables held_by: {0}, pickable: {1}", [held_by, pickable])
|
SweetLogger.debug("Despawn unheld pickable held_by: {0}, pickable: {1}", [held_by, pickable])
|
||||||
|
pickable.drop()
|
||||||
NetworkManager.despawn_item(pickable)
|
NetworkManager.despawn_item(pickable)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
class_name CombinableItem
|
class_name CombinableItem
|
||||||
extends Node
|
extends Node
|
||||||
|
|
||||||
|
@export var enabled: bool = true
|
||||||
|
|
||||||
@onready var combine_area_3d: Area3D = $Area3d
|
@onready var combine_area_3d: Area3D = $Area3d
|
||||||
@onready var _pickable: XRToolsPickable = get_parent() as XRToolsPickable
|
@onready var _pickable: XRToolsPickable = get_parent() as XRToolsPickable
|
||||||
|
|
||||||
@@ -10,16 +12,18 @@ var _food_item: FoodItem
|
|||||||
|
|
||||||
|
|
||||||
func _ready() -> void:
|
func _ready() -> void:
|
||||||
SweetLogger.debug("_ready(): {0}", [_pickable.name])
|
SweetLogger.debug("{0} ready", [_pickable.name])
|
||||||
_food_item = get_parent().get_node_or_null("FoodItem") as FoodItem
|
_food_item = get_parent().get_node_or_null("FoodItem") as FoodItem
|
||||||
if not _food_item:
|
if not _food_item:
|
||||||
push_error("CombinableItem is missing FoodItem reference. must be a sibling of a FoodItem on ", get_parent().name, ".")
|
SweetLogger.warning("{0} missing FoodItem reference, must be a sibling of a FoodItem", [get_parent().name])
|
||||||
|
|
||||||
if not _pickable:
|
if not _pickable:
|
||||||
push_error("CombineZone must be a grand child of an XRToolsPickable.")
|
SweetLogger.error("{0} must be a grandchild of an XRToolsPickable", [get_parent().name])
|
||||||
return
|
return
|
||||||
if not _food_item:
|
if not _food_item:
|
||||||
push_error("CombineZone requires a FoodItem sibling on ", _pickable.name, ".")
|
SweetLogger.warning("{0} requires a FoodItem sibling", [_pickable.name])
|
||||||
|
return
|
||||||
|
if not enabled:
|
||||||
return
|
return
|
||||||
|
|
||||||
# Detect items whether held (layer 17 "Held Objects") or loose
|
# Detect items whether held (layer 17 "Held Objects") or loose
|
||||||
@@ -52,12 +56,12 @@ func _on_body_entered(body: Node3D) -> void:
|
|||||||
if not NetworkManager.owns_world():
|
if not NetworkManager.owns_world():
|
||||||
return
|
return
|
||||||
if _combining or body == _pickable:
|
if _combining or body == _pickable:
|
||||||
SweetLogger.debug("other is our own pickable")
|
SweetLogger.debug("Other is our own pickable")
|
||||||
return
|
return
|
||||||
|
|
||||||
var other := Helper.find_food_item(body)
|
var other := Helper.find_food_item(body)
|
||||||
if not other:
|
if not other:
|
||||||
SweetLogger.debug("other is not a foodItem")
|
SweetLogger.debug("Other is not a FoodItem")
|
||||||
return
|
return
|
||||||
|
|
||||||
var result: PackedScene = RecipeManager.get_combination_result(_food_item.id, other.id)
|
var result: PackedScene = RecipeManager.get_combination_result(_food_item.id, other.id)
|
||||||
@@ -69,7 +73,7 @@ func _on_body_entered(body: Node3D) -> void:
|
|||||||
|
|
||||||
# Instantiate the result of combination and free the two ingredient items
|
# Instantiate the result of combination and free the two ingredient items
|
||||||
func _combine(other_body: Node3D, result: PackedScene) -> void:
|
func _combine(other_body: Node3D, result: PackedScene) -> void:
|
||||||
SweetLogger.debug("combining {0} + {1} into {2}", [_food_item.id, Helper.find_food_item(other_body).id, result.resource_path])
|
SweetLogger.debug("Combining {0} + {1} into {2}", [_food_item.id, Helper.find_food_item(other_body).id, result.resource_path])
|
||||||
|
|
||||||
# Get Snapzone
|
# Get Snapzone
|
||||||
var snap_zone := _pickable.get_picked_up_by()
|
var snap_zone := _pickable.get_picked_up_by()
|
||||||
|
|||||||
@@ -6,4 +6,4 @@ extends Node
|
|||||||
|
|
||||||
func _ready() -> void:
|
func _ready() -> void:
|
||||||
if not turns_into:
|
if not turns_into:
|
||||||
push_error("Cooking Error: 'turns_into' PackedScene is missing on ", name, ". Please assign a scene in the Inspector.")
|
SweetLogger.warning("{0} missing turns_into reference", [name])
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
extends Node
|
extends Node
|
||||||
class_name DespawningItem
|
class_name DespawningItem
|
||||||
|
|
||||||
|
@export var enabled: bool = true
|
||||||
|
|
||||||
@export var time_to_despawn: float = 8
|
@export var time_to_despawn: float = 8
|
||||||
|
|
||||||
# The minimum speed required to reset despawn timer.
|
# The minimum speed required to reset despawn timer.
|
||||||
@@ -15,14 +17,17 @@ var _time_left: float = time_to_despawn
|
|||||||
|
|
||||||
func _ready() -> void:
|
func _ready() -> void:
|
||||||
if not _pickable:
|
if not _pickable:
|
||||||
push_error("DespawningItem must be a grand child of an XRToolsPickable.")
|
SweetLogger.error("{0} must be a grandchild of an XRToolsPickable", [name])
|
||||||
return
|
return
|
||||||
if not _rigid:
|
if not _rigid:
|
||||||
push_error("DespawningItem must be a grand child of an RigidBody3D.")
|
SweetLogger.error("{0} must be a grandchild of a RigidBody3D", [name])
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
||||||
func _process(delta: float) -> void:
|
func _process(delta: float) -> void:
|
||||||
|
if not enabled:
|
||||||
|
return
|
||||||
|
|
||||||
# Despawning is a world decision, so only the owner of world logic runs the
|
# Despawning is a world decision, so only the owner of world logic runs the
|
||||||
# clock. Every peer used to run its own copy: the countdown drifted between
|
# clock. Every peer used to run its own copy: the countdown drifted between
|
||||||
# them and the blink below toggled `visible` locally, so the same item was
|
# them and the blink below toggled `visible` locally, so the same item was
|
||||||
@@ -41,7 +46,7 @@ func _process(delta: float) -> void:
|
|||||||
# Count down to zero and despawn
|
# Count down to zero and despawn
|
||||||
_time_left -= delta
|
_time_left -= delta
|
||||||
if _time_left <= 0:
|
if _time_left <= 0:
|
||||||
SweetLogger.debug("despawning {0}", [get_parent()])
|
SweetLogger.debug("Despawning {0}", [get_parent()])
|
||||||
NetworkManager.despawn_item(get_parent())
|
NetworkManager.despawn_item(get_parent())
|
||||||
# Stop counting: despawn_item() only queues the free, so without this we
|
# Stop counting: despawn_item() only queues the free, so without this we
|
||||||
# keep re-reporting the same item every frame until it actually goes.
|
# keep re-reporting the same item every frame until it actually goes.
|
||||||
@@ -53,11 +58,7 @@ func _process(delta: float) -> void:
|
|||||||
_set_visible(int(_time_left * 5.0) % 2 == 0)
|
_set_visible(int(_time_left * 5.0) % 2 == 0)
|
||||||
|
|
||||||
|
|
||||||
# `visible` is not a replicated property, so a blink driven only here would make
|
|
||||||
# the item flicker on the host and stay solid on clients. Until it is synced,
|
|
||||||
# only warn when there is nobody else to disagree with.
|
|
||||||
func _set_visible(value: bool) -> void:
|
func _set_visible(value: bool) -> void:
|
||||||
if NetworkManager.is_online():
|
if not NetworkManager.owns_world():
|
||||||
get_parent().visible = true
|
|
||||||
return
|
return
|
||||||
get_parent().visible = value
|
get_parent().visible = value
|
||||||
|
|||||||
@@ -7,12 +7,12 @@ extends Node3D
|
|||||||
func _ready() -> void:
|
func _ready() -> void:
|
||||||
|
|
||||||
if not kitchen_scene:
|
if not kitchen_scene:
|
||||||
push_error("StationSpawner missing kitchen_scene")
|
SweetLogger.warning("{0} missing kitchen_scene reference", [name])
|
||||||
|
|
||||||
SweetLogger.debug("initializing")
|
SweetLogger.debug("->[]")
|
||||||
|
|
||||||
if NetworkManager.owns_world():
|
if NetworkManager.owns_world():
|
||||||
SweetLogger.debug("initializing on server")
|
SweetLogger.debug("Initializing on server")
|
||||||
# Later we will do procedural generation here.
|
# Later we will do procedural generation here.
|
||||||
# For now we just load a scene.
|
# For now we just load a scene.
|
||||||
NetworkManager.call_deferred("spawn_item", kitchen_scene.resource_path, transform)
|
NetworkManager.call_deferred("spawn_item", kitchen_scene.resource_path, transform)
|
||||||
|
|||||||
+13
-13
@@ -1,22 +1,22 @@
|
|||||||
[gd_scene format=3 uid="uid://22shbqdvnwgo"]
|
[gd_scene format=3 uid="uid://22shbqdvnwgo"]
|
||||||
|
|
||||||
[ext_resource type="Script" uid="uid://d1cefhe3yyyds" path="res://Net/multiplayer_world.gd" id="1_nlnup"]
|
[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="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="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"]
|
[ext_resource type="PackedScene" uid="uid://j7caslh27nor" path="res://stations/Hob_old.tscn" id="4_3lufs"]
|
||||||
[ext_resource type="Sky" uid="uid://c1abtpwhdm2d5" path="res://Textures/sky/NightSkyHDRI009_16K.tres" id="5_kh26v"]
|
[ext_resource type="Sky" uid="uid://c1abtpwhdm2d5" path="res://textures/sky/NightSkyHDRI009_16K.tres" id="5_kh26v"]
|
||||||
[ext_resource type="PackedScene" uid="uid://c6rift56ql3f8" path="res://Stations/BurgerBunsDispenser.tscn" id="7_tejmp"]
|
[ext_resource type="PackedScene" uid="uid://c6rift56ql3f8" path="res://stations/BurgerBunsDispenser.tscn" id="7_tejmp"]
|
||||||
[ext_resource type="PackedScene" uid="uid://dpot5qie20vf6" path="res://Items/burger.tscn" id="9_rwx83"]
|
[ext_resource type="PackedScene" uid="uid://dpot5qie20vf6" path="res://items/burger.tscn" id="9_rwx83"]
|
||||||
[ext_resource type="PackedScene" uid="uid://dvrk268s7gkxh" path="res://Stations/sink.tscn" id="12_ah4xa"]
|
[ext_resource type="PackedScene" uid="uid://dvrk268s7gkxh" path="res://stations/sink.tscn" id="12_ah4xa"]
|
||||||
[ext_resource type="PackedScene" uid="uid://cnjwtnhwh0i8q" path="res://Stations/dirt_station.tscn" id="13_46xi2"]
|
[ext_resource type="PackedScene" uid="uid://cnjwtnhwh0i8q" path="res://stations/dirt_station.tscn" id="13_46xi2"]
|
||||||
[ext_resource type="PackedScene" uid="uid://ck5tuftqmyiue" path="res://Stations/plate_dispenser.tscn" id="14_h88sx"]
|
[ext_resource type="PackedScene" uid="uid://ck5tuftqmyiue" path="res://stations/plate_dispenser.tscn" id="14_h88sx"]
|
||||||
[ext_resource type="PackedScene" uid="uid://cwnwo4i28upap" path="res://Stations/raw_burger_dispenser.tscn" id="15_m3h4l"]
|
[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://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="PackedScene" uid="uid://caf0xanmxbshy" path="res://stations/table.tscn" id="16_g2k6a"]
|
||||||
[ext_resource type="Script" uid="uid://k8ywnvlhcic4" path="res://test/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://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="PackedScene" uid="uid://xtcei2uvd5li" path="res://UI/game_over_panel.tscn" id="18_3lufs"]
|
||||||
[ext_resource type="Script" uid="uid://cwijoksyou1ey" path="res://Prefabs/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"]
|
[sub_resource type="BoxShape3D" id="BoxShape3D_vlqg6"]
|
||||||
size = Vector3(16, 0.1, 16)
|
size = Vector3(16, 0.1, 16)
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
[ext_resource type="PackedScene" uid="uid://dlw5geheupgpt" path="res://stations/hatch.tscn" id="12_dpf3b"]
|
[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://e4i6o5oriecx" path="res://items/PickupCube.tscn" id="13_1f3bw"]
|
||||||
[ext_resource type="PackedScene" uid="uid://caf0xanmxbshy" path="res://stations/table.tscn" id="13_yjosk"]
|
[ext_resource type="PackedScene" uid="uid://caf0xanmxbshy" path="res://stations/table.tscn" id="13_yjosk"]
|
||||||
[ext_resource type="PackedScene" uid="uid://j7caslh27nor" path="res://stations/Hob.tscn" id="14_2ndvi"]
|
[ext_resource type="PackedScene" uid="uid://j7caslh27nor" path="res://stations/Hob_old.tscn" id="14_2ndvi"]
|
||||||
[ext_resource type="PackedScene" uid="uid://clujaf3u776a3" path="res://addons/godot-xr-tools/objects/viewport_2d_in_3d.tscn" id="14_di04w"]
|
[ext_resource type="PackedScene" uid="uid://clujaf3u776a3" path="res://addons/godot-xr-tools/objects/viewport_2d_in_3d.tscn" id="14_di04w"]
|
||||||
[ext_resource type="PackedScene" uid="uid://efaec6ymgabo" path="res://stations/Counter.tscn" id="15_di04w"]
|
[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://xtcei2uvd5li" path="res://UI/game_over_panel.tscn" id="15_eoxxy"]
|
||||||
|
|||||||
@@ -30,14 +30,14 @@ func _reset_values() -> void:
|
|||||||
|
|
||||||
|
|
||||||
func start_next_day() -> void:
|
func start_next_day() -> void:
|
||||||
SweetLogger.info("starting next day")
|
SweetLogger.info("Starting next day")
|
||||||
_reset_values()
|
_reset_values()
|
||||||
GameManager.set_customers_per_day(GameManager.customers_per_day + GameManager.customers_count_increase_per_day)
|
GameManager.set_customers_per_day(GameManager.customers_per_day + GameManager.customers_count_increase_per_day)
|
||||||
GameManager.set_day_number(GameManager.day_number + 1)
|
GameManager.set_day_number(GameManager.day_number + 1)
|
||||||
|
|
||||||
|
|
||||||
func finish_current_day() -> void:
|
func finish_current_day() -> void:
|
||||||
SweetLogger.info("finishing current day")
|
SweetLogger.info("Finishing current day")
|
||||||
_reset_values()
|
_reset_values()
|
||||||
|
|
||||||
|
|
||||||
@@ -50,9 +50,9 @@ func _process(delta: float) -> void:
|
|||||||
#print("DayController: customers_at_this_time: ", customers_at_this_time)
|
#print("DayController: customers_at_this_time: ", customers_at_this_time)
|
||||||
if customers_spawned < customers_at_this_time:
|
if customers_spawned < customers_at_this_time:
|
||||||
customers_spawned += 1
|
customers_spawned += 1
|
||||||
SweetLogger.debug("spawning customer")
|
SweetLogger.debug("Spawning customer")
|
||||||
Signals.request_customer_spawn.emit()
|
Signals.request_customer_spawn.emit()
|
||||||
# If day complete
|
# If day complete
|
||||||
if GameManager.customers_per_day == customers_served and customers_spawned == GameManager.customers_per_day:
|
if GameManager.customers_per_day == customers_served and customers_spawned == GameManager.customers_per_day:
|
||||||
SweetLogger.info("day complete")
|
SweetLogger.info("Day complete")
|
||||||
finish_current_day()
|
finish_current_day()
|
||||||
|
|||||||
@@ -3,18 +3,7 @@
|
|||||||
[ext_resource type="Script" uid="uid://d1cefhe3yyyds" path="res://Net/multiplayer_world.gd" id="1_jfr2g"]
|
[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="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="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"]
|
|
||||||
[ext_resource type="Sky" uid="uid://c1abtpwhdm2d5" path="res://textures/sky/NightSkyHDRI009_16K.tres" id="5_l1qm6"]
|
[ext_resource type="Sky" uid="uid://c1abtpwhdm2d5" path="res://textures/sky/NightSkyHDRI009_16K.tres" id="5_l1qm6"]
|
||||||
[ext_resource type="PackedScene" uid="uid://c0lknik4noobs" path="res://items/BurgerBuns.tscn" id="6_bktvt"]
|
|
||||||
[ext_resource type="PackedScene" uid="uid://c6rift56ql3f8" path="res://stations/BurgerBunsDispenser.tscn" id="7_1nkd0"]
|
|
||||||
[ext_resource type="PackedScene" uid="uid://bp3v1jl8pctro" path="res://Containers/plate.tscn" id="8_l1owj"]
|
|
||||||
[ext_resource type="PackedScene" uid="uid://dpot5qie20vf6" path="res://items/burger.tscn" id="9_220hi"]
|
|
||||||
[ext_resource type="PackedScene" uid="uid://b3m2ag8g5rj4r" path="res://items/hamburger.tscn" id="10_qacki"]
|
|
||||||
[ext_resource type="PackedScene" uid="uid://e4i6o5oriecx" path="res://items/PickupCube.tscn" id="11_npf8s"]
|
|
||||||
[ext_resource type="PackedScene" uid="uid://dvrk268s7gkxh" path="res://stations/sink.tscn" id="12_8apyq"]
|
|
||||||
[ext_resource type="PackedScene" uid="uid://cnjwtnhwh0i8q" path="res://stations/dirt_station.tscn" id="13_jnwcx"]
|
|
||||||
[ext_resource type="PackedScene" uid="uid://cfc4ho67u4r5e" path="res://items/cooked_burger.tscn" id="14_1lg2m"]
|
|
||||||
[ext_resource type="PackedScene" uid="uid://efaec6ymgabo" path="res://stations/Counter.tscn" id="15_yy81s"]
|
|
||||||
[ext_resource type="PackedScene" uid="uid://clujaf3u776a3" path="res://addons/godot-xr-tools/objects/viewport_2d_in_3d.tscn" id="16_vp"]
|
[ext_resource type="PackedScene" uid="uid://clujaf3u776a3" path="res://addons/godot-xr-tools/objects/viewport_2d_in_3d.tscn" id="16_vp"]
|
||||||
[ext_resource type="PackedScene" path="res://UI/main_menu_panel.tscn" id="17_panel"]
|
[ext_resource type="PackedScene" path="res://UI/main_menu_panel.tscn" id="17_panel"]
|
||||||
|
|
||||||
@@ -61,111 +50,9 @@ shape = SubResource("BoxShape3D_vlqg6")
|
|||||||
[node name="MeshInstance3D" type="MeshInstance3D" parent="Floor/CollisionShape3D" unique_id=1939997056]
|
[node name="MeshInstance3D" type="MeshInstance3D" parent="Floor/CollisionShape3D" unique_id=1939997056]
|
||||||
mesh = SubResource("BoxMesh_24d3s")
|
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.015500337, -1.484)
|
|
||||||
|
|
||||||
[node name="WorldEnvironment" type="WorldEnvironment" parent="." unique_id=1177077250]
|
[node name="WorldEnvironment" type="WorldEnvironment" parent="." unique_id=1177077250]
|
||||||
environment = SubResource("Environment_bvwq1")
|
environment = SubResource("Environment_bvwq1")
|
||||||
|
|
||||||
[node name="BurgerBuns" parent="." unique_id=1088240294 instance=ExtResource("6_bktvt")]
|
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1.5530176, 1.0505146, -1.3074328)
|
|
||||||
|
|
||||||
[node name="BurgerBunsDispenser" parent="." unique_id=1720683779 instance=ExtResource("7_1nkd0")]
|
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1.568947, -0.018512607, -1.317366)
|
|
||||||
|
|
||||||
[node name="Plate" parent="." unique_id=190487773 instance=ExtResource("8_l1owj")]
|
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1.5717233, 1.1548845, 1.5373346)
|
|
||||||
|
|
||||||
[node name="burger" parent="." unique_id=1417604760 instance=ExtResource("9_220hi")]
|
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.6888188, 1.0325116, -1.7110313)
|
|
||||||
|
|
||||||
[node name="burger2" parent="." unique_id=1584460510 instance=ExtResource("9_220hi")]
|
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.6931299, 1.1429771, -1.71225)
|
|
||||||
|
|
||||||
[node name="burger3" parent="." unique_id=1884095916 instance=ExtResource("9_220hi")]
|
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.69027674, 1.1099085, -1.7210286)
|
|
||||||
|
|
||||||
[node name="burger4" parent="." unique_id=1844818864 instance=ExtResource("9_220hi")]
|
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.69134104, 1.0672915, -1.7210286)
|
|
||||||
|
|
||||||
[node name="Hamburger" parent="." unique_id=761091445 instance=ExtResource("10_qacki")]
|
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1.9352558, 1.2334514, 1.2447833)
|
|
||||||
|
|
||||||
[node name="PickableObject" parent="." unique_id=1675596942 instance=ExtResource("11_npf8s")]
|
|
||||||
transform = Transform3D(1, 0, -2.2351742e-08, -2.9802322e-08, 1.0000001, 0, -2.6077032e-08, 1.4901161e-08, 1, 0.6225724, 1.0654817, -1.0473135)
|
|
||||||
|
|
||||||
[node name="PickableObject2" parent="." unique_id=713087634 instance=ExtResource("11_npf8s")]
|
|
||||||
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.0501236, -1.1673055)
|
|
||||||
|
|
||||||
[node name="PickableObject3" parent="." unique_id=879935619 instance=ExtResource("11_npf8s")]
|
|
||||||
transform = Transform3D(1, 0, -2.2351742e-08, -2.9802322e-08, 1.0000001, 0, -2.6077032e-08, 1.4901161e-08, 1, 0.5142721, 1.0654817, -1.0473135)
|
|
||||||
|
|
||||||
[node name="PickableObject4" parent="." unique_id=198541902 instance=ExtResource("11_npf8s")]
|
|
||||||
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.0501236, -1.1673055)
|
|
||||||
|
|
||||||
[node name="Hamburger2" parent="." unique_id=1349934579 instance=ExtResource("10_qacki")]
|
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1.9857153, 1.1424131, 0.9472374)
|
|
||||||
|
|
||||||
[node name="PickableObject5" parent="." unique_id=1021333509 instance=ExtResource("11_npf8s")]
|
|
||||||
transform = Transform3D(1, 0, -2.2351742e-08, -2.9802322e-08, 1.0000001, 0, -2.6077032e-08, 1.4901161e-08, 1, 0.73287535, 1.0922265, -1.0473135)
|
|
||||||
|
|
||||||
[node name="PickableObject6" parent="." unique_id=1268843669 instance=ExtResource("11_npf8s")]
|
|
||||||
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.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)
|
|
||||||
|
|
||||||
[node name="Plate2" parent="." unique_id=356790445 instance=ExtResource("8_l1owj")]
|
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1.5730225, 1.1085004, 0.59790254)
|
|
||||||
|
|
||||||
[node name="CookedBurger" parent="." unique_id=1127807542 instance=ExtResource("14_1lg2m")]
|
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.30782473, 1.1446649, -1.0928738)
|
|
||||||
|
|
||||||
[node name="CookedBurger2" parent="." unique_id=160088590 instance=ExtResource("14_1lg2m")]
|
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.30671906, 1.0522771, -1.0928738)
|
|
||||||
|
|
||||||
[node name="CookedBurger3" parent="." unique_id=992183367 instance=ExtResource("14_1lg2m")]
|
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1.3344773, 1.0492828, -0.7096845)
|
|
||||||
|
|
||||||
[node name="CookedBurger4" parent="." unique_id=1837607086 instance=ExtResource("14_1lg2m")]
|
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.30671906, 1.098119, -1.0928738)
|
|
||||||
|
|
||||||
[node name="BurgerBuns2" parent="." unique_id=1210358958 instance=ExtResource("6_bktvt")]
|
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1.3596323, 1.0205106, -0.22482127)
|
|
||||||
|
|
||||||
[node name="PickableObject7" parent="." unique_id=641653545 instance=ExtResource("11_npf8s")]
|
|
||||||
transform = Transform3D(1, 0, -2.2351742e-08, -2.9802322e-08, 1.0000001, 0, -2.6077032e-08, 1.4901161e-08, 1, -1.3556751, 1.0887735, 0.28881657)
|
|
||||||
|
|
||||||
[node name="PickableObject8" parent="." unique_id=1733819363 instance=ExtResource("11_npf8s")]
|
|
||||||
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.0734154, 0.16882455)
|
|
||||||
|
|
||||||
[node name="PickableObject9" parent="." unique_id=12419746 instance=ExtResource("11_npf8s")]
|
|
||||||
transform = Transform3D(1, 0, -2.2351742e-08, -2.9802322e-08, 1.0000001, 0, -2.6077032e-08, 1.4901161e-08, 1, -1.4639754, 1.0887735, 0.28881657)
|
|
||||||
|
|
||||||
[node name="PickableObject10" parent="." unique_id=313160217 instance=ExtResource("11_npf8s")]
|
|
||||||
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.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.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.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.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)
|
|
||||||
|
|
||||||
[node name="Plate3" parent="." unique_id=2004250522 instance=ExtResource("8_l1owj")]
|
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1.5818124, 1.1085004, -0.4634577)
|
|
||||||
|
|
||||||
[node name="WorldContent" type="Node3D" parent="." unique_id=1660879286]
|
[node name="WorldContent" type="Node3D" parent="." unique_id=1660879286]
|
||||||
|
|
||||||
[node name="Players" type="Node3D" parent="." unique_id=494935131]
|
[node name="Players" type="Node3D" parent="." unique_id=494935131]
|
||||||
|
|||||||
+15
-10
@@ -1,15 +1,15 @@
|
|||||||
[gd_scene format=3 uid="uid://c30i6h32w8p47"]
|
[gd_scene format=3 uid="uid://c30i6h32w8p47"]
|
||||||
|
|
||||||
[ext_resource type="Script" uid="uid://d1cefhe3yyyds" path="res://Net/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="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="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"]
|
[ext_resource type="Sky" uid="uid://c1abtpwhdm2d5" path="res://textures/sky/NightSkyHDRI009_16K.tres" id="5_c3xgf"]
|
||||||
[ext_resource type="Script" uid="uid://fyd2rjramhbb" path="res://Prefabs/kitchen_instantiator.gd" id="6_pw2j5"]
|
[ext_resource type="Script" uid="uid://fyd2rjramhbb" path="res://prefabs/kitchen_instantiator.gd" id="6_pw2j5"]
|
||||||
[ext_resource type="PackedScene" uid="uid://damrxtlt7uswf" path="res://content/station_layouts/small_line.tscn" id="7_0sjqq"]
|
[ext_resource type="PackedScene" uid="uid://damrxtlt7uswf" path="res://content/station_layouts/small_line.tscn" id="7_0sjqq"]
|
||||||
[ext_resource type="PackedScene" uid="uid://j7caslh27nor" path="res://Stations/Hob.tscn" id="8_0sjqq"]
|
[ext_resource type="PackedScene" uid="uid://dm70ynyuw1a5u" path="res://prefabs/day_controller.tscn" id="9_5wx0o"]
|
||||||
[ext_resource type="PackedScene" uid="uid://dm70ynyuw1a5u" path="res://Prefabs/day_controller.tscn" id="9_5wx0o"]
|
[ext_resource type="PackedScene" uid="uid://bnwb7imcotkod" path="res://prefabs/build_mode_controller.tscn" id="10_464r1"]
|
||||||
[ext_resource type="PackedScene" uid="uid://bnwb7imcotkod" path="res://Prefabs/build_mode_controller.tscn" id="10_464r1"]
|
[ext_resource type="PackedScene" uid="uid://3i1xb74cfsh5" path="res://test/vr_spectator_camera.tscn" id="11_5wx0o"]
|
||||||
[ext_resource type="PackedScene" uid="uid://dxe05wp60jg3l" path="res://Scenes/queue_controller.tscn" id="11_de1dy"]
|
[ext_resource type="PackedScene" uid="uid://dxe05wp60jg3l" path="res://scenes/queue_controller.tscn" id="11_de1dy"]
|
||||||
[ext_resource type="Script" uid="uid://biu4qr3nr1eny" path="res://test/mp_test_driver.gd" id="99_mptst"]
|
[ext_resource type="Script" uid="uid://biu4qr3nr1eny" path="res://test/mp_test_driver.gd" id="99_mptst"]
|
||||||
|
|
||||||
[sub_resource type="BoxShape3D" id="BoxShape3D_vlqg6"]
|
[sub_resource type="BoxShape3D" id="BoxShape3D_vlqg6"]
|
||||||
@@ -31,6 +31,9 @@ sdfgi_enabled = true
|
|||||||
[sub_resource type="BoxShape3D" id="BoxShape3D_arao0"]
|
[sub_resource type="BoxShape3D" id="BoxShape3D_arao0"]
|
||||||
size = Vector3(15, 20, 0.1)
|
size = Vector3(15, 20, 0.1)
|
||||||
|
|
||||||
|
[sub_resource type="Resource" id="Resource_464r1"]
|
||||||
|
metadata/__load_path__ = "res://stations/Hob_old.tscn"
|
||||||
|
|
||||||
[node name="Main" type="Node3D" unique_id=1312265607 node_paths=PackedStringArray("items_spawner", "players_spawner")]
|
[node name="Main" type="Node3D" unique_id=1312265607 node_paths=PackedStringArray("items_spawner", "players_spawner")]
|
||||||
script = ExtResource("1_kdan8")
|
script = ExtResource("1_kdan8")
|
||||||
items_spawner = NodePath("ItemsSpawner")
|
items_spawner = NodePath("ItemsSpawner")
|
||||||
@@ -63,7 +66,7 @@ environment = SubResource("Environment_bvwq1")
|
|||||||
spawn_path = NodePath("../WorldContent")
|
spawn_path = NodePath("../WorldContent")
|
||||||
|
|
||||||
[node name="PlayersSpawner" type="MultiplayerSpawner" parent="." unique_id=106645565]
|
[node name="PlayersSpawner" type="MultiplayerSpawner" parent="." unique_id=106645565]
|
||||||
_spawnable_scenes = PackedStringArray("res://Player/net_player.tscn")
|
_spawnable_scenes = PackedStringArray("uid://c58ns7csdahjy")
|
||||||
spawn_path = NodePath("../Players")
|
spawn_path = NodePath("../Players")
|
||||||
|
|
||||||
[node name="StaticBody3D" type="StaticBody3D" parent="." unique_id=4404969]
|
[node name="StaticBody3D" type="StaticBody3D" parent="." unique_id=4404969]
|
||||||
@@ -91,7 +94,7 @@ script = ExtResource("99_mptst")
|
|||||||
transform = Transform3D(1, 0, -1.7484555e-07, 0, 1, 0, 1.7484555e-07, 0, 1, 0, 0, -1.2)
|
transform = Transform3D(1, 0, -1.7484555e-07, 0, 1, 0, 1.7484555e-07, 0, 1, 0, 0, -1.2)
|
||||||
script = ExtResource("6_pw2j5")
|
script = ExtResource("6_pw2j5")
|
||||||
kitchen_scene = ExtResource("7_0sjqq")
|
kitchen_scene = ExtResource("7_0sjqq")
|
||||||
hob_scene = ExtResource("8_0sjqq")
|
hob_scene = SubResource("Resource_464r1")
|
||||||
|
|
||||||
[node name="DayController" parent="." unique_id=1418639156 instance=ExtResource("9_5wx0o")]
|
[node name="DayController" parent="." unique_id=1418639156 instance=ExtResource("9_5wx0o")]
|
||||||
|
|
||||||
@@ -99,3 +102,5 @@ hob_scene = ExtResource("8_0sjqq")
|
|||||||
|
|
||||||
[node name="QueueController" parent="." unique_id=326512876 instance=ExtResource("11_de1dy")]
|
[node name="QueueController" parent="." unique_id=326512876 instance=ExtResource("11_de1dy")]
|
||||||
transform = Transform3D(-1, 0, -8.742278e-08, 0, 1, 0, 8.742278e-08, 0, -1, 0, 0, 7.2000003)
|
transform = Transform3D(-1, 0, -8.742278e-08, 0, 1, 0, 8.742278e-08, 0, -1, 0, 0, 7.2000003)
|
||||||
|
|
||||||
|
[node name="VRSpectatorCamera" parent="." unique_id=310823561 instance=ExtResource("11_5wx0o")]
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ func spawn_customer() -> void:
|
|||||||
func _rebuild_table_list() -> void:
|
func _rebuild_table_list() -> void:
|
||||||
_tables.clear()
|
_tables.clear()
|
||||||
_tables.append_array(get_tree().get_nodes_in_group("table"))
|
_tables.append_array(get_tree().get_nodes_in_group("table"))
|
||||||
SweetLogger.debug("_rebuild_table_list complete: {0}", [_tables])
|
SweetLogger.debug("Rebuild table list complete: {0}", [_tables])
|
||||||
|
|
||||||
|
|
||||||
func _try_to_assign_customers() -> void:
|
func _try_to_assign_customers() -> void:
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
[ext_resource type="Sky" uid="uid://c1abtpwhdm2d5" path="res://textures/sky/NightSkyHDRI009_16K.tres" id="2_1jq86"]
|
[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="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"]
|
[ext_resource type="Material" uid="uid://cmia50cfqxxo4" path="res://textures/dev_material_3d.tres" id="4_kpgm6"]
|
||||||
[ext_resource type="PackedScene" uid="uid://j7caslh27nor" path="res://stations/Hob.tscn" id="5_gfdi7"]
|
[ext_resource type="PackedScene" uid="uid://j7caslh27nor" path="res://stations/Hob_old.tscn" id="5_gfdi7"]
|
||||||
[ext_resource type="PackedScene" uid="uid://efaec6ymgabo" path="res://stations/Counter.tscn" id="7_jnxsa"]
|
[ext_resource type="PackedScene" uid="uid://efaec6ymgabo" path="res://stations/Counter.tscn" id="7_jnxsa"]
|
||||||
[ext_resource type="PackedScene" uid="uid://bnwb7imcotkod" path="res://prefabs/build_mode_controller.tscn" id="9_hooyg"]
|
[ext_resource type="PackedScene" uid="uid://bnwb7imcotkod" path="res://prefabs/build_mode_controller.tscn" id="9_hooyg"]
|
||||||
[ext_resource type="PackedScene" uid="uid://caf0xanmxbshy" path="res://stations/table.tscn" id="11_gaw43"]
|
[ext_resource type="PackedScene" uid="uid://caf0xanmxbshy" path="res://stations/table.tscn" id="11_gaw43"]
|
||||||
|
|||||||
+10
-10
@@ -114,14 +114,14 @@ func get_next(size, walls):
|
|||||||
var offset = [-1,-1]
|
var offset = [-1,-1]
|
||||||
|
|
||||||
walls.shuffle()
|
walls.shuffle()
|
||||||
SweetLogger.debug("get_next size: {0}", [size])
|
SweetLogger.debug("Size: {0}", [size])
|
||||||
|
|
||||||
for wall in walls:
|
for wall in walls:
|
||||||
SweetLogger.debug("get_next wall: {0}", [wall])
|
SweetLogger.debug("Wall: {0}", [wall])
|
||||||
if wall["der"][1] == 0:
|
if wall["der"][1] == 0:
|
||||||
SweetLogger.debug("get_next horizontal wall")
|
SweetLogger.debug("Horizontal wall")
|
||||||
if size[0]<wall["len"]-6:
|
if size[0]<wall["len"]-6:
|
||||||
SweetLogger.debug("TileMapLayer get_next length 6 less can go anywhere")
|
SweetLogger.debug("Length 6 less can go anywhere")
|
||||||
if wall["der"][0] == 1:offset[1] = wall["pos"][1]
|
if wall["der"][0] == 1:offset[1] = wall["pos"][1]
|
||||||
else: offset[1] = wall["pos"][1]-size[1]
|
else: offset[1] = wall["pos"][1]-size[1]
|
||||||
|
|
||||||
@@ -130,16 +130,16 @@ func get_next(size, walls):
|
|||||||
if size[0]+offset[0]>wall["pos"][0]+wall["len"]-3:offset[0] = wall["len"]-(3+size[0])
|
if size[0]+offset[0]>wall["pos"][0]+wall["len"]-3:offset[0] = wall["len"]-(3+size[0])
|
||||||
|
|
||||||
elif size[0]<=wall["len"]-3:
|
elif size[0]<=wall["len"]-3:
|
||||||
SweetLogger.debug("TileMapLayer get_next 3 less needs to be on a corner")
|
SweetLogger.debug("3 less needs to be on a corner")
|
||||||
if wall["der"][0] == 1:offset[1] = wall["pos"][1]
|
if wall["der"][0] == 1:offset[1] = wall["pos"][1]
|
||||||
else: offset[1] = wall["pos"][1]-size[1]
|
else: offset[1] = wall["pos"][1]-size[1]
|
||||||
|
|
||||||
if randi_range(0, 1):offset[0]=wall["pos"][0]+wall["len"]-size[0]
|
if randi_range(0, 1):offset[0]=wall["pos"][0]+wall["len"]-size[0]
|
||||||
else:offset[0] = wall["pos"][0]
|
else:offset[0] = wall["pos"][0]
|
||||||
else:
|
else:
|
||||||
SweetLogger.debug("get_next vertical wall")
|
SweetLogger.debug("Vertical wall")
|
||||||
if size[1]<wall["len"]-6:
|
if size[1]<wall["len"]-6:
|
||||||
SweetLogger.debug("TileMapLayer get_next length 6 less can go anywhere")
|
SweetLogger.debug("Length 6 less can go anywhere")
|
||||||
if wall["der"][1] == 1:offset[0] = wall["pos"][0]
|
if wall["der"][1] == 1:offset[0] = wall["pos"][0]
|
||||||
else: offset[0] = wall["pos"][0]-size[0]
|
else: offset[0] = wall["pos"][0]-size[0]
|
||||||
|
|
||||||
@@ -148,10 +148,10 @@ func get_next(size, walls):
|
|||||||
if size[1]+offset[1]>wall["len"]-3:offset[1] = wall["len"]-(3+size[1])
|
if size[1]+offset[1]>wall["len"]-3:offset[1] = wall["len"]-(3+size[1])
|
||||||
|
|
||||||
elif size[1]<=wall["len"]-3:
|
elif size[1]<=wall["len"]-3:
|
||||||
SweetLogger.debug("TileMapLayer get_next 3 less needs to be on a corner")
|
SweetLogger.debug("3 less needs to be on a corner")
|
||||||
if wall["der"][1] == 1:offset[0] = wall["pos"][0]
|
if wall["der"][1] == 1:offset[0] = wall["pos"][0]
|
||||||
else: offset[0] = wall["pos"][0]-size[0]
|
else: offset[0] = wall["pos"][0]-size[0]
|
||||||
SweetLogger.debug("get_next offset: {0}", [offset])
|
SweetLogger.debug("Offset: {0}", [offset])
|
||||||
|
|
||||||
if randi() % 2:offset[1]=wall["pos"][1]+wall["len"]-size[1]
|
if randi() % 2:offset[1]=wall["pos"][1]+wall["len"]-size[1]
|
||||||
else:offset[1] = wall["pos"][1]
|
else:offset[1] = wall["pos"][1]
|
||||||
@@ -165,7 +165,7 @@ func get_next(size, walls):
|
|||||||
func draw_room(Size, offset=Vector2i(0, 0)):
|
func draw_room(Size, offset=Vector2i(0, 0)):
|
||||||
var walls = []
|
var walls = []
|
||||||
offset = Vector2i(offset[0], offset[1])
|
offset = Vector2i(offset[0], offset[1])
|
||||||
SweetLogger.debug("draw_room size: {0} offset: {1}", [Size, offset])
|
SweetLogger.debug("Size: {0} offset: {1}", [Size, offset])
|
||||||
|
|
||||||
for i in range(Size[0]):
|
for i in range(Size[0]):
|
||||||
tile_map.set_cell(Vector2i(i+offset[0],offset[1]), 0, Vector2i(1,1))
|
tile_map.set_cell(Vector2i(i+offset[0],offset[1]), 0, Vector2i(1,1))
|
||||||
|
|||||||
@@ -1,24 +1,10 @@
|
|||||||
[gd_scene format=3 uid="uid://c6rift56ql3f8"]
|
[gd_scene format=3 uid="uid://c6rift56ql3f8"]
|
||||||
|
|
||||||
[ext_resource type="Script" uid="uid://0y6wnjcsum6" path="res://stations/item_dispenser.gd" id="1_myl3s"]
|
[ext_resource type="Script" uid="uid://0y6wnjcsum6" path="res://stations/item_dispenser.gd" id="1_myl3s"]
|
||||||
[ext_resource type="Script" uid="uid://cquqe4f1m1sw6" path="res://addons/godot-xr-tools/objects/snap_zone.gd" id="1_p30r1"]
|
[ext_resource type="PackedScene" uid="uid://cbs8jiqe8rcmn" path="res://abstract/station.tscn" id="1_station"]
|
||||||
[ext_resource type="PackedScene" uid="uid://cvucwxibtol5f" path="res://stations/StationMovement.tscn" id="1_u2p81"]
|
|
||||||
[ext_resource type="PackedScene" uid="uid://c0lknik4noobs" path="res://items/BurgerBuns.tscn" id="2_1q74o"]
|
[ext_resource type="PackedScene" uid="uid://c0lknik4noobs" path="res://items/BurgerBuns.tscn" id="2_1q74o"]
|
||||||
[ext_resource type="PackedScene" uid="uid://mpapt5mkbuao" path="res://prefabs/slide_off_dome.tscn" id="4_rf1b2"]
|
[ext_resource type="PackedScene" uid="uid://mpapt5mkbuao" path="res://prefabs/slide_off_dome.tscn" id="4_rf1b2"]
|
||||||
|
[ext_resource type="AudioStream" uid="uid://dmyuqe5058sv3" path="res://sounds/220197__gameaudio__click-basic.wav" id="4_u2p81"]
|
||||||
[sub_resource type="SceneReplicationConfig" id="SceneReplicationConfig_u2p81"]
|
|
||||||
properties/0/path = NodePath(".:position")
|
|
||||||
properties/0/spawn = false
|
|
||||||
properties/0/replication_mode = 1
|
|
||||||
properties/1/path = NodePath(".:rotation")
|
|
||||||
properties/1/spawn = false
|
|
||||||
properties/1/replication_mode = 1
|
|
||||||
properties/2/path = NodePath(".:visible")
|
|
||||||
properties/2/spawn = false
|
|
||||||
properties/2/replication_mode = 1
|
|
||||||
|
|
||||||
[sub_resource type="SphereShape3D" id="SphereShape3D_xmbo2"]
|
|
||||||
radius = 0.3
|
|
||||||
|
|
||||||
[sub_resource type="CylinderShape3D" id="CylinderShape3D_24d3s"]
|
[sub_resource type="CylinderShape3D" id="CylinderShape3D_24d3s"]
|
||||||
height = 1.0
|
height = 1.0
|
||||||
@@ -27,64 +13,60 @@ radius = 0.3
|
|||||||
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_vlqg6"]
|
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_vlqg6"]
|
||||||
albedo_color = Color(0.6784191, 0.54546416, 0.016760282, 1)
|
albedo_color = Color(0.6784191, 0.54546416, 0.016760282, 1)
|
||||||
|
|
||||||
[node name="BurgerBunsDispenser" type="Node3D" unique_id=1410160280]
|
[node name="BurgerBunsDispenser" unique_id=707500902 instance=ExtResource("1_station")]
|
||||||
|
|
||||||
[node name="StationMovement" parent="." unique_id=946873975 node_paths=PackedStringArray("station") instance=ExtResource("1_u2p81")]
|
[node name="StationMovement" parent="." index="0" unique_id=946873975 node_paths=PackedStringArray("station")]
|
||||||
station = NodePath("../BurgerBunsDispenser")
|
station = NodePath("../BurgerBunsDispenser")
|
||||||
|
|
||||||
[node name="MultiplayerSynchronizer" type="MultiplayerSynchronizer" parent="." unique_id=904562637]
|
[node name="SnapZone" parent="." index="5" unique_id=1315859105]
|
||||||
root_path = NodePath("../BurgerBunsDispenser")
|
|
||||||
replication_config = SubResource("SceneReplicationConfig_u2p81")
|
|
||||||
|
|
||||||
[node name="BurgerBunsDispenser" type="StaticBody3D" parent="." unique_id=1720683779 groups=["station"]]
|
|
||||||
script = ExtResource("1_myl3s")
|
|
||||||
item_scene = ExtResource("2_1q74o")
|
|
||||||
|
|
||||||
[node name="XRToolsSnapZone" type="Area3D" parent="BurgerBunsDispenser" unique_id=805334513 groups=["station_zone"]]
|
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.00070536137, 1.0162505, -0.002165556)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.00070536137, 1.0162505, -0.002165556)
|
||||||
collision_layer = 65536
|
collision_layer = 65536
|
||||||
collision_mask = 65536
|
collision_mask = 65536
|
||||||
script = ExtResource("1_p30r1")
|
|
||||||
snap_mode = 1
|
snap_mode = 1
|
||||||
metadata/_custom_type_script = "uid://cquqe4f1m1sw6"
|
|
||||||
|
|
||||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="BurgerBunsDispenser/XRToolsSnapZone" unique_id=1104626493]
|
[node name="BurgerBunsDispenser" type="StaticBody3D" parent="." index="6" unique_id=1720683779 node_paths=PackedStringArray("notification_audio", "ambient_audio", "snap_zone", "synchronizer") groups=["station"]]
|
||||||
shape = SubResource("SphereShape3D_xmbo2")
|
script = ExtResource("1_myl3s")
|
||||||
|
item_scene = ExtResource("2_1q74o")
|
||||||
|
pickup_sound = ExtResource("4_u2p81")
|
||||||
|
notification_audio = NodePath("../AudioStreamPlayer3DNotification")
|
||||||
|
ambient_audio = NodePath("../AudioStreamPlayer3DAmbient")
|
||||||
|
snap_zone = NodePath("../SnapZone")
|
||||||
|
synchronizer = NodePath("../MultiplayerSynchronizer")
|
||||||
|
|
||||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="BurgerBunsDispenser" unique_id=1470079357]
|
[node name="CollisionShape3D" type="CollisionShape3D" parent="BurgerBunsDispenser" index="0" unique_id=1470079357]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.5, 0)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.5, 0)
|
||||||
shape = SubResource("CylinderShape3D_24d3s")
|
shape = SubResource("CylinderShape3D_24d3s")
|
||||||
|
|
||||||
[node name="SlideOffDome" parent="BurgerBunsDispenser" unique_id=1427609426 instance=ExtResource("4_rf1b2")]
|
[node name="SlideOffDome" parent="BurgerBunsDispenser" index="1" unique_id=1427609426 instance=ExtResource("4_rf1b2")]
|
||||||
|
|
||||||
[node name="CSGCombiner3D" type="CSGCombiner3D" parent="BurgerBunsDispenser" unique_id=1746426494]
|
[node name="CSGCombiner3D" type="CSGCombiner3D" parent="BurgerBunsDispenser" index="2" unique_id=1746426494]
|
||||||
|
|
||||||
[node name="CSGCylinder3D" type="CSGCylinder3D" parent="BurgerBunsDispenser/CSGCombiner3D" unique_id=858311379]
|
[node name="CSGCylinder3D" type="CSGCylinder3D" parent="BurgerBunsDispenser/CSGCombiner3D" index="0" unique_id=858311379]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.5, 0)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.5, 0)
|
||||||
radius = 0.3
|
radius = 0.3
|
||||||
height = 1.0
|
height = 1.0
|
||||||
sides = 32
|
sides = 32
|
||||||
|
|
||||||
[node name="CSGCombiner3DBuns" type="CSGCombiner3D" parent="BurgerBunsDispenser/CSGCombiner3D" unique_id=1459017790]
|
[node name="CSGCombiner3DBuns" type="CSGCombiner3D" parent="BurgerBunsDispenser/CSGCombiner3D" index="1" unique_id=1459017790]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.16038476, 1.0341886, -0.09012994)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.16038476, 1.0341886, -0.09012994)
|
||||||
autosmooth = true
|
autosmooth = true
|
||||||
smoothing_angle = 138.9
|
smoothing_angle = 138.9
|
||||||
|
|
||||||
[node name="CSGCylinder3D2" type="CSGCylinder3D" parent="BurgerBunsDispenser/CSGCombiner3D/CSGCombiner3DBuns" unique_id=1328221793]
|
[node name="CSGCylinder3D2" type="CSGCylinder3D" parent="BurgerBunsDispenser/CSGCombiner3D/CSGCombiner3DBuns" index="0" unique_id=1328221793]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.004122257, 0)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.004122257, 0)
|
||||||
radius = 0.085
|
radius = 0.085
|
||||||
height = 0.04
|
height = 0.04
|
||||||
sides = 16
|
sides = 16
|
||||||
material = SubResource("StandardMaterial3D_vlqg6")
|
material = SubResource("StandardMaterial3D_vlqg6")
|
||||||
|
|
||||||
[node name="CSGCylinder3D3" type="CSGCylinder3D" parent="BurgerBunsDispenser/CSGCombiner3D/CSGCombiner3DBuns" unique_id=686624728]
|
[node name="CSGCylinder3D3" type="CSGCylinder3D" parent="BurgerBunsDispenser/CSGCombiner3D/CSGCombiner3DBuns" index="1" unique_id=686624728]
|
||||||
transform = Transform3D(0.82770383, -0.5611652, 0, 0.5611652, 0.82770383, 0, 0, 0, 1, -0.048392475, 0.029736161, 0)
|
transform = Transform3D(0.82770383, -0.5611652, 0, 0.5611652, 0.82770383, 0, 0, 0, 1, -0.048392475, 0.029736161, 0)
|
||||||
radius = 0.085
|
radius = 0.085
|
||||||
height = 0.04
|
height = 0.04
|
||||||
sides = 16
|
sides = 16
|
||||||
material = SubResource("StandardMaterial3D_vlqg6")
|
material = SubResource("StandardMaterial3D_vlqg6")
|
||||||
|
|
||||||
[node name="CSGCylinder3D4" type="CSGCylinder3D" parent="BurgerBunsDispenser/CSGCombiner3D/CSGCombiner3DBuns/CSGCylinder3D3" unique_id=1113894081]
|
[node name="CSGCylinder3D4" type="CSGCylinder3D" parent="BurgerBunsDispenser/CSGCombiner3D/CSGCombiner3DBuns/CSGCylinder3D3" index="0" unique_id=1113894081]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 5.9604645e-08, 0.040259957, 0)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 5.9604645e-08, 0.040259957, 0)
|
||||||
radius = 0.085
|
radius = 0.085
|
||||||
height = 0.04
|
height = 0.04
|
||||||
@@ -92,26 +74,26 @@ sides = 16
|
|||||||
cone = true
|
cone = true
|
||||||
material = SubResource("StandardMaterial3D_vlqg6")
|
material = SubResource("StandardMaterial3D_vlqg6")
|
||||||
|
|
||||||
[node name="CSGCombiner3DBuns2" type="CSGCombiner3D" parent="BurgerBunsDispenser/CSGCombiner3D" unique_id=1636439623]
|
[node name="CSGCombiner3DBuns2" type="CSGCombiner3D" parent="BurgerBunsDispenser/CSGCombiner3D" index="2" unique_id=1636439623]
|
||||||
transform = Transform3D(0.42896286, 0, -0.90332216, 0, 1, 0, 0.90332216, 0, 0.42896286, 0.13564643, 1.0341886, 0.20497215)
|
transform = Transform3D(0.42896286, 0, -0.90332216, 0, 1, 0, 0.90332216, 0, 0.42896286, 0.13564643, 1.0341886, 0.20497215)
|
||||||
autosmooth = true
|
autosmooth = true
|
||||||
smoothing_angle = 138.9
|
smoothing_angle = 138.9
|
||||||
|
|
||||||
[node name="CSGCylinder3D2" type="CSGCylinder3D" parent="BurgerBunsDispenser/CSGCombiner3D/CSGCombiner3DBuns2" unique_id=190780737]
|
[node name="CSGCylinder3D2" type="CSGCylinder3D" parent="BurgerBunsDispenser/CSGCombiner3D/CSGCombiner3DBuns2" index="0" unique_id=190780737]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.004122257, 0)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.004122257, 0)
|
||||||
radius = 0.085
|
radius = 0.085
|
||||||
height = 0.04
|
height = 0.04
|
||||||
sides = 16
|
sides = 16
|
||||||
material = SubResource("StandardMaterial3D_vlqg6")
|
material = SubResource("StandardMaterial3D_vlqg6")
|
||||||
|
|
||||||
[node name="CSGCylinder3D3" type="CSGCylinder3D" parent="BurgerBunsDispenser/CSGCombiner3D/CSGCombiner3DBuns2" unique_id=557804311]
|
[node name="CSGCylinder3D3" type="CSGCylinder3D" parent="BurgerBunsDispenser/CSGCombiner3D/CSGCombiner3DBuns2" index="1" unique_id=557804311]
|
||||||
transform = Transform3D(0.82770383, -0.5611652, 0, 0.5611652, 0.82770383, 0, 0, 0, 1, -0.048392475, 0.029736161, 0)
|
transform = Transform3D(0.82770383, -0.5611652, 0, 0.5611652, 0.82770383, 0, 0, 0, 1, -0.048392475, 0.029736161, 0)
|
||||||
radius = 0.085
|
radius = 0.085
|
||||||
height = 0.04
|
height = 0.04
|
||||||
sides = 16
|
sides = 16
|
||||||
material = SubResource("StandardMaterial3D_vlqg6")
|
material = SubResource("StandardMaterial3D_vlqg6")
|
||||||
|
|
||||||
[node name="CSGCylinder3D4" type="CSGCylinder3D" parent="BurgerBunsDispenser/CSGCombiner3D/CSGCombiner3DBuns2/CSGCylinder3D3" unique_id=605379447]
|
[node name="CSGCylinder3D4" type="CSGCylinder3D" parent="BurgerBunsDispenser/CSGCombiner3D/CSGCombiner3DBuns2/CSGCylinder3D3" index="0" unique_id=605379447]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 5.9604645e-08, 0.040259957, 0)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 5.9604645e-08, 0.040259957, 0)
|
||||||
radius = 0.085
|
radius = 0.085
|
||||||
height = 0.04
|
height = 0.04
|
||||||
@@ -119,26 +101,26 @@ sides = 16
|
|||||||
cone = true
|
cone = true
|
||||||
material = SubResource("StandardMaterial3D_vlqg6")
|
material = SubResource("StandardMaterial3D_vlqg6")
|
||||||
|
|
||||||
[node name="CSGCombiner3DBuns3" type="CSGCombiner3D" parent="BurgerBunsDispenser/CSGCombiner3D" unique_id=1594575583]
|
[node name="CSGCombiner3DBuns3" type="CSGCombiner3D" parent="BurgerBunsDispenser/CSGCombiner3D" index="3" unique_id=1594575583]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.17070979, 1.0341885, 0.07147646)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.17070979, 1.0341885, 0.07147646)
|
||||||
autosmooth = true
|
autosmooth = true
|
||||||
smoothing_angle = 138.9
|
smoothing_angle = 138.9
|
||||||
|
|
||||||
[node name="CSGCylinder3D2" type="CSGCylinder3D" parent="BurgerBunsDispenser/CSGCombiner3D/CSGCombiner3DBuns3" unique_id=1686142490]
|
[node name="CSGCylinder3D2" type="CSGCylinder3D" parent="BurgerBunsDispenser/CSGCombiner3D/CSGCombiner3DBuns3" index="0" unique_id=1686142490]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.004122257, 0)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.004122257, 0)
|
||||||
radius = 0.085
|
radius = 0.085
|
||||||
height = 0.04
|
height = 0.04
|
||||||
sides = 16
|
sides = 16
|
||||||
material = SubResource("StandardMaterial3D_vlqg6")
|
material = SubResource("StandardMaterial3D_vlqg6")
|
||||||
|
|
||||||
[node name="CSGCylinder3D3" type="CSGCylinder3D" parent="BurgerBunsDispenser/CSGCombiner3D/CSGCombiner3DBuns3" unique_id=1773290691]
|
[node name="CSGCylinder3D3" type="CSGCylinder3D" parent="BurgerBunsDispenser/CSGCombiner3D/CSGCombiner3DBuns3" index="1" unique_id=1773290691]
|
||||||
transform = Transform3D(0.82770383, -0.5611652, 0, 0.5611652, 0.82770383, 0, 0, 0, 1, -0.048392475, 0.029736161, 0)
|
transform = Transform3D(0.82770383, -0.5611652, 0, 0.5611652, 0.82770383, 0, 0, 0, 1, -0.048392475, 0.029736161, 0)
|
||||||
radius = 0.085
|
radius = 0.085
|
||||||
height = 0.04
|
height = 0.04
|
||||||
sides = 16
|
sides = 16
|
||||||
material = SubResource("StandardMaterial3D_vlqg6")
|
material = SubResource("StandardMaterial3D_vlqg6")
|
||||||
|
|
||||||
[node name="CSGCylinder3D4" type="CSGCylinder3D" parent="BurgerBunsDispenser/CSGCombiner3D/CSGCombiner3DBuns3/CSGCylinder3D3" unique_id=801922493]
|
[node name="CSGCylinder3D4" type="CSGCylinder3D" parent="BurgerBunsDispenser/CSGCombiner3D/CSGCombiner3DBuns3/CSGCylinder3D3" index="0" unique_id=801922493]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 5.9604645e-08, 0.040259957, 0)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 5.9604645e-08, 0.040259957, 0)
|
||||||
radius = 0.085
|
radius = 0.085
|
||||||
height = 0.04
|
height = 0.04
|
||||||
@@ -146,26 +128,26 @@ sides = 16
|
|||||||
cone = true
|
cone = true
|
||||||
material = SubResource("StandardMaterial3D_vlqg6")
|
material = SubResource("StandardMaterial3D_vlqg6")
|
||||||
|
|
||||||
[node name="CSGCombiner3DBuns4" type="CSGCombiner3D" parent="BurgerBunsDispenser/CSGCombiner3D" unique_id=2055085730]
|
[node name="CSGCombiner3DBuns4" type="CSGCombiner3D" parent="BurgerBunsDispenser/CSGCombiner3D" index="4" unique_id=2055085730]
|
||||||
transform = Transform3D(0.95670986, 0, 0.29104328, 0, 1, 0, -0.29104328, 0, 0.95670986, -0.08665481, 1.0341886, -0.10344604)
|
transform = Transform3D(0.95670986, 0, 0.29104328, 0, 1, 0, -0.29104328, 0, 0.95670986, -0.08665481, 1.0341886, -0.10344604)
|
||||||
autosmooth = true
|
autosmooth = true
|
||||||
smoothing_angle = 138.9
|
smoothing_angle = 138.9
|
||||||
|
|
||||||
[node name="CSGCylinder3D2" type="CSGCylinder3D" parent="BurgerBunsDispenser/CSGCombiner3D/CSGCombiner3DBuns4" unique_id=547208858]
|
[node name="CSGCylinder3D2" type="CSGCylinder3D" parent="BurgerBunsDispenser/CSGCombiner3D/CSGCombiner3DBuns4" index="0" unique_id=547208858]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.004122257, 0)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.004122257, 0)
|
||||||
radius = 0.085
|
radius = 0.085
|
||||||
height = 0.04
|
height = 0.04
|
||||||
sides = 16
|
sides = 16
|
||||||
material = SubResource("StandardMaterial3D_vlqg6")
|
material = SubResource("StandardMaterial3D_vlqg6")
|
||||||
|
|
||||||
[node name="CSGCylinder3D3" type="CSGCylinder3D" parent="BurgerBunsDispenser/CSGCombiner3D/CSGCombiner3DBuns4" unique_id=185898007]
|
[node name="CSGCylinder3D3" type="CSGCylinder3D" parent="BurgerBunsDispenser/CSGCombiner3D/CSGCombiner3DBuns4" index="1" unique_id=185898007]
|
||||||
transform = Transform3D(0.82770383, -0.5611652, 0, 0.5611652, 0.82770383, 0, 0, 0, 1, -0.048392475, 0.029736161, 0)
|
transform = Transform3D(0.82770383, -0.5611652, 0, 0.5611652, 0.82770383, 0, 0, 0, 1, -0.048392475, 0.029736161, 0)
|
||||||
radius = 0.085
|
radius = 0.085
|
||||||
height = 0.04
|
height = 0.04
|
||||||
sides = 16
|
sides = 16
|
||||||
material = SubResource("StandardMaterial3D_vlqg6")
|
material = SubResource("StandardMaterial3D_vlqg6")
|
||||||
|
|
||||||
[node name="CSGCylinder3D4" type="CSGCylinder3D" parent="BurgerBunsDispenser/CSGCombiner3D/CSGCombiner3DBuns4/CSGCylinder3D3" unique_id=2117029178]
|
[node name="CSGCylinder3D4" type="CSGCylinder3D" parent="BurgerBunsDispenser/CSGCombiner3D/CSGCombiner3DBuns4/CSGCylinder3D3" index="0" unique_id=2117029178]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 5.9604645e-08, 0.040259957, 0)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 5.9604645e-08, 0.040259957, 0)
|
||||||
radius = 0.085
|
radius = 0.085
|
||||||
height = 0.04
|
height = 0.04
|
||||||
@@ -173,26 +155,26 @@ sides = 16
|
|||||||
cone = true
|
cone = true
|
||||||
material = SubResource("StandardMaterial3D_vlqg6")
|
material = SubResource("StandardMaterial3D_vlqg6")
|
||||||
|
|
||||||
[node name="CSGCombiner3DBuns5" type="CSGCombiner3D" parent="BurgerBunsDispenser/CSGCombiner3D" unique_id=546748728]
|
[node name="CSGCombiner3DBuns5" type="CSGCombiner3D" parent="BurgerBunsDispenser/CSGCombiner3D" index="5" unique_id=546748728]
|
||||||
transform = Transform3D(0.20608562, 0, -0.978534, 0, 1, 0, 0.978534, 0, 0.20608562, -0.047733016, 1.0341886, 0.19433105)
|
transform = Transform3D(0.20608562, 0, -0.978534, 0, 1, 0, 0.978534, 0, 0.20608562, -0.047733016, 1.0341886, 0.19433105)
|
||||||
autosmooth = true
|
autosmooth = true
|
||||||
smoothing_angle = 138.9
|
smoothing_angle = 138.9
|
||||||
|
|
||||||
[node name="CSGCylinder3D2" type="CSGCylinder3D" parent="BurgerBunsDispenser/CSGCombiner3D/CSGCombiner3DBuns5" unique_id=102374914]
|
[node name="CSGCylinder3D2" type="CSGCylinder3D" parent="BurgerBunsDispenser/CSGCombiner3D/CSGCombiner3DBuns5" index="0" unique_id=102374914]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.004122257, 0)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.004122257, 0)
|
||||||
radius = 0.085
|
radius = 0.085
|
||||||
height = 0.04
|
height = 0.04
|
||||||
sides = 16
|
sides = 16
|
||||||
material = SubResource("StandardMaterial3D_vlqg6")
|
material = SubResource("StandardMaterial3D_vlqg6")
|
||||||
|
|
||||||
[node name="CSGCylinder3D3" type="CSGCylinder3D" parent="BurgerBunsDispenser/CSGCombiner3D/CSGCombiner3DBuns5" unique_id=189923990]
|
[node name="CSGCylinder3D3" type="CSGCylinder3D" parent="BurgerBunsDispenser/CSGCombiner3D/CSGCombiner3DBuns5" index="1" unique_id=189923990]
|
||||||
transform = Transform3D(0.82770383, -0.5611652, 0, 0.5611652, 0.82770383, 0, 0, 0, 1, -0.048392475, 0.029736161, 0)
|
transform = Transform3D(0.82770383, -0.5611652, 0, 0.5611652, 0.82770383, 0, 0, 0, 1, -0.048392475, 0.029736161, 0)
|
||||||
radius = 0.085
|
radius = 0.085
|
||||||
height = 0.04
|
height = 0.04
|
||||||
sides = 16
|
sides = 16
|
||||||
material = SubResource("StandardMaterial3D_vlqg6")
|
material = SubResource("StandardMaterial3D_vlqg6")
|
||||||
|
|
||||||
[node name="CSGCylinder3D4" type="CSGCylinder3D" parent="BurgerBunsDispenser/CSGCombiner3D/CSGCombiner3DBuns5/CSGCylinder3D3" unique_id=1980594001]
|
[node name="CSGCylinder3D4" type="CSGCylinder3D" parent="BurgerBunsDispenser/CSGCombiner3D/CSGCombiner3DBuns5/CSGCylinder3D3" index="0" unique_id=1980594001]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 5.9604645e-08, 0.040259957, 0)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 5.9604645e-08, 0.040259957, 0)
|
||||||
radius = 0.085
|
radius = 0.085
|
||||||
height = 0.04
|
height = 0.04
|
||||||
|
|||||||
+44
-73
@@ -1,42 +1,20 @@
|
|||||||
[gd_scene format=3 uid="uid://efaec6ymgabo"]
|
[gd_scene format=3 uid="uid://efaec6ymgabo"]
|
||||||
|
|
||||||
[ext_resource type="PackedScene" uid="uid://cvucwxibtol5f" path="res://stations/StationMovement.tscn" id="1_3jbl6"]
|
|
||||||
[ext_resource type="Script" uid="uid://cquqe4f1m1sw6" path="res://addons/godot-xr-tools/objects/snap_zone.gd" id="1_dlkho"]
|
|
||||||
[ext_resource type="Script" uid="uid://cql13y8da4auf" path="res://stations/counter.gd" id="1_oapbh"]
|
[ext_resource type="Script" uid="uid://cql13y8da4auf" path="res://stations/counter.gd" id="1_oapbh"]
|
||||||
[ext_resource type="AudioStream" uid="uid://bqtk1adk8umbx" path="res://sounds/220197__gameaudio__click-basic.wav" id="2_0aadn"]
|
[ext_resource type="PackedScene" uid="uid://cbs8jiqe8rcmn" path="res://abstract/station.tscn" id="1_station"]
|
||||||
[ext_resource type="AudioStream" uid="uid://daiv8ubwdbidf" path="res://sounds/220195__gameaudio__click-wooden-1.wav" id="2_lg82m"]
|
[ext_resource type="AudioStream" uid="uid://dmyuqe5058sv3" path="res://sounds/220197__gameaudio__click-basic.wav" id="2_0aadn"]
|
||||||
|
[ext_resource type="AudioStream" uid="uid://dllgyc8jh83an" path="res://sounds/220195__gameaudio__click-wooden-1.wav" id="2_lg82m"]
|
||||||
[ext_resource type="PackedScene" uid="uid://dgk88esxip5xi" path="res://items/knife.tscn" id="3_3gvdi"]
|
[ext_resource type="PackedScene" uid="uid://dgk88esxip5xi" path="res://items/knife.tscn" id="3_3gvdi"]
|
||||||
[ext_resource type="PackedScene" uid="uid://bxbocxdaayvwx" path="res://UI/progress_bar.tscn" id="6_racgh"]
|
|
||||||
|
|
||||||
[sub_resource type="SceneReplicationConfig" id="SceneReplicationConfig_3jbl6"]
|
|
||||||
properties/0/path = NodePath("Counter:position")
|
|
||||||
properties/0/spawn = false
|
|
||||||
properties/0/replication_mode = 1
|
|
||||||
properties/1/path = NodePath("Counter:rotation")
|
|
||||||
properties/1/spawn = false
|
|
||||||
properties/1/replication_mode = 1
|
|
||||||
properties/2/path = NodePath("Counter:process_result")
|
|
||||||
properties/2/spawn = false
|
|
||||||
properties/2/replication_mode = 1
|
|
||||||
properties/3/path = NodePath("Counter:process_result_work")
|
|
||||||
properties/3/spawn = false
|
|
||||||
properties/3/replication_mode = 1
|
|
||||||
properties/4/path = NodePath("Counter:work_progress")
|
|
||||||
properties/4/spawn = false
|
|
||||||
properties/4/replication_mode = 1
|
|
||||||
properties/5/path = NodePath("Counter:visible")
|
|
||||||
properties/5/spawn = false
|
|
||||||
properties/5/replication_mode = 1
|
|
||||||
|
|
||||||
[sub_resource type="BoxShape3D" id="BoxShape3D_24d3s"]
|
[sub_resource type="BoxShape3D" id="BoxShape3D_24d3s"]
|
||||||
size = Vector3(0.48521727, 0.040039063, 0.41994628)
|
size = Vector3(0.48521727, 0.040039063, 0.41994628)
|
||||||
|
|
||||||
|
[sub_resource type="BoxShape3D" id="BoxShape3D_3gvdi"]
|
||||||
|
size = Vector3(0.6, 0.9960913, 0.6)
|
||||||
|
|
||||||
[sub_resource type="BoxShape3D" id="BoxShape3D_vlqg6"]
|
[sub_resource type="BoxShape3D" id="BoxShape3D_vlqg6"]
|
||||||
size = Vector3(0.3, 0.05, 0.3)
|
size = Vector3(0.3, 0.05, 0.3)
|
||||||
|
|
||||||
[sub_resource type="BoxShape3D" id="BoxShape3D_1ntq7"]
|
|
||||||
size = Vector3(0.6, 0.12802735, 0.6)
|
|
||||||
|
|
||||||
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_24d3s"]
|
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_24d3s"]
|
||||||
albedo_color = Color(0.49, 0.3854667, 0.29400003, 1)
|
albedo_color = Color(0.49, 0.3854667, 0.29400003, 1)
|
||||||
|
|
||||||
@@ -46,114 +24,107 @@ albedo_color = Color(0.66595805, 0.53976387, 0.4331022, 1)
|
|||||||
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_vlqg6"]
|
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_vlqg6"]
|
||||||
albedo_color = Color(1.1759251, 0.741115, 0.5692133, 1)
|
albedo_color = Color(1.1759251, 0.741115, 0.5692133, 1)
|
||||||
|
|
||||||
[node name="Counter" type="Node3D" unique_id=672880121]
|
[node name="Counter" unique_id=707500902 instance=ExtResource("1_station")]
|
||||||
|
|
||||||
[node name="StationMovement" parent="." unique_id=946873975 node_paths=PackedStringArray("station") instance=ExtResource("1_3jbl6")]
|
[node name="StationMovement" parent="." index="0" unique_id=946873975 node_paths=PackedStringArray("station")]
|
||||||
station = NodePath("../Counter")
|
station = NodePath("../Counter")
|
||||||
|
|
||||||
[node name="MultiplayerSynchronizer" type="MultiplayerSynchronizer" parent="." unique_id=1583772931]
|
[node name="ProgressBar3D" parent="." index="4" unique_id=654673176]
|
||||||
replication_config = SubResource("SceneReplicationConfig_3jbl6")
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.2838624, -0.18)
|
||||||
|
|
||||||
[node name="Counter" type="StaticBody3D" parent="." unique_id=1487893288 node_paths=PackedStringArray("audio", "knife", "progress_bar") groups=["station"]]
|
[node name="SnapZone" parent="." index="5" unique_id=1315859105]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.0647464, 0)
|
||||||
|
collision_layer = 65536
|
||||||
|
stash_sound = ExtResource("2_0aadn")
|
||||||
|
snap_mode = 1
|
||||||
|
|
||||||
|
[node name="Counter" type="StaticBody3D" parent="." index="6" unique_id=1487893288 node_paths=PackedStringArray("audio", "knife", "progress_bar", "notification_audio", "ambient_audio", "snap_zone", "synchronizer") groups=["station"]]
|
||||||
script = ExtResource("1_oapbh")
|
script = ExtResource("1_oapbh")
|
||||||
audio = NodePath("AudioStreamPlayer3D")
|
audio = NodePath("AudioStreamPlayer3D")
|
||||||
chop_audio = ExtResource("2_lg82m")
|
chop_audio = ExtResource("2_lg82m")
|
||||||
knife = NodePath("Knife")
|
knife = NodePath("Knife")
|
||||||
progress_bar = NodePath("ProgressBar3D")
|
progress_bar = NodePath("../ProgressBar3D")
|
||||||
|
pickup_sound = ExtResource("2_0aadn")
|
||||||
|
drop_sound = ExtResource("2_0aadn")
|
||||||
|
notification_audio = NodePath("../AudioStreamPlayer3DNotification")
|
||||||
|
ambient_audio = NodePath("../AudioStreamPlayer3DAmbient")
|
||||||
|
snap_zone = NodePath("../SnapZone")
|
||||||
|
synchronizer = NodePath("../MultiplayerSynchronizer")
|
||||||
|
|
||||||
[node name="CollisionShape3DCuttingBoard" type="CollisionShape3D" parent="Counter" unique_id=706340473]
|
[node name="CollisionShape3DCuttingBoard" type="CollisionShape3D" parent="Counter" index="0" unique_id=706340473]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.00088502467, 1.0178218, 0.0009101778)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.00088502467, 1.0178218, 0.0009101778)
|
||||||
shape = SubResource("BoxShape3D_24d3s")
|
shape = SubResource("BoxShape3D_24d3s")
|
||||||
|
|
||||||
[node name="CollisionShape3DCounter" type="CollisionShape3D" parent="Counter" unique_id=895680269]
|
[node name="CollisionShape3DCounter" type="CollisionShape3D" parent="Counter" index="1" unique_id=895680269]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.5038623, 0)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.5070981, 0)
|
||||||
shape = SubResource("BoxShape3D_24d3s")
|
shape = SubResource("BoxShape3D_3gvdi")
|
||||||
|
|
||||||
[node name="AudioStreamPlayer3D" type="AudioStreamPlayer3D" parent="Counter" unique_id=1941838513]
|
[node name="AudioStreamPlayer3D" type="AudioStreamPlayer3D" parent="Counter" index="2" unique_id=1941838513]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.5038623, 0)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.5038623, 0)
|
||||||
|
|
||||||
[node name="GestureArea" type="Area3D" parent="Counter" unique_id=398687137]
|
[node name="GestureArea" type="Area3D" parent="Counter" index="3" unique_id=398687137]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.0438623, 0)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.0438623, 0)
|
||||||
collision_layer = 0
|
collision_layer = 0
|
||||||
collision_mask = 65536
|
collision_mask = 65536
|
||||||
|
|
||||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="Counter/GestureArea" unique_id=1450988028]
|
[node name="CollisionShape3D" type="CollisionShape3D" parent="Counter/GestureArea" index="0" unique_id=1450988028]
|
||||||
shape = SubResource("BoxShape3D_vlqg6")
|
shape = SubResource("BoxShape3D_vlqg6")
|
||||||
|
|
||||||
[node name="Knife" parent="Counter" unique_id=1675596942 instance=ExtResource("3_3gvdi")]
|
[node name="Knife" parent="Counter" index="4" unique_id=1675596942 instance=ExtResource("3_3gvdi")]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.2838624, 0)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.2838624, 0)
|
||||||
|
gravity_scale = 0.0
|
||||||
freeze = true
|
freeze = true
|
||||||
release_mode = 1
|
release_mode = 1
|
||||||
|
|
||||||
[node name="XRToolsSnapZone" type="Area3D" parent="Counter" unique_id=1647380272 groups=["station_zone"]]
|
[node name="CSGCombiner3D" type="CSGCombiner3D" parent="Counter" index="5" unique_id=451757283]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.0647464, 0)
|
|
||||||
collision_layer = 65536
|
|
||||||
collision_mask = 65540
|
|
||||||
script = ExtResource("1_dlkho")
|
|
||||||
stash_sound = ExtResource("2_0aadn")
|
|
||||||
snap_mode = 1
|
|
||||||
metadata/_custom_type_script = "uid://cquqe4f1m1sw6"
|
|
||||||
|
|
||||||
[node name="CollisionShape3D2" type="CollisionShape3D" parent="Counter/XRToolsSnapZone" unique_id=969340130]
|
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.002, 0)
|
|
||||||
shape = SubResource("BoxShape3D_1ntq7")
|
|
||||||
|
|
||||||
[node name="AudioStreamPlayer3D" type="AudioStreamPlayer3D" parent="Counter/XRToolsSnapZone" unique_id=1786831079]
|
|
||||||
|
|
||||||
[node name="ProgressBar3D" parent="Counter" unique_id=654673176 instance=ExtResource("6_racgh")]
|
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.2838624, -0.18)
|
|
||||||
|
|
||||||
[node name="CSGCombiner3D" type="CSGCombiner3D" parent="Counter" unique_id=451757283]
|
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.5038623, 0)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.5038623, 0)
|
||||||
|
|
||||||
[node name="CSGBox3D" type="CSGBox3D" parent="Counter/CSGCombiner3D" unique_id=305755330]
|
[node name="CSGBox3D" type="CSGBox3D" parent="Counter/CSGCombiner3D" index="0" unique_id=305755330]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.046, -0.025)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.046, -0.025)
|
||||||
size = Vector3(0.6, 0.908, 0.55)
|
size = Vector3(0.6, 0.908, 0.55)
|
||||||
material = SubResource("StandardMaterial3D_24d3s")
|
material = SubResource("StandardMaterial3D_24d3s")
|
||||||
|
|
||||||
[node name="CSGBox3D7" type="CSGBox3D" parent="Counter/CSGCombiner3D" unique_id=1086568272]
|
[node name="CSGBox3D7" type="CSGBox3D" parent="Counter/CSGCombiner3D" index="1" unique_id=1086568272]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.39999902, 0.22965088)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.39999902, 0.22965088)
|
||||||
operation = 2
|
operation = 2
|
||||||
size = Vector3(0.6, 0.22992969, 0.14069825)
|
size = Vector3(0.6, 0.22992969, 0.14069825)
|
||||||
material = SubResource("StandardMaterial3D_24d3s")
|
material = SubResource("StandardMaterial3D_24d3s")
|
||||||
|
|
||||||
[node name="CSGBox3D2" type="CSGBox3D" parent="Counter/CSGCombiner3D" unique_id=43663195]
|
[node name="CSGBox3D2" type="CSGBox3D" parent="Counter/CSGCombiner3D" index="2" unique_id=43663195]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.5, 0)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.5, 0)
|
||||||
size = Vector3(0.6, 0.202, 0.6)
|
size = Vector3(0.6, 0.202, 0.6)
|
||||||
|
|
||||||
[node name="CSGBox3D3" type="CSGBox3D" parent="Counter/CSGCombiner3D" unique_id=1210567516]
|
[node name="CSGBox3D3" type="CSGBox3D" parent="Counter/CSGCombiner3D" index="3" unique_id=1210567516]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.5617909, 0.060281754)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.5617909, 0.060281754)
|
||||||
operation = 2
|
operation = 2
|
||||||
size = Vector3(0.6, 0.12051563, 0.6402156)
|
size = Vector3(0.6, 0.12051563, 0.6402156)
|
||||||
|
|
||||||
[node name="CSGBox3D4" type="CSGBox3D" parent="Counter/CSGCombiner3D" unique_id=1533996708]
|
[node name="CSGBox3D4" type="CSGBox3D" parent="Counter/CSGCombiner3D" index="4" unique_id=1533996708]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.15, 0.08, 0.26034504)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.15, 0.08, 0.26034504)
|
||||||
size = Vector3(0.25, 0.6, 0.024)
|
size = Vector3(0.25, 0.6, 0.024)
|
||||||
material = SubResource("StandardMaterial3D_pt8vn")
|
material = SubResource("StandardMaterial3D_pt8vn")
|
||||||
|
|
||||||
[node name="CSGBox3D5" type="CSGBox3D" parent="Counter/CSGCombiner3D" unique_id=1983709234]
|
[node name="CSGBox3D5" type="CSGBox3D" parent="Counter/CSGCombiner3D" index="5" unique_id=1983709234]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.15, 0.08, 0.26034504)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.15, 0.08, 0.26034504)
|
||||||
size = Vector3(0.25, 0.6, 0.024)
|
size = Vector3(0.25, 0.6, 0.024)
|
||||||
material = SubResource("StandardMaterial3D_pt8vn")
|
material = SubResource("StandardMaterial3D_pt8vn")
|
||||||
|
|
||||||
[node name="CSGSphere3D" type="CSGSphere3D" parent="Counter/CSGCombiner3D" unique_id=1785057925]
|
[node name="CSGSphere3D" type="CSGSphere3D" parent="Counter/CSGCombiner3D" index="6" unique_id=1785057925]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.057649717, 0.12459713, 0.29140875)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.057649717, 0.12459713, 0.29140875)
|
||||||
radius = 0.025492515
|
radius = 0.025492515
|
||||||
|
|
||||||
[node name="CSGSphere3D2" type="CSGSphere3D" parent="Counter/CSGCombiner3D" unique_id=1224446005]
|
[node name="CSGSphere3D2" type="CSGSphere3D" parent="Counter/CSGCombiner3D" index="7" unique_id=1224446005]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.060837455, 0.12459713, 0.29140875)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.060837455, 0.12459713, 0.29140875)
|
||||||
radius = 0.025492515
|
radius = 0.025492515
|
||||||
|
|
||||||
[node name="CSGBox3D6" type="CSGBox3D" parent="Counter/CSGCombiner3D" unique_id=187377667]
|
[node name="CSGBox3D6" type="CSGBox3D" parent="Counter/CSGCombiner3D" index="8" unique_id=187377667]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.514, 0)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.514, 0)
|
||||||
size = Vector3(0.48251343, 0.037231445, 0.42160034)
|
size = Vector3(0.48251343, 0.037231445, 0.42160034)
|
||||||
material = SubResource("StandardMaterial3D_vlqg6")
|
material = SubResource("StandardMaterial3D_vlqg6")
|
||||||
|
|
||||||
[node name="CSGBox3D6" type="CSGBox3D" parent="Counter/CSGCombiner3D/CSGBox3D6" unique_id=1146824846]
|
[node name="CSGBox3D6" type="CSGBox3D" parent="Counter/CSGCombiner3D/CSGBox3D6" index="0" unique_id=1146824846]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.1899699, 0.01924485, -0.0039587095)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.1899699, 0.01924485, -0.0039587095)
|
||||||
operation = 2
|
operation = 2
|
||||||
size = Vector3(0.037109375, 0.092285156, 0.26757813)
|
size = Vector3(0.037109375, 0.092285156, 0.26757813)
|
||||||
|
|
||||||
[connection signal="body_entered" from="Counter/GestureArea" to="Counter" method="_on_gesture_area_body_entered"]
|
[connection signal="body_entered" from="Counter/GestureArea" to="Counter" method="_on_gesture_area_body_entered"]
|
||||||
[connection signal="has_dropped" from="Counter/XRToolsSnapZone" to="Counter" method="_on_snap_zone_dropped"]
|
|
||||||
[connection signal="has_picked_up" from="Counter/XRToolsSnapZone" to="Counter" method="_on_snap_zone_picked_up"]
|
|
||||||
|
|||||||
+46
-79
@@ -1,40 +1,15 @@
|
|||||||
[gd_scene format=3 uid="uid://j7caslh27nor"]
|
[gd_scene format=3 uid="uid://b052o1fgwq5bw"]
|
||||||
|
|
||||||
|
[ext_resource type="PackedScene" uid="uid://cbs8jiqe8rcmn" path="res://abstract/station.tscn" id="1_2p1q6"]
|
||||||
[ext_resource type="Script" uid="uid://bsn8vhv5adxdo" path="res://stations/hob.gd" id="1_7jc4g"]
|
[ext_resource type="Script" uid="uid://bsn8vhv5adxdo" path="res://stations/hob.gd" id="1_7jc4g"]
|
||||||
[ext_resource type="PackedScene" uid="uid://cvucwxibtol5f" path="res://stations/StationMovement.tscn" id="1_pydjp"]
|
[ext_resource type="AudioStream" uid="uid://dmyuqe5058sv3" path="res://sounds/220197__gameaudio__click-basic.wav" id="3_l0sax"]
|
||||||
[ext_resource type="Script" uid="uid://cquqe4f1m1sw6" path="res://addons/godot-xr-tools/objects/snap_zone.gd" id="2_er1dp"]
|
|
||||||
[ext_resource type="AudioStream" uid="uid://dmyuqe5058sv3" path="res://sounds/220197__gameaudio__click-basic.wav" id="3_6oyg1"]
|
|
||||||
[ext_resource type="PackedScene" uid="uid://bxbocxdaayvwx" path="res://UI/progress_bar.tscn" id="3_7uuqv"]
|
|
||||||
[ext_resource type="Material" uid="uid://d1djvskv4n4m3" path="res://textures/hob_off.tres" id="4_8qpxk"]
|
[ext_resource type="Material" uid="uid://d1djvskv4n4m3" path="res://textures/hob_off.tres" id="4_8qpxk"]
|
||||||
[ext_resource type="Material" uid="uid://db7c7w4apwti7" path="res://textures/hob_on.tres" id="6_m7l4u"]
|
[ext_resource type="Material" uid="uid://db7c7w4apwti7" path="res://textures/hob_on.tres" id="6_m7l4u"]
|
||||||
|
|
||||||
[sub_resource type="SceneReplicationConfig" id="SceneReplicationConfig_np_hob"]
|
[sub_resource type="BoxShape3D" id="BoxShape3D_l0sax"]
|
||||||
properties/0/path = NodePath("Hob:time_cooked")
|
|
||||||
properties/0/spawn = false
|
|
||||||
properties/0/replication_mode = 1
|
|
||||||
properties/1/path = NodePath("Hob:cooking_result")
|
|
||||||
properties/1/spawn = false
|
|
||||||
properties/1/replication_mode = 1
|
|
||||||
properties/2/path = NodePath("Hob:cooking_result_time")
|
|
||||||
properties/2/spawn = false
|
|
||||||
properties/2/replication_mode = 1
|
|
||||||
properties/3/path = NodePath("Hob:position")
|
|
||||||
properties/3/spawn = false
|
|
||||||
properties/3/replication_mode = 1
|
|
||||||
properties/4/path = NodePath("Hob:rotation")
|
|
||||||
properties/4/spawn = false
|
|
||||||
properties/4/replication_mode = 1
|
|
||||||
properties/5/path = NodePath("Hob:visible")
|
|
||||||
properties/5/spawn = false
|
|
||||||
properties/5/replication_mode = 1
|
|
||||||
|
|
||||||
[sub_resource type="BoxShape3D" id="BoxShape3D_kdxnr"]
|
|
||||||
size = Vector3(0.6, 1, 0.6)
|
size = Vector3(0.6, 1, 0.6)
|
||||||
|
|
||||||
[sub_resource type="BoxShape3D" id="BoxShape3D_7uuqv"]
|
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_bmu77"]
|
||||||
size = Vector3(0.6, 0.12802735, 0.6)
|
|
||||||
|
|
||||||
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_gkb3v"]
|
|
||||||
|
|
||||||
[sub_resource type="Animation" id="Animation_7uuqv"]
|
[sub_resource type="Animation" id="Animation_7uuqv"]
|
||||||
length = 0.001
|
length = 0.001
|
||||||
@@ -163,134 +138,126 @@ tracks/4/keys = {
|
|||||||
"values": [1.0, 0.0, 1.0]
|
"values": [1.0, 0.0, 1.0]
|
||||||
}
|
}
|
||||||
|
|
||||||
[sub_resource type="AnimationLibrary" id="AnimationLibrary_ac5f3"]
|
[sub_resource type="AnimationLibrary" id="AnimationLibrary_pydjp"]
|
||||||
_data = {
|
_data = {
|
||||||
&"RESET": SubResource("Animation_7uuqv"),
|
&"RESET": SubResource("Animation_7uuqv"),
|
||||||
&"hob": SubResource("Animation_6oyg1")
|
&"hob": SubResource("Animation_6oyg1")
|
||||||
}
|
}
|
||||||
|
|
||||||
[node name="Hob" type="Node3D" unique_id=172418174]
|
[node name="Hob" unique_id=707500902 instance=ExtResource("1_2p1q6")]
|
||||||
|
|
||||||
[node name="StationMovement" parent="." unique_id=946873975 node_paths=PackedStringArray("station") instance=ExtResource("1_pydjp")]
|
[node name="StationMovement" parent="." index="0" unique_id=946873975 node_paths=PackedStringArray("station")]
|
||||||
station = NodePath("../Hob")
|
station = NodePath("../Hob")
|
||||||
|
|
||||||
[node name="MultiplayerSynchronizer" type="MultiplayerSynchronizer" parent="." unique_id=768992259]
|
[node name="ProgressBar3D" parent="." index="4" unique_id=654673176]
|
||||||
replication_config = SubResource("SceneReplicationConfig_np_hob")
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.2, -0.18)
|
||||||
|
|
||||||
[node name="Hob" type="StaticBody3D" parent="." unique_id=1332123047 groups=["station"]]
|
[node name="SnapZone" parent="." index="5" unique_id=1315859105]
|
||||||
script = ExtResource("1_7jc4g")
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.048892, 0)
|
||||||
|
|
||||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="Hob" unique_id=1283846023]
|
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.51483154, 0)
|
|
||||||
shape = SubResource("BoxShape3D_kdxnr")
|
|
||||||
|
|
||||||
[node name="XRToolsSnapZone" type="Area3D" parent="Hob" unique_id=538157739 groups=["station_zone"]]
|
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.0418437, 0)
|
|
||||||
collision_layer = 65536
|
|
||||||
collision_mask = 65540
|
|
||||||
script = ExtResource("2_er1dp")
|
|
||||||
stash_sound = ExtResource("3_6oyg1")
|
|
||||||
snap_mode = 1
|
snap_mode = 1
|
||||||
metadata/_custom_type_script = "uid://cquqe4f1m1sw6"
|
|
||||||
|
|
||||||
[node name="CollisionShape3D2" type="CollisionShape3D" parent="Hob/XRToolsSnapZone" unique_id=370920392]
|
[node name="Hob" type="StaticBody3D" parent="." index="6" unique_id=732560156 node_paths=PackedStringArray("animation_player", "progress_bar", "notification_audio", "ambient_audio", "snap_zone", "synchronizer") groups=["station"]]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.000975132, 0)
|
script = ExtResource("1_7jc4g")
|
||||||
shape = SubResource("BoxShape3D_7uuqv")
|
animation_player = NodePath("AnimationPlayer")
|
||||||
|
progress_bar = NodePath("../ProgressBar3D")
|
||||||
|
pickup_sound = ExtResource("3_l0sax")
|
||||||
|
drop_sound = ExtResource("3_l0sax")
|
||||||
|
notification_audio = NodePath("../AudioStreamPlayer3DNotification")
|
||||||
|
ambient_audio = NodePath("../AudioStreamPlayer3DAmbient")
|
||||||
|
snap_zone = NodePath("../SnapZone")
|
||||||
|
synchronizer = NodePath("../MultiplayerSynchronizer")
|
||||||
|
|
||||||
[node name="AudioStreamPlayer3D" type="AudioStreamPlayer3D" parent="Hob/XRToolsSnapZone" unique_id=1991627595]
|
[node name="CollisionShape3D" type="CollisionShape3D" parent="Hob" index="0" unique_id=3886639]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.022546828, -0.5270121, 0.36528283)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.51483154, 0)
|
||||||
stream = ExtResource("3_6oyg1")
|
shape = SubResource("BoxShape3D_l0sax")
|
||||||
|
|
||||||
[node name="ProgressBar3D" parent="Hob" unique_id=654673176 instance=ExtResource("3_7uuqv")]
|
[node name="CSGCombiner3D" type="CSGCombiner3D" parent="Hob" index="1" unique_id=1047451362]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.2621956, -0.09216304)
|
|
||||||
|
|
||||||
[node name="CSGCombiner3D" type="CSGCombiner3D" parent="Hob" unique_id=70901698]
|
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.51483154, 0)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.51483154, 0)
|
||||||
|
|
||||||
[node name="CSGBox3D" type="CSGBox3D" parent="Hob/CSGCombiner3D" unique_id=1111505172]
|
[node name="CSGBox3D" type="CSGBox3D" parent="Hob/CSGCombiner3D" index="0" unique_id=797498087]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.00071543455, 3.7252903e-09, -0.008516133)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.00071543455, 3.7252903e-09, -0.008516133)
|
||||||
size = Vector3(0.6, 1, 0.5821045)
|
size = Vector3(0.6, 1, 0.5821045)
|
||||||
|
|
||||||
[node name="CSGCylinder3D" type="CSGCylinder3D" parent="Hob/CSGCombiner3D/CSGBox3D" unique_id=1338463939]
|
[node name="CSGCylinder3D" type="CSGCylinder3D" parent="Hob/CSGCombiner3D/CSGBox3D" index="0" unique_id=1788217430]
|
||||||
transform = Transform3D(0.8943019, 0, 0, 0, 0.8943019, 0, 0, 0, 0.8943019, 0, 0.5103538, -7.827557e-05)
|
transform = Transform3D(0.8943019, 0, 0, 0, 0.8943019, 0, 0, 0, 0.8943019, 0, 0.5103538, -7.827557e-05)
|
||||||
operation = 2
|
operation = 2
|
||||||
radius = 0.25976563
|
radius = 0.25976563
|
||||||
height = 0.08898926
|
height = 0.08898926
|
||||||
sides = 32
|
sides = 32
|
||||||
|
|
||||||
[node name="CSGTorus3D3" type="CSGTorus3D" parent="Hob/CSGCombiner3D" unique_id=666891341]
|
[node name="CSGTorus3D3" type="CSGTorus3D" parent="Hob/CSGCombiner3D" index="1" unique_id=1365654856]
|
||||||
transform = Transform3D(0.8943019, 0, 0, 0, 0.8943019, 0, 0, 0, 0.8943019, 0, 0.5003869, -7.827557e-05)
|
transform = Transform3D(0.8943019, 0, 0, 0, 0.8943019, 0, 0, 0, 0.8943019, 0, 0.5003869, -7.827557e-05)
|
||||||
inner_radius = 0.09153879
|
inner_radius = 0.09153879
|
||||||
outer_radius = 0.120084204
|
outer_radius = 0.120084204
|
||||||
sides = 32
|
sides = 32
|
||||||
material = ExtResource("4_8qpxk")
|
material = ExtResource("4_8qpxk")
|
||||||
|
|
||||||
[node name="CSGTorus3D2" type="CSGTorus3D" parent="Hob/CSGCombiner3D" unique_id=24541894]
|
[node name="CSGTorus3D2" type="CSGTorus3D" parent="Hob/CSGCombiner3D" index="2" unique_id=2113291709]
|
||||||
transform = Transform3D(0.8943019, 0, 0, 0, 0.8943019, 0, 0, 0, 0.8943019, 0, 0.5003869, -7.827557e-05)
|
transform = Transform3D(0.8943019, 0, 0, 0, 0.8943019, 0, 0, 0, 0.8943019, 0, 0.5003869, -7.827557e-05)
|
||||||
inner_radius = 0.15036294
|
inner_radius = 0.15036294
|
||||||
outer_radius = 0.17592031
|
outer_radius = 0.17592031
|
||||||
sides = 32
|
sides = 32
|
||||||
material = ExtResource("4_8qpxk")
|
material = ExtResource("4_8qpxk")
|
||||||
|
|
||||||
[node name="CSGTorus3D" type="CSGTorus3D" parent="Hob/CSGCombiner3D" unique_id=1901978664]
|
[node name="CSGTorus3D" type="CSGTorus3D" parent="Hob/CSGCombiner3D" index="3" unique_id=196825717]
|
||||||
transform = Transform3D(0.8943019, 0, 0, 0, 0.8943019, 0, 0, 0, 0.8943019, 0, 0.5003869, -7.827557e-05)
|
transform = Transform3D(0.8943019, 0, 0, 0, 0.8943019, 0, 0, 0, 0.8943019, 0, 0.5003869, -7.827557e-05)
|
||||||
inner_radius = 0.20426142
|
inner_radius = 0.20426142
|
||||||
outer_radius = 0.2321898
|
outer_radius = 0.2321898
|
||||||
sides = 32
|
sides = 32
|
||||||
material = ExtResource("4_8qpxk")
|
material = ExtResource("4_8qpxk")
|
||||||
|
|
||||||
[node name="CSGCylinder3D" type="CSGCylinder3D" parent="Hob/CSGCombiner3D" unique_id=1107239311]
|
[node name="CSGCylinder3D" type="CSGCylinder3D" parent="Hob/CSGCombiner3D" index="4" unique_id=893001662]
|
||||||
transform = Transform3D(0.8943019, 0, 0, 0, 0.8943019, 0, 0, 0, 0.8943019, 0, 0.4498226, -7.827557e-05)
|
transform = Transform3D(0.8943019, 0, 0, 0, 0.8943019, 0, 0, 0, 0.8943019, 0, 0.4498226, -7.827557e-05)
|
||||||
radius = 0.071777344
|
radius = 0.071777344
|
||||||
height = 0.09637451
|
height = 0.09637451
|
||||||
sides = 32
|
sides = 32
|
||||||
|
|
||||||
[node name="CSGCylinder3D2" type="CSGCylinder3D" parent="Hob/CSGCombiner3D" unique_id=435540815]
|
[node name="CSGCylinder3D2" type="CSGCylinder3D" parent="Hob/CSGCombiner3D" index="5" unique_id=1086831704]
|
||||||
transform = Transform3D(0.8943019, 0, 0, 0, -3.9091177e-08, 0.8943019, 0, -0.8943019, -3.9091177e-08, 0, 0.48668858, -0.0020651226)
|
transform = Transform3D(0.8943019, 0, 0, 0, -3.9091177e-08, 0.8943019, 0, -0.8943019, -3.9091177e-08, 0, 0.48668858, -0.0020651226)
|
||||||
radius = 0.008
|
radius = 0.008
|
||||||
height = 0.44487303
|
height = 0.44487303
|
||||||
|
|
||||||
[node name="CSGCylinder3D3" type="CSGCylinder3D" parent="Hob/CSGCombiner3D" unique_id=878171801]
|
[node name="CSGCylinder3D3" type="CSGCylinder3D" parent="Hob/CSGCombiner3D" index="6" unique_id=145519146]
|
||||||
transform = Transform3D(-3.9091177e-08, -0.8943019, -3.9091177e-08, 0, -3.9091177e-08, 0.8943019, -0.8943019, 3.9091177e-08, 1.7087296e-15, 0, 0.48668858, -0.0020651226)
|
transform = Transform3D(-3.9091177e-08, -0.8943019, -3.9091177e-08, 0, -3.9091177e-08, 0.8943019, -0.8943019, 3.9091177e-08, 1.7087296e-15, 0, 0.48668858, -0.0020651226)
|
||||||
radius = 0.008
|
radius = 0.008
|
||||||
height = 0.44487303
|
height = 0.44487303
|
||||||
|
|
||||||
[node name="CSGCylinder3D4" type="CSGCylinder3D" parent="Hob/CSGCombiner3D" unique_id=1619646436]
|
[node name="CSGCylinder3D4" type="CSGCylinder3D" parent="Hob/CSGCombiner3D" index="7" unique_id=905149123]
|
||||||
transform = Transform3D(1, 0, 0, 0, -4.371139e-08, 1, 0, -1, -4.371139e-08, -0.20412213, 0.42728558, 0.26171687)
|
transform = Transform3D(1, 0, 0, 0, -4.371139e-08, 1, 0, -1, -4.371139e-08, -0.20412213, 0.42728558, 0.26171687)
|
||||||
radius = 0.044433594
|
radius = 0.044433594
|
||||||
height = 0.10932617
|
height = 0.10932617
|
||||||
material = SubResource("StandardMaterial3D_gkb3v")
|
material = SubResource("StandardMaterial3D_bmu77")
|
||||||
|
|
||||||
[node name="CSGCylinder3D5" type="CSGCylinder3D" parent="Hob/CSGCombiner3D" unique_id=548846612]
|
[node name="CSGCylinder3D5" type="CSGCylinder3D" parent="Hob/CSGCombiner3D" index="8" unique_id=2028954364]
|
||||||
transform = Transform3D(1, 0, 0, 0, -4.371139e-08, 1, 0, -1, -4.371139e-08, 0.12531614, 0.42728558, 0.26171687)
|
transform = Transform3D(1, 0, 0, 0, -4.371139e-08, 1, 0, -1, -4.371139e-08, 0.12531614, 0.42728558, 0.26171687)
|
||||||
radius = 0.044433594
|
radius = 0.044433594
|
||||||
height = 0.10932617
|
height = 0.10932617
|
||||||
material = SubResource("StandardMaterial3D_gkb3v")
|
material = SubResource("StandardMaterial3D_bmu77")
|
||||||
|
|
||||||
[node name="CSGCylinder3D6" type="CSGCylinder3D" parent="Hob/CSGCombiner3D" unique_id=1208989647]
|
[node name="CSGCylinder3D6" type="CSGCylinder3D" parent="Hob/CSGCombiner3D" index="9" unique_id=1588021797]
|
||||||
transform = Transform3D(1, 0, 0, 0, -4.371139e-08, 1, 0, -1, -4.371139e-08, 0.22979808, 0.42728558, 0.26171687)
|
transform = Transform3D(1, 0, 0, 0, -4.371139e-08, 1, 0, -1, -4.371139e-08, 0.22979808, 0.42728558, 0.26171687)
|
||||||
radius = 0.044433594
|
radius = 0.044433594
|
||||||
height = 0.10932617
|
height = 0.10932617
|
||||||
material = SubResource("StandardMaterial3D_gkb3v")
|
material = SubResource("StandardMaterial3D_bmu77")
|
||||||
|
|
||||||
[node name="CSGBox3D2" type="CSGBox3D" parent="Hob/CSGCombiner3D" unique_id=465340362]
|
[node name="CSGBox3D2" type="CSGBox3D" parent="Hob/CSGCombiner3D" index="10" unique_id=1620789236]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.039733887, -0.07685089, 0.29250562)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.039733887, -0.07685089, 0.29250562)
|
||||||
operation = 2
|
operation = 2
|
||||||
size = Vector3(1.0999756, 0.8462982, 0.072387695)
|
size = Vector3(1.0999756, 0.8462982, 0.072387695)
|
||||||
|
|
||||||
[node name="CSGBox3D3" type="CSGBox3D" parent="Hob/CSGCombiner3D" unique_id=1813079759]
|
[node name="CSGBox3D3" type="CSGBox3D" parent="Hob/CSGCombiner3D" index="11" unique_id=1140499039]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.003479004, -0.08253479, 0.2656765)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.003479004, -0.08253479, 0.2656765)
|
||||||
size = Vector3(0.55, 0.835, 0.072)
|
size = Vector3(0.55, 0.835, 0.072)
|
||||||
|
|
||||||
[node name="CSGBox3D4" type="CSGBox3D" parent="Hob/CSGCombiner3D" unique_id=1978186019]
|
[node name="CSGBox3D4" type="CSGBox3D" parent="Hob/CSGCombiner3D" index="12" unique_id=923397574]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.003479004, -0.45215607, 0.24655426)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.003479004, -0.45215607, 0.24655426)
|
||||||
size = Vector3(0.55, 0.096, 0.14)
|
size = Vector3(0.55, 0.096, 0.14)
|
||||||
|
|
||||||
[node name="AnimationPlayer" type="AnimationPlayer" parent="Hob" unique_id=1525460719]
|
[node name="AnimationPlayer" type="AnimationPlayer" parent="Hob" index="2" unique_id=1592340772]
|
||||||
root_node = NodePath("../..")
|
root_node = NodePath("../..")
|
||||||
libraries/ = SubResource("AnimationLibrary_ac5f3")
|
libraries/ = SubResource("AnimationLibrary_pydjp")
|
||||||
|
|
||||||
[node name="OmniLight3D" type="OmniLight3D" parent="Hob" unique_id=1618457623]
|
[node name="OmniLight3D" type="OmniLight3D" parent="Hob" index="3" unique_id=2050713654]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.0201802, 0)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.0201802, 0)
|
||||||
light_color = Color(1, 0.13725491, 0, 1)
|
light_color = Color(1, 0.13725491, 0, 1)
|
||||||
light_energy = 0.0
|
light_energy = 0.0
|
||||||
|
|||||||
+67
-113
@@ -1,4 +1,5 @@
|
|||||||
extends StaticBody3D
|
class_name Counter
|
||||||
|
extends WorkStation
|
||||||
|
|
||||||
@export var chop_work_steps: float = 5.0
|
@export var chop_work_steps: float = 5.0
|
||||||
@export var chop_min_speed: float = 2.0
|
@export var chop_min_speed: float = 2.0
|
||||||
@@ -6,92 +7,54 @@ extends StaticBody3D
|
|||||||
@export var audio: AudioStreamPlayer3D
|
@export var audio: AudioStreamPlayer3D
|
||||||
@export var chop_audio: AudioStream
|
@export var chop_audio: AudioStream
|
||||||
@export var knife: XRToolsPickable
|
@export var knife: XRToolsPickable
|
||||||
@onready var snap_zone: XRToolsSnapZone = $XRToolsSnapZone
|
|
||||||
@export var progress_bar: ProgressBar3D
|
|
||||||
|
|
||||||
# Chopping state. Follow the hob/sink pattern so the display refreshes when
|
|
||||||
# values change; only the world owner runs the station's process in practice.
|
|
||||||
@export var process_result: String = "": set = _set_result
|
|
||||||
@export var process_result_work: float = 0.0: set = _set_result_work
|
|
||||||
@export var work_progress: float = 0.0: set = _set_work_progress
|
|
||||||
|
|
||||||
|
|
||||||
func _ready() -> void:
|
func _ready() -> void:
|
||||||
|
super.ready()
|
||||||
|
SweetLogger.debug("Counter {0} _ready", [name])
|
||||||
if not audio:
|
if not audio:
|
||||||
push_error("Counter is missing reference to AudioStreamPlayer3D")
|
SweetLogger.warning("{0} missing audio reference", [name])
|
||||||
if not chop_audio:
|
if not chop_audio:
|
||||||
push_error("Counter is missing reference to chop_audio AudioStream")
|
SweetLogger.warning("{0} missing chop_audio reference", [name])
|
||||||
if not progress_bar or progress_bar is not ProgressBar3D:
|
if not knife:
|
||||||
push_error("Counter missing reference to progressbar, or wrong type:", progress_bar)
|
SweetLogger.warning("{0} missing knife reference", [name])
|
||||||
if not knife or knife is not XRToolsPickable:
|
_disable_all_tools()
|
||||||
push_error("Counter missing reference to knife, or wrong type:", knife)
|
|
||||||
if not snap_zone or snap_zone is not XRToolsSnapZone:
|
|
||||||
push_error("Counter missing reference to snap_zone, or wrong type:", snap_zone)
|
|
||||||
|
|
||||||
snap_zone.has_picked_up.connect(_on_object_picked_up)
|
|
||||||
snap_zone.has_dropped.connect(_on_object_dropped)
|
|
||||||
progress_bar.override_fill_color(Color.GREEN)
|
|
||||||
_hide_all_tools()
|
|
||||||
_refresh_progress_bar()
|
|
||||||
|
|
||||||
|
|
||||||
func _set_work_progress(value: float) -> void:
|
func _start_chopping(id: String, work: float) -> void:
|
||||||
work_progress = value
|
if not enabled:
|
||||||
_refresh_progress_bar()
|
|
||||||
|
|
||||||
|
|
||||||
func _set_result(value: String) -> void:
|
|
||||||
process_result = value
|
|
||||||
_refresh_progress_bar()
|
|
||||||
# When a chopping recipe is set, show the knife for the player to use.
|
|
||||||
if not process_result.is_empty():
|
|
||||||
knife.visible = true
|
|
||||||
knife.enabled = true
|
|
||||||
SweetLogger.debug("chopping recipe set: {0}", [process_result])
|
|
||||||
else:
|
|
||||||
_hide_all_tools()
|
|
||||||
|
|
||||||
|
|
||||||
func _set_result_work(value: float) -> void:
|
|
||||||
process_result_work = value
|
|
||||||
_refresh_progress_bar()
|
|
||||||
|
|
||||||
|
|
||||||
func _refresh_progress_bar() -> void:
|
|
||||||
if not progress_bar:
|
|
||||||
return
|
return
|
||||||
var progress := 0.0
|
result_id = id
|
||||||
if process_result != "" and process_result_work > 0:
|
max_work = work
|
||||||
progress = clampf(float(work_progress) / process_result_work, 0.0, 1.0)
|
SweetLogger.info("Start chopping - result_id: {0}, max_work: {1}", [result_id, max_work])
|
||||||
|
|
||||||
progress_bar.set_progress(progress)
|
|
||||||
progress_bar.set_bar_visible(not process_result.is_empty())
|
|
||||||
progress_bar.override_fill_color(Color.GREEN)
|
|
||||||
|
|
||||||
|
|
||||||
# Add work from gesture area (knife hits). This increments the chopping progress.
|
func _process(delta: float) -> void:
|
||||||
func add_work(work: float) -> void:
|
super.process(delta)
|
||||||
SweetLogger.debug("add_work: {0}", [work])
|
|
||||||
# Only the world owner should drive the authoritative state. Guarding is
|
|
||||||
# handled by higher-level NetworkManager logic elsewhere, mirror hob's
|
func _enable_tool(_item: XRToolsPickable):
|
||||||
# convert_held_to_item which checks ownership before spawning.
|
SweetLogger.debug("Enable tool {0} on {1}", [_item.name, name])
|
||||||
work_progress += work
|
_item.visible = true
|
||||||
# Play chopping sound if available
|
_item.get_node("NetPickable").set_tool_enabled(true)
|
||||||
if audio and chop_audio:
|
|
||||||
audio.stream = chop_audio
|
|
||||||
audio.play()
|
func _disable_tool(_item: XRToolsPickable):
|
||||||
# If we've reached the required time, convert the held item
|
SweetLogger.debug("Disable tool {0} on {1}", [_item.name, name])
|
||||||
if process_result != "" and process_result_work > 0 and work_progress >= process_result_work:
|
_item.visible = false
|
||||||
SweetLogger.debug("chopping complete, converting item to: {0}", [process_result])
|
_item.get_node("NetPickable").set_tool_enabled(false)
|
||||||
work_progress = 0
|
|
||||||
convert_held_to_item(process_result)
|
func _disable_all_tools():
|
||||||
|
SweetLogger.debug("Disable all tools on {0}", [name])
|
||||||
|
_disable_tool(knife)
|
||||||
|
|
||||||
|
|
||||||
func _on_gesture_area_body_entered(body: Node3D) -> void:
|
func _on_gesture_area_body_entered(body: Node3D) -> void:
|
||||||
SweetLogger.debug("gesture area entered: {0}", [body])
|
SweetLogger.debug("Gesture area entered: {0}", [body])
|
||||||
if body.is_in_group("chopping_tool"):
|
if not body.is_in_group("chopping_tool"):
|
||||||
if process_result == "":
|
return
|
||||||
SweetLogger.debug("knife entered but nothing to chop")
|
if result_id == "":
|
||||||
|
SweetLogger.debug("Knife entered but nothing to chop")
|
||||||
return
|
return
|
||||||
|
|
||||||
var speed := 0.0
|
var speed := 0.0
|
||||||
@@ -101,56 +64,47 @@ func _on_gesture_area_body_entered(body: Node3D) -> void:
|
|||||||
speed = body.velocity.length()
|
speed = body.velocity.length()
|
||||||
|
|
||||||
if speed < chop_min_speed:
|
if speed < chop_min_speed:
|
||||||
SweetLogger.debug("knife too slow for chopping: {0}", [speed])
|
SweetLogger.debug("Knife too slow for chopping: {0}", [speed])
|
||||||
return
|
return
|
||||||
|
|
||||||
|
if audio and chop_audio:
|
||||||
|
audio.stream = chop_audio
|
||||||
|
audio.play()
|
||||||
|
|
||||||
add_work(chop_work_steps)
|
add_work(chop_work_steps)
|
||||||
|
|
||||||
|
|
||||||
func _on_object_picked_up(_item: Variant) -> void:
|
# Called from Station base class
|
||||||
SweetLogger.debug("object picked up: {0}", [_item])
|
func refresh_display() -> void:
|
||||||
var food_item = Helper.find_food_item(_item)
|
super.refresh_display()
|
||||||
if not food_item:
|
progress_bar.override_fill_color(Color.GREEN)
|
||||||
SweetLogger.debug("held object is not a FoodItem")
|
|
||||||
return
|
|
||||||
|
|
||||||
|
|
||||||
|
# Called from Station base class
|
||||||
|
func on_food_item_picked_up(food_item: FoodItem) -> void:
|
||||||
|
SweetLogger.debug("Object picked up: {0}", [food_item])
|
||||||
|
|
||||||
|
if not food_item:
|
||||||
|
SweetLogger.debug("Held object is not a FoodItem")
|
||||||
|
return
|
||||||
var result = RecipeManager.get_chopping_result(food_item.id)
|
var result = RecipeManager.get_chopping_result(food_item.id)
|
||||||
if not result:
|
if not result:
|
||||||
SweetLogger.debug("held a FoodItem that is not choppable, id: {0} process_result: {1}", [food_item.id, result])
|
SweetLogger.debug("Held a FoodItem that is not choppable, id: {0} result: {1}", [food_item.id, result])
|
||||||
return
|
return
|
||||||
|
|
||||||
process_result = result
|
_enable_tool(knife)
|
||||||
process_result_work = RecipeManager.get_chopping_work(food_item.id)
|
_start_chopping(result, RecipeManager.get_chopping_work(food_item.id))
|
||||||
SweetLogger.debug("set process_result {0} work: {1}", [process_result, process_result_work])
|
|
||||||
|
|
||||||
|
|
||||||
func _on_object_dropped(_item: Variant) -> void:
|
# Called from Station base class
|
||||||
SweetLogger.debug("object drop")
|
func on_object_dropped(_item: Node3D) -> void:
|
||||||
work_progress = 0
|
SweetLogger.debug("->[]")
|
||||||
process_result = ""
|
_disable_all_tools()
|
||||||
process_result_work = 0
|
reset()
|
||||||
_hide_all_tools()
|
|
||||||
|
|
||||||
|
|
||||||
func convert_held_to_item(_item: String) -> void:
|
# Called from Station base class
|
||||||
if not NetworkManager.owns_world():
|
func on_work_complete():
|
||||||
return
|
SweetLogger.debug("->[]")
|
||||||
SweetLogger.debug("converting {0}", [_item])
|
_disable_all_tools()
|
||||||
|
convert_item()
|
||||||
var old_pickable = snap_zone.picked_up_object
|
|
||||||
if not old_pickable:
|
|
||||||
push_warning("Counter finished processing _item, but snap zone is missing its reference")
|
|
||||||
return
|
|
||||||
|
|
||||||
var original_transform = old_pickable.global_transform
|
|
||||||
var new_scene_instance = NetworkManager.spawn_item(RecipeManager.get_item_scene(_item).resource_path, original_transform)
|
|
||||||
|
|
||||||
SweetLogger.debug("freeing old_pickable {0}", [old_pickable])
|
|
||||||
snap_zone.drop_object()
|
|
||||||
NetworkManager.despawn_item(old_pickable)
|
|
||||||
snap_zone.pick_up_object(new_scene_instance)
|
|
||||||
|
|
||||||
|
|
||||||
func _hide_all_tools():
|
|
||||||
knife.visible = false
|
|
||||||
knife.enabled = false
|
|
||||||
|
|||||||
@@ -1,25 +1,11 @@
|
|||||||
[gd_scene format=3 uid="uid://bbg7dwsbxxh1t"]
|
[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="Script" uid="uid://0y6wnjcsum6" path="res://stations/item_dispenser.gd" id="1_4m60m"]
|
||||||
[ext_resource type="PackedScene" uid="uid://cvucwxibtol5f" path="res://stations/StationMovement.tscn" id="1_qooyy"]
|
[ext_resource type="PackedScene" uid="uid://cbs8jiqe8rcmn" path="res://abstract/station.tscn" id="1_station"]
|
||||||
[ext_resource type="PackedScene" uid="uid://e4i6o5oriecx" path="res://items/PickupCube.tscn" id="2_nn8tr"]
|
[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="AudioStream" uid="uid://dmyuqe5058sv3" path="res://sounds/220197__gameaudio__click-basic.wav" id="4_0wtc7"]
|
||||||
[ext_resource type="PackedScene" uid="uid://mpapt5mkbuao" path="res://prefabs/slide_off_dome.tscn" id="4_nn8tr"]
|
[ext_resource type="PackedScene" uid="uid://mpapt5mkbuao" path="res://prefabs/slide_off_dome.tscn" id="4_nn8tr"]
|
||||||
|
|
||||||
[sub_resource type="SceneReplicationConfig" id="SceneReplicationConfig_0wtc7"]
|
|
||||||
properties/0/path = NodePath("CubeSideDispenser:position")
|
|
||||||
properties/0/spawn = false
|
|
||||||
properties/0/replication_mode = 1
|
|
||||||
properties/1/path = NodePath("CubeSideDispenser:rotation")
|
|
||||||
properties/1/spawn = false
|
|
||||||
properties/1/replication_mode = 1
|
|
||||||
properties/2/path = NodePath("CubeSideDispenser:visible")
|
|
||||||
properties/2/spawn = false
|
|
||||||
properties/2/replication_mode = 1
|
|
||||||
|
|
||||||
[sub_resource type="SphereShape3D" id="SphereShape3D_xmbo2"]
|
|
||||||
radius = 0.3
|
|
||||||
|
|
||||||
[sub_resource type="CylinderShape3D" id="CylinderShape3D_24d3s"]
|
[sub_resource type="CylinderShape3D" id="CylinderShape3D_24d3s"]
|
||||||
height = 1.0
|
height = 1.0
|
||||||
radius = 0.29541016
|
radius = 0.29541016
|
||||||
@@ -31,66 +17,62 @@ albedo_color = Color(0.1764706, 1, 1, 1)
|
|||||||
material = SubResource("StandardMaterial3D_24d3s")
|
material = SubResource("StandardMaterial3D_24d3s")
|
||||||
size = Vector3(0.1, 0.1, 0.1)
|
size = Vector3(0.1, 0.1, 0.1)
|
||||||
|
|
||||||
[node name="CubeSideDispenser" type="Node3D" unique_id=1285718741]
|
[node name="CubeSideDispenser" unique_id=707500902 instance=ExtResource("1_station")]
|
||||||
|
|
||||||
[node name="StationMovement" parent="." unique_id=946873975 node_paths=PackedStringArray("station") instance=ExtResource("1_qooyy")]
|
[node name="StationMovement" parent="." index="0" unique_id=946873975 node_paths=PackedStringArray("station")]
|
||||||
station = NodePath("../CubeSideDispenser")
|
station = NodePath("../CubeSideDispenser")
|
||||||
|
|
||||||
[node name="MultiplayerSynchronizer" type="MultiplayerSynchronizer" parent="." unique_id=821487160]
|
[node name="SnapZone" parent="." index="5" unique_id=1315859105]
|
||||||
replication_config = SubResource("SceneReplicationConfig_0wtc7")
|
|
||||||
|
|
||||||
[node name="CubeSideDispenser" type="StaticBody3D" parent="." unique_id=200950572 groups=["station"]]
|
|
||||||
script = ExtResource("1_4m60m")
|
|
||||||
item_scene = ExtResource("2_nn8tr")
|
|
||||||
|
|
||||||
[node name="XRToolsSnapZone" type="Area3D" parent="CubeSideDispenser" unique_id=1018021004 groups=["station_zone"]]
|
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.00070536137, 1.0440714, -0.002165556)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.00070536137, 1.0440714, -0.002165556)
|
||||||
collision_layer = 65536
|
collision_layer = 65536
|
||||||
collision_mask = 65536
|
collision_mask = 65536
|
||||||
script = ExtResource("3_ahn1e")
|
|
||||||
snap_mode = 1
|
snap_mode = 1
|
||||||
metadata/_custom_type_script = "uid://cquqe4f1m1sw6"
|
|
||||||
|
|
||||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="CubeSideDispenser/XRToolsSnapZone" unique_id=182042233]
|
[node name="CubeSideDispenser" type="StaticBody3D" parent="." index="6" unique_id=200950572 node_paths=PackedStringArray("notification_audio", "ambient_audio", "snap_zone", "synchronizer") groups=["station"]]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.15291119, 0)
|
script = ExtResource("1_4m60m")
|
||||||
shape = SubResource("SphereShape3D_xmbo2")
|
item_scene = ExtResource("2_nn8tr")
|
||||||
|
pickup_sound = ExtResource("4_0wtc7")
|
||||||
|
notification_audio = NodePath("../AudioStreamPlayer3DNotification")
|
||||||
|
ambient_audio = NodePath("../AudioStreamPlayer3DAmbient")
|
||||||
|
snap_zone = NodePath("../SnapZone")
|
||||||
|
synchronizer = NodePath("../MultiplayerSynchronizer")
|
||||||
|
|
||||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="CubeSideDispenser" unique_id=1974757539]
|
[node name="CollisionShape3D" type="CollisionShape3D" parent="CubeSideDispenser" index="0" unique_id=1974757539]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.5, 0)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.5, 0)
|
||||||
shape = SubResource("CylinderShape3D_24d3s")
|
shape = SubResource("CylinderShape3D_24d3s")
|
||||||
|
|
||||||
[node name="SlideOffDome" parent="CubeSideDispenser" unique_id=1427609426 instance=ExtResource("4_nn8tr")]
|
[node name="SlideOffDome" parent="CubeSideDispenser" index="1" unique_id=1427609426 instance=ExtResource("4_nn8tr")]
|
||||||
|
|
||||||
[node name="CSGCombiner3D" type="CSGCombiner3D" parent="CubeSideDispenser" unique_id=1172420592]
|
[node name="CSGCombiner3D" type="CSGCombiner3D" parent="CubeSideDispenser" index="2" unique_id=1172420592]
|
||||||
|
|
||||||
[node name="CSGCylinder3D" type="CSGCylinder3D" parent="CubeSideDispenser/CSGCombiner3D" unique_id=1073546772]
|
[node name="CSGCylinder3D" type="CSGCylinder3D" parent="CubeSideDispenser/CSGCombiner3D" index="0" unique_id=1073546772]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.5, 0)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.5, 0)
|
||||||
radius = 0.3
|
radius = 0.3
|
||||||
height = 1.0
|
height = 1.0
|
||||||
sides = 32
|
sides = 32
|
||||||
|
|
||||||
[node name="Cubes" type="Node3D" parent="CubeSideDispenser" unique_id=100532970]
|
[node name="Cubes" type="Node3D" parent="CubeSideDispenser" index="3" unique_id=100532970]
|
||||||
|
|
||||||
[node name="MeshInstance3D" type="MeshInstance3D" parent="CubeSideDispenser/Cubes" unique_id=2040729886]
|
[node name="MeshInstance3D" type="MeshInstance3D" parent="CubeSideDispenser/Cubes" index="0" unique_id=2040729886]
|
||||||
transform = Transform3D(0.9709369, 0, 0.23933554, 0, 1, 0, -0.23933554, 0, 0.9709369, -0.0038359165, 1.0421022, -0.1349423)
|
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")
|
mesh = SubResource("BoxMesh_irf4n")
|
||||||
|
|
||||||
[node name="MeshInstance3D2" type="MeshInstance3D" parent="CubeSideDispenser/Cubes" unique_id=2119335322]
|
[node name="MeshInstance3D2" type="MeshInstance3D" parent="CubeSideDispenser/Cubes" index="1" unique_id=2119335322]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.1336323, 1.0421022, 0.049409628)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.1336323, 1.0421022, 0.049409628)
|
||||||
mesh = SubResource("BoxMesh_irf4n")
|
mesh = SubResource("BoxMesh_irf4n")
|
||||||
|
|
||||||
[node name="MeshInstance3D3" type="MeshInstance3D" parent="CubeSideDispenser/Cubes" unique_id=896999260]
|
[node name="MeshInstance3D3" type="MeshInstance3D" parent="CubeSideDispenser/Cubes" index="2" unique_id=896999260]
|
||||||
transform = Transform3D(0.94914126, 0, -0.31485054, 0, 1, 0, 0.31485054, 0, 0.94914126, 0.021345377, 1.0421022, 0.13508391)
|
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")
|
mesh = SubResource("BoxMesh_irf4n")
|
||||||
|
|
||||||
[node name="MeshInstance3D4" type="MeshInstance3D" parent="CubeSideDispenser/Cubes" unique_id=1055210121]
|
[node name="MeshInstance3D4" type="MeshInstance3D" parent="CubeSideDispenser/Cubes" index="3" unique_id=1055210121]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.14830339, 1.0421022, 0.054090023)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.14830339, 1.0421022, 0.054090023)
|
||||||
mesh = SubResource("BoxMesh_irf4n")
|
mesh = SubResource("BoxMesh_irf4n")
|
||||||
|
|
||||||
[node name="MeshInstance3D5" type="MeshInstance3D" parent="CubeSideDispenser/Cubes" unique_id=1800524097]
|
[node name="MeshInstance3D5" type="MeshInstance3D" parent="CubeSideDispenser/Cubes" index="4" unique_id=1800524097]
|
||||||
transform = Transform3D(0.966823, 0, -0.2554472, 0, 1, 0, 0.2554472, 0, 0.966823, 0.12695658, 1.0421022, -0.07926583)
|
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")
|
mesh = SubResource("BoxMesh_irf4n")
|
||||||
|
|
||||||
[node name="MeshInstance3D6" type="MeshInstance3D" parent="CubeSideDispenser/Cubes" unique_id=192094054]
|
[node name="MeshInstance3D6" type="MeshInstance3D" parent="CubeSideDispenser/Cubes" index="5" unique_id=192094054]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.11111963, 1.0421022, -0.094003916)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.11111963, 1.0421022, -0.094003916)
|
||||||
mesh = SubResource("BoxMesh_irf4n")
|
mesh = SubResource("BoxMesh_irf4n")
|
||||||
|
|||||||
@@ -1,19 +1,19 @@
|
|||||||
extends StaticBody3D
|
class_name DirtStation
|
||||||
|
extends Station
|
||||||
|
|
||||||
@onready var snap_zone: XRToolsSnapZone = $XRToolsSnapZone
|
|
||||||
|
|
||||||
# Called when the node enters the scene tree for the first time.
|
|
||||||
func _ready() -> void:
|
func _ready() -> void:
|
||||||
snap_zone.has_picked_up.connect(_makeDirty)
|
super.ready()
|
||||||
|
SweetLogger.debug("DirtStation {0} _ready", [name])
|
||||||
|
|
||||||
func _makeDirty(item) -> void:
|
|
||||||
|
# Called from Station base class
|
||||||
|
func on_object_picked_up(item: Node3D) -> void:
|
||||||
if not NetworkManager.owns_world():
|
if not NetworkManager.owns_world():
|
||||||
return
|
return
|
||||||
var plate: PlateController = item.get_node_or_null("PlateController") as PlateController
|
var plate: PlateController = item.get_node_or_null("PlateController") as PlateController
|
||||||
if not plate:
|
if not plate:
|
||||||
SweetLogger.debug("held object is not a Plate")
|
SweetLogger.debug("Held object is not a Plate")
|
||||||
return
|
return
|
||||||
if not plate.is_dirty:
|
if not plate.is_dirty:
|
||||||
plate.is_dirty = true
|
plate.is_dirty = true
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+18
-37
@@ -1,19 +1,8 @@
|
|||||||
[gd_scene format=3 uid="uid://cnjwtnhwh0i8q"]
|
[gd_scene format=3 uid="uid://cnjwtnhwh0i8q"]
|
||||||
|
|
||||||
[ext_resource type="Script" uid="uid://q7tpwmrbmu1m" path="res://stations/dirt_station.gd" id="1_hc1d4"]
|
[ext_resource type="Script" uid="uid://q7tpwmrbmu1m" path="res://stations/dirt_station.gd" id="1_hc1d4"]
|
||||||
[ext_resource type="PackedScene" uid="uid://cvucwxibtol5f" path="res://stations/StationMovement.tscn" id="1_ucg2q"]
|
[ext_resource type="PackedScene" uid="uid://cbs8jiqe8rcmn" path="res://abstract/station.tscn" id="1_station"]
|
||||||
[ext_resource type="Script" uid="uid://cquqe4f1m1sw6" path="res://addons/godot-xr-tools/objects/snap_zone.gd" id="2_v0ytd"]
|
[ext_resource type="AudioStream" uid="uid://dmyuqe5058sv3" path="res://sounds/220197__gameaudio__click-basic.wav" id="3_ucg2q"]
|
||||||
|
|
||||||
[sub_resource type="SceneReplicationConfig" id="SceneReplicationConfig_ku4h3"]
|
|
||||||
properties/0/path = NodePath(".:position")
|
|
||||||
properties/0/spawn = false
|
|
||||||
properties/0/replication_mode = 1
|
|
||||||
properties/1/path = NodePath(".:rotation")
|
|
||||||
properties/1/spawn = false
|
|
||||||
properties/1/replication_mode = 1
|
|
||||||
properties/2/path = NodePath(".:visible")
|
|
||||||
properties/2/spawn = false
|
|
||||||
properties/2/replication_mode = 1
|
|
||||||
|
|
||||||
[sub_resource type="BoxShape3D" id="BoxShape3D_24d3s"]
|
[sub_resource type="BoxShape3D" id="BoxShape3D_24d3s"]
|
||||||
size = Vector3(0.5, 1, 0.5)
|
size = Vector3(0.5, 1, 0.5)
|
||||||
@@ -25,41 +14,33 @@ albedo_color = Color(0.45262197, 0.26770625, 0.2601587, 1)
|
|||||||
material = SubResource("StandardMaterial3D_qn1ku")
|
material = SubResource("StandardMaterial3D_qn1ku")
|
||||||
size = Vector3(0.5, 1, 0.5)
|
size = Vector3(0.5, 1, 0.5)
|
||||||
|
|
||||||
[sub_resource type="BoxShape3D" id="BoxShape3D_mep2a"]
|
[node name="DirtStation" unique_id=707500902 instance=ExtResource("1_station")]
|
||||||
size = Vector3(0.81640625, 0.5635376, 0.79351807)
|
|
||||||
|
|
||||||
[node name="DirtStation" type="Node3D" unique_id=784427347]
|
[node name="StationMovement" parent="." index="0" unique_id=946873975 node_paths=PackedStringArray("station")]
|
||||||
|
|
||||||
[node name="StationMovement" parent="." unique_id=946873975 node_paths=PackedStringArray("station") instance=ExtResource("1_ucg2q")]
|
|
||||||
station = NodePath("../DirtStation")
|
station = NodePath("../DirtStation")
|
||||||
|
|
||||||
[node name="MultiplayerSynchronizer" type="MultiplayerSynchronizer" parent="." unique_id=1485614825]
|
[node name="SnapZone" parent="." index="5" unique_id=1315859105]
|
||||||
root_path = NodePath("../DirtStation")
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.0313971, 0)
|
||||||
replication_config = SubResource("SceneReplicationConfig_ku4h3")
|
collision_layer = 65536
|
||||||
|
snap_mode = 1
|
||||||
|
|
||||||
[node name="DirtStation" type="StaticBody3D" parent="." unique_id=160842153 groups=["station"]]
|
[node name="DirtStation" type="StaticBody3D" parent="." index="6" unique_id=160842153 node_paths=PackedStringArray("notification_audio", "ambient_audio", "snap_zone", "synchronizer") groups=["station"]]
|
||||||
script = ExtResource("1_hc1d4")
|
script = ExtResource("1_hc1d4")
|
||||||
|
pickup_sound = ExtResource("3_ucg2q")
|
||||||
|
drop_sound = ExtResource("3_ucg2q")
|
||||||
|
notification_audio = NodePath("../AudioStreamPlayer3DNotification")
|
||||||
|
ambient_audio = NodePath("../AudioStreamPlayer3DAmbient")
|
||||||
|
snap_zone = NodePath("../SnapZone")
|
||||||
|
synchronizer = NodePath("../MultiplayerSynchronizer")
|
||||||
|
|
||||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="DirtStation" unique_id=1400366312]
|
[node name="CollisionShape3D" type="CollisionShape3D" parent="DirtStation" index="0" unique_id=1400366312]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.5, 0)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.5, 0)
|
||||||
shape = SubResource("BoxShape3D_24d3s")
|
shape = SubResource("BoxShape3D_24d3s")
|
||||||
|
|
||||||
[node name="MeshInstance3D" type="MeshInstance3D" parent="DirtStation/CollisionShape3D" unique_id=55726639]
|
[node name="MeshInstance3D" type="MeshInstance3D" parent="DirtStation/CollisionShape3D" index="0" unique_id=55726639]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.008318901, 0, -0.022509098)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.008318901, 0, -0.022509098)
|
||||||
mesh = SubResource("BoxMesh_ay2w6")
|
mesh = SubResource("BoxMesh_ay2w6")
|
||||||
|
|
||||||
[node name="Label3D" type="Label3D" parent="DirtStation/CollisionShape3D" unique_id=1251766743]
|
[node name="Label3D" type="Label3D" parent="DirtStation/CollisionShape3D" index="1" unique_id=1251766743]
|
||||||
transform = Transform3D(0.9999992, 0, 0, 0, 0.99999946, 0, 0, 0, 0.9999992, 0.002797456, 0.6309581, -0.2812457)
|
transform = Transform3D(0.9999992, 0, 0, 0, 0.99999946, 0, 0, 0, 0.9999992, 0.002797456, 0.6309581, -0.2812457)
|
||||||
text = "Dirt"
|
text = "Dirt"
|
||||||
|
|
||||||
[node name="XRToolsSnapZone" type="Area3D" parent="DirtStation" unique_id=333161027 groups=["station_zone"]]
|
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.0313971, 0)
|
|
||||||
collision_layer = 65536
|
|
||||||
collision_mask = 65540
|
|
||||||
script = ExtResource("2_v0ytd")
|
|
||||||
snap_mode = 1
|
|
||||||
metadata/_custom_type_script = "uid://cquqe4f1m1sw6"
|
|
||||||
|
|
||||||
[node name="CollisionShape3D2" type="CollisionShape3D" parent="DirtStation/XRToolsSnapZone" unique_id=1398712192]
|
|
||||||
transform = Transform3D(0.5, 0, 0, 0, 0.5, 0, 0, 0, 0.5, 0.008666992, -0.11009073, -0.009353638)
|
|
||||||
shape = SubResource("BoxShape3D_mep2a")
|
|
||||||
|
|||||||
+52
-113
@@ -1,127 +1,66 @@
|
|||||||
extends StaticBody3D
|
class_name Hob
|
||||||
|
extends WorkStation
|
||||||
|
|
||||||
@export var cook_speed = 1
|
@export var cook_speed = 1
|
||||||
@onready var snap_zone: XRToolsSnapZone = $XRToolsSnapZone
|
|
||||||
@onready var progress_bar: ProgressBar3D = $ProgressBar3D
|
|
||||||
|
|
||||||
## Cooking state. All three are replicated (see Hob.tscn's Sync node) and each
|
@export var animation_player: AnimationPlayer
|
||||||
## refreshes the display when it changes, which is what makes the hob look alive
|
|
||||||
## on a client: only the world owner runs the station's _process and its snap
|
|
||||||
## zone, so a client never reaches the code below by itself and would otherwise
|
|
||||||
## show a hob that never lights up.
|
|
||||||
@export var time_cooked: float = 0.0: set = _set_time_cooked
|
|
||||||
@export var cooking_result: String = "": set = _set_cooking_result
|
|
||||||
@export var cooking_result_time: float = 0.0: set = _set_cooking_result_time
|
|
||||||
|
|
||||||
|
|
||||||
func _set_time_cooked(value: float) -> void:
|
|
||||||
if is_equal_approx(time_cooked, value):
|
|
||||||
return
|
|
||||||
time_cooked = value
|
|
||||||
_refresh_display()
|
|
||||||
|
|
||||||
|
|
||||||
func _set_cooking_result(value: String) -> void:
|
|
||||||
if cooking_result == value:
|
|
||||||
return
|
|
||||||
cooking_result = value
|
|
||||||
_refresh_display()
|
|
||||||
# The flames follow whether we're cooking, on every peer.
|
|
||||||
_play_animation("hob" if not cooking_result.is_empty() else "RESET")
|
|
||||||
|
|
||||||
|
|
||||||
func _set_cooking_result_time(value: float) -> void:
|
|
||||||
if is_equal_approx(cooking_result_time, value):
|
|
||||||
return
|
|
||||||
cooking_result_time = value
|
|
||||||
_refresh_display()
|
|
||||||
|
|
||||||
|
|
||||||
func _ready() -> void:
|
func _ready() -> void:
|
||||||
if not progress_bar or progress_bar is not ProgressBar3D:
|
super.ready()
|
||||||
push_error("Hob missing reference to progressbar, or wrong type:", progress_bar)
|
SweetLogger.debug("Hob {0} _ready", [name])
|
||||||
snap_zone.has_picked_up.connect(_on_object_picked_up)
|
if not animation_player:
|
||||||
snap_zone.has_dropped.connect(_on_object_dropped)
|
SweetLogger.warning("{0} missing animation_player reference", [name])
|
||||||
_refresh_display()
|
|
||||||
|
|
||||||
|
func _start_cooking(id: String, work: float) -> void:
|
||||||
func _play_animation(name: String) -> void:
|
animation_player.play("hob")
|
||||||
# Replicated setters can fire before the node is in the tree (spawn payload),
|
if not enabled:
|
||||||
# when the @onready children don't exist yet.
|
|
||||||
var player := get_node_or_null("AnimationPlayer") as AnimationPlayer
|
|
||||||
if player:
|
|
||||||
player.play(name)
|
|
||||||
|
|
||||||
|
|
||||||
func _refresh_display() -> void:
|
|
||||||
# Guarded for the same reason as _play_animation.
|
|
||||||
if not progress_bar:
|
|
||||||
return
|
|
||||||
var progress := 0.0
|
|
||||||
if cooking_result and cooking_result_time > 0:
|
|
||||||
progress = clampf(float(time_cooked) / cooking_result_time, 0.0, 1.0)
|
|
||||||
|
|
||||||
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:
|
|
||||||
SweetLogger.debug("object picked up: {0}", [_item])
|
|
||||||
|
|
||||||
# Find the CookableItem in held object
|
|
||||||
var _food_item = _item.get_node_or_null("FoodItem") as FoodItem
|
|
||||||
if not _food_item:
|
|
||||||
SweetLogger.debug("held object is not a FoodItem")
|
|
||||||
return
|
|
||||||
var result = RecipeManager.get_cooking_result(_food_item.id)
|
|
||||||
if not result:
|
|
||||||
SweetLogger.debug("held a FoodItem that is not cookable, id: {0} result: {1}", [_food_item.id, result])
|
|
||||||
return
|
return
|
||||||
|
|
||||||
cooking_result = result
|
result_id = id
|
||||||
cooking_result_time = RecipeManager.get_cooking_time(_food_item.id)
|
max_work = work
|
||||||
SweetLogger.debug("set cooking_result {0}", [cooking_result])
|
SweetLogger.info("Start cooking - result_id: {0}, max_work: {1}", [result_id, max_work])
|
||||||
# The setters above already refresh the display and start the flames.
|
# The flames follow whether we're cooking, on every peer.
|
||||||
|
|
||||||
|
|
||||||
func _on_object_dropped(_item) -> void:
|
|
||||||
SweetLogger.debug("object drop")
|
|
||||||
time_cooked = 0
|
|
||||||
cooking_result = ""
|
|
||||||
cooking_result_time = 0
|
|
||||||
|
|
||||||
|
|
||||||
func convert_held_to_item(_item: String) -> void:
|
|
||||||
if not NetworkManager.owns_world():
|
|
||||||
return
|
|
||||||
SweetLogger.debug("converting {0}", [_item])
|
|
||||||
|
|
||||||
var old_pickable = snap_zone.picked_up_object
|
|
||||||
if not old_pickable:
|
|
||||||
push_warning("Hob finished cooking _item, but snap zone is missing its reference")
|
|
||||||
return
|
|
||||||
|
|
||||||
# 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(RecipeManager.get_item_scene(_item).resource_path, original_transform)
|
|
||||||
|
|
||||||
# Drop and free the old item and pick up the new one
|
|
||||||
SweetLogger.debug("freeing old_pickable {0}", [old_pickable])
|
|
||||||
snap_zone.drop_object()
|
|
||||||
NetworkManager.despawn_item(old_pickable)
|
|
||||||
snap_zone.pick_up_object(new_scene_instance)
|
|
||||||
|
|
||||||
|
|
||||||
# If cooking something, progress cooking, when done, convert item
|
|
||||||
func _process(delta: float) -> void:
|
func _process(delta: float) -> void:
|
||||||
if cooking_result:
|
super.process(delta)
|
||||||
#print("Hob cooking_result: ", cooking_result)
|
if not enabled:
|
||||||
time_cooked += cook_speed * delta
|
return
|
||||||
_refresh_display()
|
if result_id:
|
||||||
if time_cooked >= cooking_result_time:
|
add_work(cook_speed * delta)
|
||||||
time_cooked = 0
|
|
||||||
convert_held_to_item(cooking_result)
|
|
||||||
|
|
||||||
|
|
||||||
|
# Called from Station base class
|
||||||
|
func refresh_display() -> void:
|
||||||
|
super.refresh_display()
|
||||||
|
progress_bar.override_fill_color(Color.RED if result_id == "charcoal" else Color.GREEN)
|
||||||
|
|
||||||
|
|
||||||
|
# Called from Station base class
|
||||||
|
func on_food_item_picked_up(food_item: FoodItem) -> void:
|
||||||
|
SweetLogger.debug("Object picked up: {0}", [food_item])
|
||||||
|
|
||||||
|
if not food_item:
|
||||||
|
SweetLogger.debug("Held object is not a FoodItem")
|
||||||
|
return
|
||||||
|
var result = RecipeManager.get_cooking_result(food_item.id)
|
||||||
|
if not result:
|
||||||
|
SweetLogger.debug("Held a FoodItem that is not cookable, id: {0} result: {1}", [food_item.id, result])
|
||||||
|
return
|
||||||
|
|
||||||
|
_start_cooking(result, RecipeManager.get_cooking_time(food_item.id))
|
||||||
|
|
||||||
|
|
||||||
|
# Called from Station base class
|
||||||
|
func on_food_item_dropped(_food_item: FoodItem):
|
||||||
|
SweetLogger.debug("->[]")
|
||||||
|
animation_player.play("RESET")
|
||||||
|
reset()
|
||||||
|
|
||||||
|
|
||||||
|
# Called from Station base class
|
||||||
|
func on_work_complete():
|
||||||
|
SweetLogger.debug("->[]")
|
||||||
|
animation_player.play("RESET")
|
||||||
|
convert_item()
|
||||||
|
|||||||
+15
-14
@@ -1,26 +1,27 @@
|
|||||||
extends StaticBody3D
|
class_name ItemDispenser
|
||||||
|
extends Station
|
||||||
|
|
||||||
@export var item_scene: PackedScene
|
@export var item_scene: PackedScene
|
||||||
@onready var snap_zone: XRToolsSnapZone = $XRToolsSnapZone
|
|
||||||
|
|
||||||
func _ready() -> void:
|
func _ready() -> void:
|
||||||
|
super.ready()
|
||||||
|
SweetLogger.debug("ItemDispenser {0} _ready", [name])
|
||||||
if not item_scene:
|
if not item_scene:
|
||||||
push_error("Item dispenser is missing a reference to it's item to dispense")
|
SweetLogger.warning("{0} missing item_scene reference", [name])
|
||||||
if not snap_zone:
|
|
||||||
push_error("Item dispenser is missing a reference to its snap zone child")
|
|
||||||
|
|
||||||
|
|
||||||
func _process(_delta: float) -> void:
|
func _process(delta: float) -> void:
|
||||||
|
super.process(delta)
|
||||||
if not NetworkManager.owns_world():
|
if not NetworkManager.owns_world():
|
||||||
return
|
return
|
||||||
#if snap_zone.picked_up_object: # Player picked up this station
|
if not enabled:
|
||||||
#if visible:
|
if snap_zone.picked_up_object:
|
||||||
#snap_zone.picked_up_object.enabled = true
|
var item := snap_zone.picked_up_object
|
||||||
#else:
|
snap_zone.drop_object()
|
||||||
#snap_zone.picked_up_object.enabled = false
|
NetworkManager.despawn_item(item)
|
||||||
#return
|
return
|
||||||
#
|
|
||||||
if not snap_zone.picked_up_object:
|
if not snap_zone.picked_up_object:
|
||||||
SweetLogger.debug("missing item, spawning new item")
|
SweetLogger.debug("Missing item, spawning new item")
|
||||||
var new_item = NetworkManager.spawn_item(item_scene.resource_path, snap_zone.global_transform)
|
var new_item = NetworkManager.spawn_item(item_scene.resource_path, snap_zone.global_transform)
|
||||||
snap_zone.pick_up_object(new_item)
|
snap_zone.pick_up_object(new_item)
|
||||||
|
|||||||
@@ -1,131 +1,114 @@
|
|||||||
[gd_scene format=3 uid="uid://ck5tuftqmyiue"]
|
[gd_scene format=3 uid="uid://ck5tuftqmyiue"]
|
||||||
|
|
||||||
[ext_resource type="PackedScene" uid="uid://cvucwxibtol5f" path="res://stations/StationMovement.tscn" id="1_jgjsq"]
|
|
||||||
[ext_resource type="Script" uid="uid://0y6wnjcsum6" path="res://stations/item_dispenser.gd" id="1_jm0ik"]
|
[ext_resource type="Script" uid="uid://0y6wnjcsum6" path="res://stations/item_dispenser.gd" id="1_jm0ik"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://cbs8jiqe8rcmn" path="res://abstract/station.tscn" id="1_station"]
|
||||||
[ext_resource type="PackedScene" uid="uid://bp3v1jl8pctro" path="res://Containers/plate.tscn" id="2_tfo2i"]
|
[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"]
|
[ext_resource type="AudioStream" uid="uid://dmyuqe5058sv3" path="res://sounds/220197__gameaudio__click-basic.wav" id="4_jgjsq"]
|
||||||
[ext_resource type="PackedScene" uid="uid://mpapt5mkbuao" path="res://prefabs/slide_off_dome.tscn" id="4_tfo2i"]
|
[ext_resource type="PackedScene" uid="uid://mpapt5mkbuao" path="res://prefabs/slide_off_dome.tscn" id="4_tfo2i"]
|
||||||
|
|
||||||
[sub_resource type="SceneReplicationConfig" id="SceneReplicationConfig_jgjsq"]
|
|
||||||
properties/0/path = NodePath("PlateDispenser:position")
|
|
||||||
properties/0/spawn = false
|
|
||||||
properties/0/replication_mode = 1
|
|
||||||
properties/1/path = NodePath("PlateDispenser:rotation")
|
|
||||||
properties/1/spawn = false
|
|
||||||
properties/1/replication_mode = 1
|
|
||||||
properties/2/path = NodePath("PlateDispenser:visible")
|
|
||||||
properties/2/spawn = false
|
|
||||||
properties/2/replication_mode = 1
|
|
||||||
|
|
||||||
[sub_resource type="SphereShape3D" id="SphereShape3D_xmbo2"]
|
|
||||||
radius = 0.3
|
|
||||||
|
|
||||||
[sub_resource type="CylinderShape3D" id="CylinderShape3D_24d3s"]
|
[sub_resource type="CylinderShape3D" id="CylinderShape3D_24d3s"]
|
||||||
height = 1.0
|
height = 1.0
|
||||||
radius = 0.3
|
radius = 0.3
|
||||||
|
|
||||||
[node name="PlateDispenser" type="Node3D" unique_id=53391541]
|
[node name="PlateDispenser" unique_id=707500902 instance=ExtResource("1_station")]
|
||||||
|
|
||||||
[node name="StationMovement" parent="." unique_id=946873975 node_paths=PackedStringArray("station") instance=ExtResource("1_jgjsq")]
|
[node name="StationMovement" parent="." index="0" unique_id=946873975 node_paths=PackedStringArray("station")]
|
||||||
station = NodePath("../PlateDispenser")
|
station = NodePath("../PlateDispenser")
|
||||||
|
|
||||||
[node name="MultiplayerSynchronizer" type="MultiplayerSynchronizer" parent="." unique_id=901684173]
|
[node name="SnapZone" parent="." index="5" unique_id=1315859105]
|
||||||
replication_config = SubResource("SceneReplicationConfig_jgjsq")
|
|
||||||
|
|
||||||
[node name="PlateDispenser" type="StaticBody3D" parent="." unique_id=710538846 groups=["station"]]
|
|
||||||
script = ExtResource("1_jm0ik")
|
|
||||||
item_scene = ExtResource("2_tfo2i")
|
|
||||||
|
|
||||||
[node name="XRToolsSnapZone" type="Area3D" parent="PlateDispenser" unique_id=238176038 groups=["station_zone"]]
|
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.00070536137, 1.1603245, -0.002165556)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.00070536137, 1.1603245, -0.002165556)
|
||||||
collision_layer = 65536
|
collision_layer = 65536
|
||||||
collision_mask = 65536
|
collision_mask = 65536
|
||||||
script = ExtResource("3_lr065")
|
|
||||||
snap_mode = 1
|
snap_mode = 1
|
||||||
metadata/_custom_type_script = "uid://cquqe4f1m1sw6"
|
|
||||||
|
|
||||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="PlateDispenser/XRToolsSnapZone" unique_id=1942470044]
|
[node name="PlateDispenser" type="StaticBody3D" parent="." index="6" unique_id=710538846 node_paths=PackedStringArray("notification_audio", "ambient_audio", "snap_zone", "synchronizer") groups=["station"]]
|
||||||
shape = SubResource("SphereShape3D_xmbo2")
|
script = ExtResource("1_jm0ik")
|
||||||
|
item_scene = ExtResource("2_tfo2i")
|
||||||
|
pickup_sound = ExtResource("4_jgjsq")
|
||||||
|
notification_audio = NodePath("../AudioStreamPlayer3DNotification")
|
||||||
|
ambient_audio = NodePath("../AudioStreamPlayer3DAmbient")
|
||||||
|
snap_zone = NodePath("../SnapZone")
|
||||||
|
synchronizer = NodePath("../MultiplayerSynchronizer")
|
||||||
|
|
||||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="PlateDispenser" unique_id=831688237]
|
[node name="CollisionShape3D" type="CollisionShape3D" parent="PlateDispenser" index="0" unique_id=831688237]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.5, 0)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.5, 0)
|
||||||
shape = SubResource("CylinderShape3D_24d3s")
|
shape = SubResource("CylinderShape3D_24d3s")
|
||||||
|
|
||||||
[node name="SlideOffDome" parent="PlateDispenser" unique_id=1427609426 instance=ExtResource("4_tfo2i")]
|
[node name="SlideOffDome" parent="PlateDispenser" index="1" unique_id=1427609426 instance=ExtResource("4_tfo2i")]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.061363697, 0)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.061363697, 0)
|
||||||
|
|
||||||
[node name="CSGCombiner3D" type="CSGCombiner3D" parent="PlateDispenser" unique_id=696108271]
|
[node name="CSGCombiner3D" type="CSGCombiner3D" parent="PlateDispenser" index="2" unique_id=696108271]
|
||||||
|
|
||||||
[node name="CSGCylinder3D" type="CSGCylinder3D" parent="PlateDispenser/CSGCombiner3D" unique_id=1339763385]
|
[node name="CSGCylinder3D" type="CSGCylinder3D" parent="PlateDispenser/CSGCombiner3D" index="0" unique_id=1339763385]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.5, 0)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.5, 0)
|
||||||
radius = 0.3
|
radius = 0.3
|
||||||
height = 1.0
|
height = 1.0
|
||||||
sides = 32
|
sides = 32
|
||||||
|
|
||||||
[node name="Plates" type="Node3D" parent="PlateDispenser" unique_id=1364909922]
|
[node name="Plates" type="Node3D" parent="PlateDispenser" index="3" unique_id=1364909922]
|
||||||
|
|
||||||
[node name="CSGCombiner3D" type="CSGCombiner3D" parent="PlateDispenser/Plates" unique_id=2128650644]
|
[node name="CSGCombiner3D" type="CSGCombiner3D" parent="PlateDispenser/Plates" index="0" unique_id=2128650644]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.0289642, 0)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.0289642, 0)
|
||||||
autosmooth = true
|
autosmooth = true
|
||||||
smoothing_angle = 103.9
|
smoothing_angle = 103.9
|
||||||
|
|
||||||
[node name="CSGCylinder3D" type="CSGCylinder3D" parent="PlateDispenser/Plates/CSGCombiner3D" unique_id=472067854]
|
[node name="CSGCylinder3D" type="CSGCylinder3D" parent="PlateDispenser/Plates/CSGCombiner3D" index="0" unique_id=472067854]
|
||||||
radius = 0.2
|
radius = 0.2
|
||||||
height = 0.03
|
height = 0.03
|
||||||
sides = 16
|
sides = 16
|
||||||
|
|
||||||
[node name="CSGCylinder3D" type="CSGCylinder3D" parent="PlateDispenser/Plates/CSGCombiner3D/CSGCylinder3D" unique_id=7092994]
|
[node name="CSGCylinder3D" type="CSGCylinder3D" parent="PlateDispenser/Plates/CSGCombiner3D/CSGCylinder3D" index="0" unique_id=7092994]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.010312311, 0)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.010312311, 0)
|
||||||
operation = 2
|
operation = 2
|
||||||
radius = 0.15
|
radius = 0.15
|
||||||
height = 0.03
|
height = 0.03
|
||||||
sides = 16
|
sides = 16
|
||||||
|
|
||||||
[node name="CSGCylinder3D2" type="CSGCylinder3D" parent="PlateDispenser/Plates/CSGCombiner3D" unique_id=23957958]
|
[node name="CSGCylinder3D2" type="CSGCylinder3D" parent="PlateDispenser/Plates/CSGCombiner3D" index="1" unique_id=23957958]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.027119078, 0)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.027119078, 0)
|
||||||
radius = 0.15
|
radius = 0.15
|
||||||
height = 0.02
|
height = 0.02
|
||||||
|
|
||||||
[node name="CSGCombiner3D2" type="CSGCombiner3D" parent="PlateDispenser/Plates" unique_id=404631280]
|
[node name="CSGCombiner3D2" type="CSGCombiner3D" parent="PlateDispenser/Plates" index="1" unique_id=404631280]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.0762081, 0)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.0762081, 0)
|
||||||
autosmooth = true
|
autosmooth = true
|
||||||
smoothing_angle = 103.9
|
smoothing_angle = 103.9
|
||||||
|
|
||||||
[node name="CSGCylinder3D" type="CSGCylinder3D" parent="PlateDispenser/Plates/CSGCombiner3D2" unique_id=943162425]
|
[node name="CSGCylinder3D" type="CSGCylinder3D" parent="PlateDispenser/Plates/CSGCombiner3D2" index="0" unique_id=943162425]
|
||||||
radius = 0.2
|
radius = 0.2
|
||||||
height = 0.03
|
height = 0.03
|
||||||
sides = 16
|
sides = 16
|
||||||
|
|
||||||
[node name="CSGCylinder3D" type="CSGCylinder3D" parent="PlateDispenser/Plates/CSGCombiner3D2/CSGCylinder3D" unique_id=218364524]
|
[node name="CSGCylinder3D" type="CSGCylinder3D" parent="PlateDispenser/Plates/CSGCombiner3D2/CSGCylinder3D" index="0" unique_id=218364524]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.010312311, 0)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.010312311, 0)
|
||||||
operation = 2
|
operation = 2
|
||||||
radius = 0.15
|
radius = 0.15
|
||||||
height = 0.03
|
height = 0.03
|
||||||
sides = 16
|
sides = 16
|
||||||
|
|
||||||
[node name="CSGCylinder3D2" type="CSGCylinder3D" parent="PlateDispenser/Plates/CSGCombiner3D2" unique_id=1548327331]
|
[node name="CSGCylinder3D2" type="CSGCylinder3D" parent="PlateDispenser/Plates/CSGCombiner3D2" index="1" unique_id=1548327331]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.027119078, 0)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.027119078, 0)
|
||||||
radius = 0.15
|
radius = 0.15
|
||||||
height = 0.02
|
height = 0.02
|
||||||
|
|
||||||
[node name="CSGCombiner3D3" type="CSGCombiner3D" parent="PlateDispenser/Plates" unique_id=1506211353]
|
[node name="CSGCombiner3D3" type="CSGCombiner3D" parent="PlateDispenser/Plates" index="2" unique_id=1506211353]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.1214186, 0)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.1214186, 0)
|
||||||
autosmooth = true
|
autosmooth = true
|
||||||
smoothing_angle = 103.9
|
smoothing_angle = 103.9
|
||||||
|
|
||||||
[node name="CSGCylinder3D" type="CSGCylinder3D" parent="PlateDispenser/Plates/CSGCombiner3D3" unique_id=739830577]
|
[node name="CSGCylinder3D" type="CSGCylinder3D" parent="PlateDispenser/Plates/CSGCombiner3D3" index="0" unique_id=739830577]
|
||||||
radius = 0.2
|
radius = 0.2
|
||||||
height = 0.03
|
height = 0.03
|
||||||
sides = 16
|
sides = 16
|
||||||
|
|
||||||
[node name="CSGCylinder3D" type="CSGCylinder3D" parent="PlateDispenser/Plates/CSGCombiner3D3/CSGCylinder3D" unique_id=1882120753]
|
[node name="CSGCylinder3D" type="CSGCylinder3D" parent="PlateDispenser/Plates/CSGCombiner3D3/CSGCylinder3D" index="0" unique_id=1882120753]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.010312311, 0)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.010312311, 0)
|
||||||
operation = 2
|
operation = 2
|
||||||
radius = 0.15
|
radius = 0.15
|
||||||
height = 0.03
|
height = 0.03
|
||||||
sides = 16
|
sides = 16
|
||||||
|
|
||||||
[node name="CSGCylinder3D2" type="CSGCylinder3D" parent="PlateDispenser/Plates/CSGCombiner3D3" unique_id=1904629745]
|
[node name="CSGCylinder3D2" type="CSGCylinder3D" parent="PlateDispenser/Plates/CSGCombiner3D3" index="1" unique_id=1904629745]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.027119078, 0)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.027119078, 0)
|
||||||
radius = 0.15
|
radius = 0.15
|
||||||
height = 0.02
|
height = 0.02
|
||||||
|
|||||||
@@ -1,25 +1,11 @@
|
|||||||
[gd_scene format=3 uid="uid://sc6i0i1f0o48"]
|
[gd_scene format=3 uid="uid://sc6i0i1f0o48"]
|
||||||
|
|
||||||
[ext_resource type="PackedScene" uid="uid://cvucwxibtol5f" path="res://stations/StationMovement.tscn" id="1_8orw3"]
|
[ext_resource type="PackedScene" uid="uid://cbs8jiqe8rcmn" path="res://abstract/station.tscn" id="1_station"]
|
||||||
[ext_resource type="Script" uid="uid://0y6wnjcsum6" path="res://stations/item_dispenser.gd" id="2_30d2d"]
|
[ext_resource type="Script" uid="uid://0y6wnjcsum6" path="res://stations/item_dispenser.gd" id="2_30d2d"]
|
||||||
[ext_resource type="PackedScene" uid="uid://drwuhqb3pjtiy" path="res://items/potato.tscn" id="3_mjqsn"]
|
[ext_resource type="PackedScene" uid="uid://drwuhqb3pjtiy" path="res://items/potato.tscn" id="3_mjqsn"]
|
||||||
[ext_resource type="Script" uid="uid://cquqe4f1m1sw6" path="res://addons/godot-xr-tools/objects/snap_zone.gd" id="4_fx1kw"]
|
[ext_resource type="AudioStream" uid="uid://dmyuqe5058sv3" path="res://sounds/220197__gameaudio__click-basic.wav" id="4_8orw3"]
|
||||||
[ext_resource type="PackedScene" uid="uid://mpapt5mkbuao" path="res://prefabs/slide_off_dome.tscn" id="5_ur331"]
|
[ext_resource type="PackedScene" uid="uid://mpapt5mkbuao" path="res://prefabs/slide_off_dome.tscn" id="5_ur331"]
|
||||||
|
|
||||||
[sub_resource type="SceneReplicationConfig" id="SceneReplicationConfig_8orw3"]
|
|
||||||
properties/0/path = NodePath("PotatoDispenser:position")
|
|
||||||
properties/0/spawn = false
|
|
||||||
properties/0/replication_mode = 1
|
|
||||||
properties/1/path = NodePath("PotatoDispenser:rotation")
|
|
||||||
properties/1/spawn = false
|
|
||||||
properties/1/replication_mode = 1
|
|
||||||
properties/2/path = NodePath("PotatoDispenser:visible")
|
|
||||||
properties/2/spawn = false
|
|
||||||
properties/2/replication_mode = 1
|
|
||||||
|
|
||||||
[sub_resource type="SphereShape3D" id="SphereShape3D_xmbo2"]
|
|
||||||
radius = 0.3
|
|
||||||
|
|
||||||
[sub_resource type="CylinderShape3D" id="CylinderShape3D_24d3s"]
|
[sub_resource type="CylinderShape3D" id="CylinderShape3D_24d3s"]
|
||||||
height = 1.0
|
height = 1.0
|
||||||
radius = 0.3
|
radius = 0.3
|
||||||
@@ -27,114 +13,111 @@ radius = 0.3
|
|||||||
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_d4wpw"]
|
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_d4wpw"]
|
||||||
albedo_color = Color(0.48, 0.34336, 0.1872, 1)
|
albedo_color = Color(0.48, 0.34336, 0.1872, 1)
|
||||||
|
|
||||||
[node name="PotatoDispenser" type="Node3D" unique_id=1410160280]
|
[node name="PotatoDispenser" unique_id=707500902 instance=ExtResource("1_station")]
|
||||||
|
|
||||||
[node name="StationMovement" parent="." unique_id=946873975 node_paths=PackedStringArray("station") instance=ExtResource("1_8orw3")]
|
[node name="StationMovement" parent="." index="0" unique_id=946873975 node_paths=PackedStringArray("station")]
|
||||||
station = NodePath("../PotatoDispenser")
|
station = NodePath("../PotatoDispenser")
|
||||||
|
|
||||||
[node name="MultiplayerSynchronizer" type="MultiplayerSynchronizer" parent="." unique_id=41449367]
|
[node name="SnapZone" parent="." index="5" unique_id=1315859105]
|
||||||
replication_config = SubResource("SceneReplicationConfig_8orw3")
|
|
||||||
|
|
||||||
[node name="PotatoDispenser" type="StaticBody3D" parent="." unique_id=1720683779 groups=["station"]]
|
|
||||||
script = ExtResource("2_30d2d")
|
|
||||||
item_scene = ExtResource("3_mjqsn")
|
|
||||||
|
|
||||||
[node name="XRToolsSnapZone" type="Area3D" parent="PotatoDispenser" unique_id=805334513 groups=["station_zone"]]
|
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.00070536137, 1.0162505, -0.002165556)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.00070536137, 1.0162505, -0.002165556)
|
||||||
collision_layer = 65536
|
collision_layer = 65536
|
||||||
collision_mask = 65536
|
collision_mask = 65536
|
||||||
script = ExtResource("4_fx1kw")
|
|
||||||
snap_mode = 1
|
snap_mode = 1
|
||||||
metadata/_custom_type_script = "uid://cquqe4f1m1sw6"
|
|
||||||
|
|
||||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="PotatoDispenser/XRToolsSnapZone" unique_id=1104626493]
|
[node name="PotatoDispenser" type="StaticBody3D" parent="." index="6" unique_id=1720683779 node_paths=PackedStringArray("notification_audio", "ambient_audio", "snap_zone", "synchronizer") groups=["station"]]
|
||||||
shape = SubResource("SphereShape3D_xmbo2")
|
script = ExtResource("2_30d2d")
|
||||||
|
item_scene = ExtResource("3_mjqsn")
|
||||||
|
pickup_sound = ExtResource("4_8orw3")
|
||||||
|
notification_audio = NodePath("../AudioStreamPlayer3DNotification")
|
||||||
|
ambient_audio = NodePath("../AudioStreamPlayer3DAmbient")
|
||||||
|
snap_zone = NodePath("../SnapZone")
|
||||||
|
synchronizer = NodePath("../MultiplayerSynchronizer")
|
||||||
|
|
||||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="PotatoDispenser" unique_id=1470079357]
|
[node name="CollisionShape3D" type="CollisionShape3D" parent="PotatoDispenser" index="0" unique_id=1470079357]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.5, 0)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.5, 0)
|
||||||
shape = SubResource("CylinderShape3D_24d3s")
|
shape = SubResource("CylinderShape3D_24d3s")
|
||||||
|
|
||||||
[node name="SlideOffDome" parent="PotatoDispenser" unique_id=1427609426 instance=ExtResource("5_ur331")]
|
[node name="SlideOffDome" parent="PotatoDispenser" index="1" unique_id=1427609426 instance=ExtResource("5_ur331")]
|
||||||
collision_layer = 4
|
collision_layer = 4
|
||||||
collision_mask = 0
|
collision_mask = 0
|
||||||
|
|
||||||
[node name="CSGCombiner3D" type="CSGCombiner3D" parent="PotatoDispenser" unique_id=1746426494]
|
[node name="CSGCombiner3D" type="CSGCombiner3D" parent="PotatoDispenser" index="2" unique_id=1746426494]
|
||||||
|
|
||||||
[node name="CSGCylinder3D" type="CSGCylinder3D" parent="PotatoDispenser/CSGCombiner3D" unique_id=858311379]
|
[node name="CSGCylinder3D" type="CSGCylinder3D" parent="PotatoDispenser/CSGCombiner3D" index="0" unique_id=858311379]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.5, 0)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.5, 0)
|
||||||
radius = 0.3
|
radius = 0.3
|
||||||
height = 1.0
|
height = 1.0
|
||||||
sides = 32
|
sides = 32
|
||||||
|
|
||||||
[node name="CSGCombiner3DPotato" type="CSGCombiner3D" parent="PotatoDispenser/CSGCombiner3D" unique_id=462017195]
|
[node name="CSGCombiner3DPotato" type="CSGCombiner3D" parent="PotatoDispenser/CSGCombiner3D" index="1" unique_id=462017195]
|
||||||
|
|
||||||
[node name="CSGSphere3D" type="CSGSphere3D" parent="PotatoDispenser/CSGCombiner3D/CSGCombiner3DPotato" unique_id=359972032]
|
[node name="CSGSphere3D" type="CSGSphere3D" parent="PotatoDispenser/CSGCombiner3D/CSGCombiner3DPotato" index="0" unique_id=359972032]
|
||||||
transform = Transform3D(0.7382242, 0, -0.6745554, 0, 1, 0, 0.6745554, 0, 0.7382242, -0.15066577, 1.0408545, 0.076017424)
|
transform = Transform3D(0.7382242, 0, -0.6745554, 0, 1, 0, 0.6745554, 0, 0.7382242, -0.15066577, 1.0408545, 0.076017424)
|
||||||
radius = 0.06
|
radius = 0.06
|
||||||
radial_segments = 32
|
radial_segments = 32
|
||||||
material = SubResource("StandardMaterial3D_d4wpw")
|
material = SubResource("StandardMaterial3D_d4wpw")
|
||||||
|
|
||||||
[node name="CSGSphere3D2" type="CSGSphere3D" parent="PotatoDispenser/CSGCombiner3D/CSGCombiner3DPotato/CSGSphere3D" unique_id=1185082311]
|
[node name="CSGSphere3D2" type="CSGSphere3D" parent="PotatoDispenser/CSGCombiner3D/CSGCombiner3DPotato/CSGSphere3D" index="0" unique_id=1185082311]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0.06550818)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0.06550818)
|
||||||
radius = 0.053
|
radius = 0.053
|
||||||
radial_segments = 32
|
radial_segments = 32
|
||||||
material = SubResource("StandardMaterial3D_d4wpw")
|
material = SubResource("StandardMaterial3D_d4wpw")
|
||||||
|
|
||||||
[node name="CSGSphere3D2" type="CSGSphere3D" parent="PotatoDispenser/CSGCombiner3D/CSGCombiner3DPotato" unique_id=1791611208]
|
[node name="CSGSphere3D2" type="CSGSphere3D" parent="PotatoDispenser/CSGCombiner3D/CSGCombiner3DPotato" index="1" unique_id=1791611208]
|
||||||
transform = Transform3D(0.9110552, 0.37138447, -0.17903017, -0.38194957, 0.92377764, -0.02737245, 0.15521842, 0.09331828, 0.98346263, 0.07202275, 1.0408545, 0.17340909)
|
transform = Transform3D(0.9110552, 0.37138447, -0.17903017, -0.38194957, 0.92377764, -0.02737245, 0.15521842, 0.09331828, 0.98346263, 0.07202275, 1.0408545, 0.17340909)
|
||||||
radius = 0.06
|
radius = 0.06
|
||||||
radial_segments = 32
|
radial_segments = 32
|
||||||
material = SubResource("StandardMaterial3D_d4wpw")
|
material = SubResource("StandardMaterial3D_d4wpw")
|
||||||
|
|
||||||
[node name="CSGSphere3D2" type="CSGSphere3D" parent="PotatoDispenser/CSGCombiner3D/CSGCombiner3DPotato/CSGSphere3D2" unique_id=421732580]
|
[node name="CSGSphere3D2" type="CSGSphere3D" parent="PotatoDispenser/CSGCombiner3D/CSGCombiner3DPotato/CSGSphere3D2" index="0" unique_id=421732580]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0.06550818)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0.06550818)
|
||||||
radius = 0.053
|
radius = 0.053
|
||||||
radial_segments = 32
|
radial_segments = 32
|
||||||
material = SubResource("StandardMaterial3D_d4wpw")
|
material = SubResource("StandardMaterial3D_d4wpw")
|
||||||
|
|
||||||
[node name="CSGSphere3D3" type="CSGSphere3D" parent="PotatoDispenser/CSGCombiner3D/CSGCombiner3DPotato" unique_id=1846822725]
|
[node name="CSGSphere3D3" type="CSGSphere3D" parent="PotatoDispenser/CSGCombiner3D/CSGCombiner3DPotato" index="2" unique_id=1846822725]
|
||||||
transform = Transform3D(0.915982, 0, 0.4012194, 0, 1, 0, -0.4012194, 0, 0.915982, -0.023129582, 1.0408545, -0.17174377)
|
transform = Transform3D(0.915982, 0, 0.4012194, 0, 1, 0, -0.4012194, 0, 0.915982, -0.023129582, 1.0408545, -0.17174377)
|
||||||
radius = 0.06
|
radius = 0.06
|
||||||
radial_segments = 32
|
radial_segments = 32
|
||||||
material = SubResource("StandardMaterial3D_d4wpw")
|
material = SubResource("StandardMaterial3D_d4wpw")
|
||||||
|
|
||||||
[node name="CSGSphere3D2" type="CSGSphere3D" parent="PotatoDispenser/CSGCombiner3D/CSGCombiner3DPotato/CSGSphere3D3" unique_id=186002472]
|
[node name="CSGSphere3D2" type="CSGSphere3D" parent="PotatoDispenser/CSGCombiner3D/CSGCombiner3DPotato/CSGSphere3D3" index="0" unique_id=186002472]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0.06550818)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0.06550818)
|
||||||
radius = 0.053
|
radius = 0.053
|
||||||
radial_segments = 32
|
radial_segments = 32
|
||||||
material = SubResource("StandardMaterial3D_d4wpw")
|
material = SubResource("StandardMaterial3D_d4wpw")
|
||||||
|
|
||||||
[node name="CSGSphere3D4" type="CSGSphere3D" parent="PotatoDispenser/CSGCombiner3D/CSGCombiner3DPotato" unique_id=1463825677]
|
[node name="CSGSphere3D4" type="CSGSphere3D" parent="PotatoDispenser/CSGCombiner3D/CSGCombiner3DPotato" index="3" unique_id=1463825677]
|
||||||
transform = Transform3D(-0.6086207, 0, 0.79346126, 0, 1, 0, -0.79346126, 0, -0.6086207, -0.06466554, 1.0408545, 0.15114635)
|
transform = Transform3D(-0.6086207, 0, 0.79346126, 0, 1, 0, -0.79346126, 0, -0.6086207, -0.06466554, 1.0408545, 0.15114635)
|
||||||
radius = 0.06
|
radius = 0.06
|
||||||
radial_segments = 32
|
radial_segments = 32
|
||||||
material = SubResource("StandardMaterial3D_d4wpw")
|
material = SubResource("StandardMaterial3D_d4wpw")
|
||||||
|
|
||||||
[node name="CSGSphere3D2" type="CSGSphere3D" parent="PotatoDispenser/CSGCombiner3D/CSGCombiner3DPotato/CSGSphere3D4" unique_id=1513828324]
|
[node name="CSGSphere3D2" type="CSGSphere3D" parent="PotatoDispenser/CSGCombiner3D/CSGCombiner3DPotato/CSGSphere3D4" index="0" unique_id=1513828324]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0.06550818)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0.06550818)
|
||||||
radius = 0.053
|
radius = 0.053
|
||||||
radial_segments = 32
|
radial_segments = 32
|
||||||
material = SubResource("StandardMaterial3D_d4wpw")
|
material = SubResource("StandardMaterial3D_d4wpw")
|
||||||
|
|
||||||
[node name="CSGSphere3D5" type="CSGSphere3D" parent="PotatoDispenser/CSGCombiner3D/CSGCombiner3DPotato" unique_id=1192971071]
|
[node name="CSGSphere3D5" type="CSGSphere3D" parent="PotatoDispenser/CSGCombiner3D/CSGCombiner3DPotato" index="4" unique_id=1192971071]
|
||||||
transform = Transform3D(-0.9572301, 0, -0.2893278, 0, 1, 0, 0.2893278, 0, -0.9572301, -0.13095556, 1.0408545, -0.10415963)
|
transform = Transform3D(-0.9572301, 0, -0.2893278, 0, 1, 0, 0.2893278, 0, -0.9572301, -0.13095556, 1.0408545, -0.10415963)
|
||||||
radius = 0.06
|
radius = 0.06
|
||||||
radial_segments = 32
|
radial_segments = 32
|
||||||
material = SubResource("StandardMaterial3D_d4wpw")
|
material = SubResource("StandardMaterial3D_d4wpw")
|
||||||
|
|
||||||
[node name="CSGSphere3D2" type="CSGSphere3D" parent="PotatoDispenser/CSGCombiner3D/CSGCombiner3DPotato/CSGSphere3D5" unique_id=216752249]
|
[node name="CSGSphere3D2" type="CSGSphere3D" parent="PotatoDispenser/CSGCombiner3D/CSGCombiner3DPotato/CSGSphere3D5" index="0" unique_id=216752249]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0.06550818)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0.06550818)
|
||||||
radius = 0.053
|
radius = 0.053
|
||||||
radial_segments = 32
|
radial_segments = 32
|
||||||
material = SubResource("StandardMaterial3D_d4wpw")
|
material = SubResource("StandardMaterial3D_d4wpw")
|
||||||
|
|
||||||
[node name="CSGSphere3D" type="CSGSphere3D" parent="PotatoDispenser/CSGCombiner3D" unique_id=502335906]
|
[node name="CSGSphere3D" type="CSGSphere3D" parent="PotatoDispenser/CSGCombiner3D" index="2" unique_id=502335906]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.15826963, 1.0408545, -0.03307341)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.15826963, 1.0408545, -0.03307341)
|
||||||
radius = 0.06
|
radius = 0.06
|
||||||
radial_segments = 32
|
radial_segments = 32
|
||||||
material = SubResource("StandardMaterial3D_d4wpw")
|
material = SubResource("StandardMaterial3D_d4wpw")
|
||||||
|
|
||||||
[node name="CSGSphere3D2" type="CSGSphere3D" parent="PotatoDispenser/CSGCombiner3D/CSGSphere3D" unique_id=1283597847]
|
[node name="CSGSphere3D2" type="CSGSphere3D" parent="PotatoDispenser/CSGCombiner3D/CSGSphere3D" index="0" unique_id=1283597847]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0.06550818)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0.06550818)
|
||||||
radius = 0.053
|
radius = 0.053
|
||||||
radial_segments = 32
|
radial_segments = 32
|
||||||
|
|||||||
@@ -1,25 +1,11 @@
|
|||||||
[gd_scene format=3 uid="uid://cwnwo4i28upap"]
|
[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="Script" uid="uid://0y6wnjcsum6" path="res://stations/item_dispenser.gd" id="1_gkb3v"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://cbs8jiqe8rcmn" path="res://abstract/station.tscn" id="1_station"]
|
||||||
[ext_resource type="PackedScene" uid="uid://dpot5qie20vf6" path="res://items/burger.tscn" id="2_mep2a"]
|
[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://7jt8macx4f5m" path="res://textures/1.png" id="4_1f5le"]
|
||||||
[ext_resource type="Texture2D" uid="uid://cexxfyw03hr81" path="res://textures/1.png" id="4_1f5le"]
|
[ext_resource type="AudioStream" uid="uid://dmyuqe5058sv3" path="res://sounds/220197__gameaudio__click-basic.wav" id="4_8ou8n"]
|
||||||
[ext_resource type="PackedScene" uid="uid://mpapt5mkbuao" path="res://prefabs/slide_off_dome.tscn" id="5_mep2a"]
|
[ext_resource type="PackedScene" uid="uid://mpapt5mkbuao" path="res://prefabs/slide_off_dome.tscn" id="5_mep2a"]
|
||||||
[ext_resource type="PackedScene" uid="uid://cvucwxibtol5f" path="res://stations/StationMovement.tscn" id="6_8ou8n"]
|
|
||||||
|
|
||||||
[sub_resource type="SceneReplicationConfig" id="SceneReplicationConfig_8ou8n"]
|
|
||||||
properties/0/path = NodePath("RawBurgerDispenser:position")
|
|
||||||
properties/0/spawn = false
|
|
||||||
properties/0/replication_mode = 1
|
|
||||||
properties/1/path = NodePath("RawBurgerDispenser:rotation")
|
|
||||||
properties/1/spawn = false
|
|
||||||
properties/1/replication_mode = 1
|
|
||||||
properties/2/path = NodePath("RawBurgerDispenser:visible")
|
|
||||||
properties/2/spawn = false
|
|
||||||
properties/2/replication_mode = 1
|
|
||||||
|
|
||||||
[sub_resource type="SphereShape3D" id="SphereShape3D_xmbo2"]
|
|
||||||
radius = 0.3
|
|
||||||
|
|
||||||
[sub_resource type="CylinderShape3D" id="CylinderShape3D_24d3s"]
|
[sub_resource type="CylinderShape3D" id="CylinderShape3D_24d3s"]
|
||||||
height = 1.0
|
height = 1.0
|
||||||
@@ -28,93 +14,90 @@ radius = 0.3
|
|||||||
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_di04w"]
|
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_di04w"]
|
||||||
albedo_texture = ExtResource("4_1f5le")
|
albedo_texture = ExtResource("4_1f5le")
|
||||||
|
|
||||||
[node name="RawBurgerDispenser" type="Node3D" unique_id=383615587]
|
[node name="RawBurgerDispenser" unique_id=707500902 instance=ExtResource("1_station")]
|
||||||
|
|
||||||
[node name="StationMovement" parent="." unique_id=946873975 node_paths=PackedStringArray("station") instance=ExtResource("6_8ou8n")]
|
[node name="StationMovement" parent="." index="0" unique_id=946873975 node_paths=PackedStringArray("station")]
|
||||||
station = NodePath("../RawBurgerDispenser")
|
station = NodePath("../RawBurgerDispenser")
|
||||||
|
|
||||||
[node name="MultiplayerSynchronizer" type="MultiplayerSynchronizer" parent="." unique_id=1886082284]
|
[node name="SnapZone" parent="." index="5" unique_id=1315859105]
|
||||||
replication_config = SubResource("SceneReplicationConfig_8ou8n")
|
|
||||||
|
|
||||||
[node name="RawBurgerDispenser" type="StaticBody3D" parent="." unique_id=235630131 groups=["station"]]
|
|
||||||
script = ExtResource("1_gkb3v")
|
|
||||||
item_scene = ExtResource("2_mep2a")
|
|
||||||
|
|
||||||
[node name="XRToolsSnapZone" type="Area3D" parent="RawBurgerDispenser" unique_id=1523586273 groups=["station_zone"]]
|
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.00070536137, 1.0645258, -0.002165556)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.00070536137, 1.0645258, -0.002165556)
|
||||||
collision_layer = 65536
|
collision_layer = 65536
|
||||||
collision_mask = 65536
|
collision_mask = 65536
|
||||||
script = ExtResource("3_3xuvi")
|
|
||||||
snap_mode = 1
|
snap_mode = 1
|
||||||
metadata/_custom_type_script = "uid://cquqe4f1m1sw6"
|
|
||||||
|
|
||||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="RawBurgerDispenser/XRToolsSnapZone" unique_id=2105824734]
|
[node name="RawBurgerDispenser" type="StaticBody3D" parent="." index="6" unique_id=235630131 node_paths=PackedStringArray("notification_audio", "ambient_audio", "snap_zone", "synchronizer") groups=["station"]]
|
||||||
shape = SubResource("SphereShape3D_xmbo2")
|
script = ExtResource("1_gkb3v")
|
||||||
|
item_scene = ExtResource("2_mep2a")
|
||||||
|
pickup_sound = ExtResource("4_8ou8n")
|
||||||
|
notification_audio = NodePath("../AudioStreamPlayer3DNotification")
|
||||||
|
ambient_audio = NodePath("../AudioStreamPlayer3DAmbient")
|
||||||
|
snap_zone = NodePath("../SnapZone")
|
||||||
|
synchronizer = NodePath("../MultiplayerSynchronizer")
|
||||||
|
|
||||||
[node name="SlideOffDome" parent="RawBurgerDispenser" unique_id=1427609426 instance=ExtResource("5_mep2a")]
|
[node name="SlideOffDome" parent="RawBurgerDispenser" index="0" unique_id=1427609426 instance=ExtResource("5_mep2a")]
|
||||||
|
|
||||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="RawBurgerDispenser" unique_id=378049928]
|
[node name="CollisionShape3D" type="CollisionShape3D" parent="RawBurgerDispenser" index="1" unique_id=378049928]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.5, 0)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.5, 0)
|
||||||
shape = SubResource("CylinderShape3D_24d3s")
|
shape = SubResource("CylinderShape3D_24d3s")
|
||||||
|
|
||||||
[node name="CSGCombiner3D" type="CSGCombiner3D" parent="RawBurgerDispenser" unique_id=1275577257]
|
[node name="CSGCombiner3D" type="CSGCombiner3D" parent="RawBurgerDispenser" index="2" unique_id=1275577257]
|
||||||
|
|
||||||
[node name="CSGCylinder3D" type="CSGCylinder3D" parent="RawBurgerDispenser/CSGCombiner3D" unique_id=1973748218]
|
[node name="CSGCylinder3D" type="CSGCylinder3D" parent="RawBurgerDispenser/CSGCombiner3D" index="0" unique_id=1973748218]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.5, 0)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.5, 0)
|
||||||
radius = 0.3
|
radius = 0.3
|
||||||
height = 1.0
|
height = 1.0
|
||||||
sides = 32
|
sides = 32
|
||||||
|
|
||||||
[node name="CSGCylinder3D2" type="CSGCylinder3D" parent="RawBurgerDispenser/CSGCombiner3D" unique_id=590219609]
|
[node name="CSGCylinder3D2" type="CSGCylinder3D" parent="RawBurgerDispenser/CSGCombiner3D" index="1" unique_id=590219609]
|
||||||
transform = Transform3D(1, 0, 0, 0, 0.9532462, 0.30219492, 0, -0.30219492, 0.9532462, -0.1276815, 1.0521446, -0.052202225)
|
transform = Transform3D(1, 0, 0, 0, 0.9532462, 0.30219492, 0, -0.30219492, 0.9532462, -0.1276815, 1.0521446, -0.052202225)
|
||||||
radius = 0.08300781
|
radius = 0.08300781
|
||||||
height = 0.028435059
|
height = 0.028435059
|
||||||
sides = 16
|
sides = 16
|
||||||
material = SubResource("StandardMaterial3D_di04w")
|
material = SubResource("StandardMaterial3D_di04w")
|
||||||
|
|
||||||
[node name="CSGCylinder3D3" type="CSGCylinder3D" parent="RawBurgerDispenser/CSGCombiner3D" unique_id=177377476]
|
[node name="CSGCylinder3D3" type="CSGCylinder3D" parent="RawBurgerDispenser/CSGCombiner3D" index="2" unique_id=177377476]
|
||||||
transform = Transform3D(1, 0, 0, 0, 0.9694763, 0.245185, 0, -0.245185, 0.9694763, 0.08106685, 1.0391599, -0.119440794)
|
transform = Transform3D(1, 0, 0, 0, 0.9694763, 0.245185, 0, -0.245185, 0.9694763, 0.08106685, 1.0391599, -0.119440794)
|
||||||
radius = 0.08300781
|
radius = 0.08300781
|
||||||
height = 0.03
|
height = 0.03
|
||||||
sides = 16
|
sides = 16
|
||||||
material = SubResource("StandardMaterial3D_di04w")
|
material = SubResource("StandardMaterial3D_di04w")
|
||||||
|
|
||||||
[node name="CSGCylinder3D4" type="CSGCylinder3D" parent="RawBurgerDispenser/CSGCombiner3D" unique_id=622291452]
|
[node name="CSGCylinder3D4" type="CSGCylinder3D" parent="RawBurgerDispenser/CSGCombiner3D" index="3" unique_id=622291452]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.19005477, 1.0198405, 0.049397707)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.19005477, 1.0198405, 0.049397707)
|
||||||
radius = 0.08300781
|
radius = 0.08300781
|
||||||
height = 0.03
|
height = 0.03
|
||||||
sides = 16
|
sides = 16
|
||||||
material = SubResource("StandardMaterial3D_di04w")
|
material = SubResource("StandardMaterial3D_di04w")
|
||||||
|
|
||||||
[node name="CSGCylinder3D5" type="CSGCylinder3D" parent="RawBurgerDispenser/CSGCombiner3D" unique_id=703594207]
|
[node name="CSGCylinder3D5" type="CSGCylinder3D" parent="RawBurgerDispenser/CSGCombiner3D" index="4" unique_id=703594207]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.026051283, 1.0175319, 0.0042250156)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.026051283, 1.0175319, 0.0042250156)
|
||||||
radius = 0.08300781
|
radius = 0.08300781
|
||||||
height = 0.03
|
height = 0.03
|
||||||
sides = 16
|
sides = 16
|
||||||
material = SubResource("StandardMaterial3D_di04w")
|
material = SubResource("StandardMaterial3D_di04w")
|
||||||
|
|
||||||
[node name="CSGCylinder3D6" type="CSGCylinder3D" parent="RawBurgerDispenser/CSGCombiner3D" unique_id=955808722]
|
[node name="CSGCylinder3D6" type="CSGCylinder3D" parent="RawBurgerDispenser/CSGCombiner3D" index="5" unique_id=955808722]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.05739355, 1.0197641, 0.13219571)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.05739355, 1.0197641, 0.13219571)
|
||||||
radius = 0.08300781
|
radius = 0.08300781
|
||||||
height = 0.03
|
height = 0.03
|
||||||
sides = 16
|
sides = 16
|
||||||
material = SubResource("StandardMaterial3D_di04w")
|
material = SubResource("StandardMaterial3D_di04w")
|
||||||
|
|
||||||
[node name="CSGCylinder3D7" type="CSGCylinder3D" parent="RawBurgerDispenser/CSGCombiner3D" unique_id=1066788957]
|
[node name="CSGCylinder3D7" type="CSGCylinder3D" parent="RawBurgerDispenser/CSGCombiner3D" index="6" 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)
|
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
|
radius = 0.08300781
|
||||||
height = 0.03
|
height = 0.03
|
||||||
sides = 16
|
sides = 16
|
||||||
material = SubResource("StandardMaterial3D_di04w")
|
material = SubResource("StandardMaterial3D_di04w")
|
||||||
|
|
||||||
[node name="CSGCylinder3D8" type="CSGCylinder3D" parent="RawBurgerDispenser/CSGCombiner3D" unique_id=553053058]
|
[node name="CSGCylinder3D8" type="CSGCylinder3D" parent="RawBurgerDispenser/CSGCombiner3D" index="7" unique_id=553053058]
|
||||||
transform = Transform3D(0.9541017, 0.29948288, 0, -0.29948288, 0.9541017, 0, 0, 0, 1, 0.041060925, 1.0337045, 0.18304396)
|
transform = Transform3D(0.9541017, 0.29948288, 0, -0.29948288, 0.9541017, 0, 0, 0, 1, 0.041060925, 1.0337045, 0.18304396)
|
||||||
radius = 0.08300781
|
radius = 0.08300781
|
||||||
height = 0.03
|
height = 0.03
|
||||||
sides = 16
|
sides = 16
|
||||||
material = SubResource("StandardMaterial3D_di04w")
|
material = SubResource("StandardMaterial3D_di04w")
|
||||||
|
|
||||||
[node name="CSGCylinder3D9" type="CSGCylinder3D" parent="RawBurgerDispenser/CSGCombiner3D" unique_id=980376661]
|
[node name="CSGCylinder3D9" type="CSGCylinder3D" parent="RawBurgerDispenser/CSGCombiner3D" index="8" 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)
|
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
|
radius = 0.08300781
|
||||||
height = 0.03
|
height = 0.03
|
||||||
|
|||||||
+54
-77
@@ -1,94 +1,71 @@
|
|||||||
extends StaticBody3D
|
class_name Sink
|
||||||
|
extends WorkStation
|
||||||
|
|
||||||
const plate_wash_time: float = 3.0
|
const plate_wash_time: float = 3.0
|
||||||
@export_range(0.0, 10.0, 0.1) var wash_speed: float = 1.0
|
@export_range(0.0, 10.0, 0.1) var wash_speed: float = 1.0
|
||||||
|
|
||||||
@onready var snap_zone: XRToolsSnapZone = $XRToolsSnapZone
|
var plate: PlateController = null
|
||||||
@onready var progress_bar: ProgressBar3D = $ProgressBar3D
|
|
||||||
|
|
||||||
## Washing state. Both are replicated (see sink.tscn's Sync node) and refresh the
|
|
||||||
## display when they change. Only the world owner runs this station's _process
|
|
||||||
## and snap zone, so without this a client never updates its bar — it stayed
|
|
||||||
## frozen on screen long after the plate came out clean.
|
|
||||||
@export var time_washed: float = 0.0: set = _set_time_washed
|
|
||||||
@export var is_washing: bool = false: set = _set_is_washing
|
|
||||||
@export var plate: PlateController = null
|
|
||||||
|
|
||||||
|
|
||||||
func _set_time_washed(value: float) -> void:
|
func _ready() -> void:
|
||||||
if is_equal_approx(time_washed, value):
|
super.ready()
|
||||||
|
SweetLogger.debug("Sink {0} _ready", [name])
|
||||||
|
|
||||||
|
|
||||||
|
func _start_washing(work: float) -> void:
|
||||||
|
if not enabled:
|
||||||
return
|
return
|
||||||
time_washed = value
|
result_id = "clean"
|
||||||
_refresh_progress_bar()
|
max_work = work
|
||||||
|
SweetLogger.info("Start washing - max_work: {0}", [max_work])
|
||||||
|
|
||||||
|
func _set_effects_playing(is_playing: bool) -> void:
|
||||||
func _set_is_washing(value: bool) -> void:
|
SweetLogger.debug("Set Sink effects: {0}", [is_playing])
|
||||||
if is_washing == value:
|
|
||||||
return
|
|
||||||
is_washing = value
|
|
||||||
_refresh_progress_bar()
|
|
||||||
_set_effects_playing(is_washing)
|
|
||||||
|
|
||||||
|
|
||||||
# Water, bubbles and the animation follow the washing state on every peer, not
|
|
||||||
# just the one running the logic.
|
|
||||||
func _set_effects_playing(playing: bool) -> void:
|
|
||||||
var player := get_node_or_null("AnimationPlayer") as AnimationPlayer
|
var player := get_node_or_null("AnimationPlayer") as AnimationPlayer
|
||||||
if player:
|
if player:
|
||||||
player.play("working" if playing else "RESET")
|
player.play("working" if is_playing else "RESET")
|
||||||
for effect in ["water", "bubbles", "GPUParticles3D"]:
|
for effect in ["water", "bubbles", "GPUParticles3D"]:
|
||||||
var node := get_node_or_null(effect) as Node3D
|
var node := get_node_or_null(effect) as Node3D
|
||||||
if node:
|
if node:
|
||||||
node.visible = playing
|
node.visible = is_playing
|
||||||
|
|
||||||
func _ready() -> void:
|
|
||||||
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:
|
|
||||||
if not progress_bar:
|
|
||||||
return
|
|
||||||
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:
|
|
||||||
SweetLogger.debug("object picked up: {0}", [_item])
|
|
||||||
plate = _item.get_node_or_null("PlateController") as PlateController
|
|
||||||
if plate:
|
|
||||||
# The setter starts the effects and shows the bar, here and on clients.
|
|
||||||
is_washing = plate.is_dirty
|
|
||||||
|
|
||||||
|
|
||||||
func _on_object_dropped(_item) -> void:
|
|
||||||
SweetLogger.debug("object drop")
|
|
||||||
_reset_sink()
|
|
||||||
|
|
||||||
|
|
||||||
func _reset_sink():
|
|
||||||
time_washed = 0
|
|
||||||
is_washing = false
|
|
||||||
plate = null
|
|
||||||
|
|
||||||
func complete_washing():
|
|
||||||
if not plate:
|
|
||||||
return
|
|
||||||
plate.is_dirty = false
|
|
||||||
_reset_sink()
|
|
||||||
SweetLogger.debug("washing complete!")
|
|
||||||
|
|
||||||
|
|
||||||
func _process(delta: float) -> void:
|
func _process(delta: float) -> void:
|
||||||
if is_washing:
|
super.process(delta)
|
||||||
time_washed += wash_speed * delta
|
if not enabled:
|
||||||
_refresh_progress_bar()
|
return
|
||||||
SweetLogger.debug("washing plate: {0}", [time_washed])
|
if result_id:
|
||||||
|
add_work(wash_speed * delta)
|
||||||
|
|
||||||
|
|
||||||
|
# Called from Station base class
|
||||||
|
func refresh_display() -> void:
|
||||||
|
super.refresh_display()
|
||||||
|
progress_bar.override_fill_color(Color.DODGER_BLUE)
|
||||||
|
|
||||||
|
|
||||||
|
# Called from Station base class
|
||||||
|
func on_object_picked_up(item: Node3D) -> void:
|
||||||
|
plate = item.get_node_or_null("PlateController") as PlateController
|
||||||
|
if not plate or not plate.is_dirty:
|
||||||
|
return
|
||||||
|
_set_effects_playing(true)
|
||||||
|
_start_washing(plate_wash_time)
|
||||||
|
|
||||||
|
|
||||||
|
# Called from Station base class
|
||||||
|
func on_object_dropped(_item: Node3D) -> void:
|
||||||
|
SweetLogger.debug("->[]")
|
||||||
|
_set_effects_playing(false)
|
||||||
|
plate = null
|
||||||
|
reset()
|
||||||
|
|
||||||
|
|
||||||
|
# Called from Station base class
|
||||||
|
func on_work_complete():
|
||||||
|
SweetLogger.debug("->[]")
|
||||||
|
_set_effects_playing(false)
|
||||||
|
plate.is_dirty = false
|
||||||
|
reset()
|
||||||
|
|
||||||
|
|
||||||
if time_washed >= plate_wash_time:
|
|
||||||
complete_washing()
|
|
||||||
|
|||||||
+39
-66
File diff suppressed because one or more lines are too long
@@ -21,7 +21,7 @@ const GHOST_COLOR_INVALID: Color = Color(1, 0, 0, 0.35)
|
|||||||
|
|
||||||
|
|
||||||
func set_move_handle_enabled(enabled: bool) -> void:
|
func set_move_handle_enabled(enabled: bool) -> void:
|
||||||
SweetLogger.debug("set_move_handle_enabled: {0}", [enabled])
|
SweetLogger.debug("Set move handle enabled: {0}", [enabled])
|
||||||
move_handle.visible = enabled
|
move_handle.visible = enabled
|
||||||
move_handle.enabled = enabled
|
move_handle.enabled = enabled
|
||||||
if enabled:
|
if enabled:
|
||||||
@@ -32,18 +32,18 @@ func _on_game_state_changed(new_state: GameManager.GameState) -> void:
|
|||||||
set_move_handle_enabled(new_state == GameManager.GameState.BUILDING)
|
set_move_handle_enabled(new_state == GameManager.GameState.BUILDING)
|
||||||
|
|
||||||
func _on_station_bought(_instance: Node3D):
|
func _on_station_bought(_instance: Node3D):
|
||||||
SweetLogger.info("_on_station_bought")
|
SweetLogger.debug("->[]")
|
||||||
if GameManager.game_state == GameManager.GameState.BUILDING:
|
if GameManager.game_state == GameManager.GameState.BUILDING:
|
||||||
set_move_handle_enabled(true)
|
set_move_handle_enabled(true)
|
||||||
|
|
||||||
func _ready() -> void:
|
func _ready() -> void:
|
||||||
SweetLogger.debug("enter")
|
SweetLogger.debug("->[]")
|
||||||
if not station:
|
if not station:
|
||||||
push_error("StationMovement is missing referece to station")
|
SweetLogger.warning("{0} missing station reference", [name])
|
||||||
if not move_handle:
|
if not move_handle:
|
||||||
push_error("StationMovement is missing reference to move_handle")
|
SweetLogger.warning("{0} missing move_handle reference", [name])
|
||||||
if not move_ghost:
|
if not move_ghost:
|
||||||
push_error("StationMovement is missing reference to move_ghost")
|
SweetLogger.warning("{0} missing move_ghost reference", [name])
|
||||||
|
|
||||||
move_handle_rigid = move_handle as RigidBody3D
|
move_handle_rigid = move_handle as RigidBody3D
|
||||||
original_collision_layer = station.collision_layer
|
original_collision_layer = station.collision_layer
|
||||||
@@ -105,9 +105,9 @@ func _apply_visibility_state(ghost_visible: bool, station_visible: bool) -> void
|
|||||||
|
|
||||||
|
|
||||||
func _handle_pickup(_by: Node) -> void:
|
func _handle_pickup(_by: Node) -> void:
|
||||||
SweetLogger.info("handle pickup")
|
SweetLogger.debug("->[]")
|
||||||
if move_handle.get_picked_up_by() and move_handle.get_picked_up_by() is XRToolsSnapZone:
|
if move_handle.get_picked_up_by() and move_handle.get_picked_up_by() is XRToolsSnapZone:
|
||||||
SweetLogger.info("handle pickup by snap zone, dropping and resetting position")
|
SweetLogger.info("Handle pickup by snap zone, dropping and resetting position")
|
||||||
move_handle.drop()
|
move_handle.drop()
|
||||||
move_handle.global_position = station.global_position + Vector3(0, original_handle_y_pos, 0)
|
move_handle.global_position = station.global_position + Vector3(0, original_handle_y_pos, 0)
|
||||||
move_handle.rotation = station.rotation
|
move_handle.rotation = station.rotation
|
||||||
@@ -121,7 +121,7 @@ func _handle_pickup(_by: Node) -> void:
|
|||||||
|
|
||||||
|
|
||||||
func _handle_drop(_by: Node) -> void:
|
func _handle_drop(_by: Node) -> void:
|
||||||
SweetLogger.info("handle drop")
|
SweetLogger.info("Handle drop")
|
||||||
is_moving = false
|
is_moving = false
|
||||||
_apply_visibility_state(false, true)
|
_apply_visibility_state(false, true)
|
||||||
station.collision_layer = original_collision_layer
|
station.collision_layer = original_collision_layer
|
||||||
@@ -134,11 +134,11 @@ func _handle_drop(_by: Node) -> void:
|
|||||||
if is_valid:
|
if is_valid:
|
||||||
station.global_transform = move_ghost.global_transform
|
station.global_transform = move_ghost.global_transform
|
||||||
move_handle.global_transform = move_ghost.global_transform.translated(Vector3(0, original_handle_y_pos, 0))
|
move_handle.global_transform = move_ghost.global_transform.translated(Vector3(0, original_handle_y_pos, 0))
|
||||||
SweetLogger.debug("handle drop (local apply), station authority: {0} move_handle authority: {1}", [station.get_multiplayer_authority(), move_handle.get_multiplayer_authority()])
|
SweetLogger.debug("Handle drop (local apply), station authority: {0} move_handle authority: {1}", [station.get_multiplayer_authority(), move_handle.get_multiplayer_authority()])
|
||||||
else:
|
else:
|
||||||
station.global_transform = original_station_transform
|
station.global_transform = original_station_transform
|
||||||
move_handle.global_transform = original_station_transform.translated(Vector3(0, original_handle_y_pos, 0))
|
move_handle.global_transform = original_station_transform.translated(Vector3(0, original_handle_y_pos, 0))
|
||||||
SweetLogger.debug("handle drop (local reject), restoring original position", [])
|
SweetLogger.debug("Handle drop (local reject), restoring original position")
|
||||||
|
|
||||||
|
|
||||||
func _process(_delta: float) -> void:
|
func _process(_delta: float) -> void:
|
||||||
@@ -186,7 +186,7 @@ func _is_move_position_valid() -> bool:
|
|||||||
|
|
||||||
@rpc("any_peer", "call_local", "reliable")
|
@rpc("any_peer", "call_local", "reliable")
|
||||||
func server_handle_drop(new_transform: Transform3D, client_thinks_valid: bool):
|
func server_handle_drop(new_transform: Transform3D, client_thinks_valid: bool):
|
||||||
SweetLogger.debug("enter")
|
SweetLogger.debug("->[]")
|
||||||
if not multiplayer.is_server():
|
if not multiplayer.is_server():
|
||||||
return
|
return
|
||||||
if not (client_thinks_valid):
|
if not (client_thinks_valid):
|
||||||
@@ -198,7 +198,7 @@ func server_handle_drop(new_transform: Transform3D, client_thinks_valid: bool):
|
|||||||
if not _was_last_pos_valid: # Edge case
|
if not _was_last_pos_valid: # Edge case
|
||||||
server_update_visibility.rpc(false, true)
|
server_update_visibility.rpc(false, true)
|
||||||
SweetLogger.warning("Can not not reset visibility to normal when the last pos was invalid")
|
SweetLogger.warning("Can not not reset visibility to normal when the last pos was invalid")
|
||||||
SweetLogger.debug("transform rejected (invalid)")
|
SweetLogger.debug("Transform rejected (invalid)")
|
||||||
_was_last_pos_valid = false
|
_was_last_pos_valid = false
|
||||||
return
|
return
|
||||||
|
|
||||||
@@ -208,38 +208,38 @@ func server_handle_drop(new_transform: Transform3D, client_thinks_valid: bool):
|
|||||||
server_update_visibility.rpc(false, true)
|
server_update_visibility.rpc(false, true)
|
||||||
_was_last_pos_valid = true
|
_was_last_pos_valid = true
|
||||||
|
|
||||||
SweetLogger.debug("transform applied")
|
SweetLogger.debug("Transform applied")
|
||||||
|
|
||||||
|
|
||||||
@rpc("any_peer", "call_local", "reliable") # Server updates clients
|
@rpc("any_peer", "call_local", "reliable") # Server updates clients
|
||||||
func server_artificial_pickup():
|
func server_artificial_pickup():
|
||||||
SweetLogger.debug("enter")
|
SweetLogger.debug("->[]")
|
||||||
_handle_pickup(self) # Arg is not used, but required of the signal.
|
_handle_pickup(self) # Arg is not used, but required of the signal.
|
||||||
|
|
||||||
|
|
||||||
@rpc("any_peer", "call_local", "reliable") # Server updates clients
|
@rpc("any_peer", "call_local", "reliable") # Server updates clients
|
||||||
func server_update_station_transform(new_transform: Transform3D) -> void:
|
func server_update_station_transform(new_transform: Transform3D) -> void:
|
||||||
SweetLogger.debug("entered")
|
SweetLogger.debug("->[]")
|
||||||
station.global_transform = new_transform
|
station.global_transform = new_transform
|
||||||
original_station_transform = new_transform
|
original_station_transform = new_transform
|
||||||
|
|
||||||
|
|
||||||
@rpc("any_peer", "call_local", "reliable") # Server updates clients
|
@rpc("any_peer", "call_local", "reliable") # Server updates clients
|
||||||
func server_update_handle_transform(new_transform: Transform3D) -> void:
|
func server_update_handle_transform(new_transform: Transform3D) -> void:
|
||||||
SweetLogger.debug("entered")
|
SweetLogger.debug("->[]")
|
||||||
move_handle.global_transform = new_transform
|
move_handle.global_transform = new_transform
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@rpc("any_peer", "call_local", "reliable")
|
@rpc("any_peer", "call_local", "reliable")
|
||||||
func server_update_visibility(ghost_visible: bool, station_visible: bool) -> void:
|
func server_update_visibility(ghost_visible: bool, station_visible: bool) -> void:
|
||||||
SweetLogger.debug("entered")
|
SweetLogger.debug("->[]")
|
||||||
move_ghost.visible = ghost_visible
|
move_ghost.visible = ghost_visible
|
||||||
station.visible = station_visible
|
station.visible = station_visible
|
||||||
|
|
||||||
|
|
||||||
@rpc("any_peer", "call_local", "unreliable")
|
@rpc("any_peer", "call_local", "unreliable")
|
||||||
func server_update_move_ghost_transform(new_transform: Transform3D, new_color: Color = GHOST_COLOR_VALID) -> void:
|
func server_update_move_ghost_transform(new_transform: Transform3D, new_color: Color = GHOST_COLOR_VALID) -> void:
|
||||||
SweetLogger.debug("entered")
|
SweetLogger.debug("->[]")
|
||||||
move_ghost.global_transform = new_transform
|
move_ghost.global_transform = new_transform
|
||||||
_set_ghost_color(new_color)
|
_set_ghost_color(new_color)
|
||||||
|
|||||||
+89
-59
@@ -1,5 +1,5 @@
|
|||||||
class_name Table
|
class_name Table
|
||||||
extends StaticBody3D
|
extends SharedInventoryStation
|
||||||
|
|
||||||
@export var thinking_duration: float = 3.0
|
@export var thinking_duration: float = 3.0
|
||||||
@export var ordering_duration: float = 50.0
|
@export var ordering_duration: float = 50.0
|
||||||
@@ -32,22 +32,22 @@ enum TableState {
|
|||||||
EATING
|
EATING
|
||||||
}
|
}
|
||||||
|
|
||||||
## State is server-authoritative and synced (see table.tscn's Sync node);
|
|
||||||
## state transitions only ever run where NetworkManager.owns_world() is true
|
var _state: TableState = TableState.EMPTY
|
||||||
## (the whole station's _process is gated off elsewhere for non-owners, see
|
var _state_time: float = 0.0
|
||||||
## NetworkManager._gate_station). The setters below just refresh the display,
|
var _state_duration: float = 0.0
|
||||||
## so both the server (via _set_state) and clients (via incoming sync) show
|
|
||||||
## the same text. Use _set_state(), never assign _state directly.
|
|
||||||
@export var _state: TableState = TableState.EMPTY
|
|
||||||
@export var _state_time: float = 0.0
|
|
||||||
@export var _state_duration: float = 0.0 # set in _set_state_time
|
|
||||||
var _original_orders: Array[String] = []
|
var _original_orders: Array[String] = []
|
||||||
@export var _unsatisfied_orders: Array[String] = []
|
var _unsatisfied_orders: Array[String] = []
|
||||||
var _players_count: int = 0
|
var _players_count: int = 0
|
||||||
|
var _is_leader: bool = true # Only the group leader orchestrates the state and shows its own visuals; see _on_group_changed().
|
||||||
|
|
||||||
|
|
||||||
func place_order() -> void:
|
func place_order() -> void:
|
||||||
SweetLogger.debug("place_order()")
|
SweetLogger.debug("->[]")
|
||||||
|
if not NetworkManager.owns_world():
|
||||||
|
server_place_order.rpc_id(1)
|
||||||
|
SweetLogger.debug(" []-> rpc")
|
||||||
|
return
|
||||||
var new_orders: Array[String] = _unsatisfied_orders.duplicate()
|
var new_orders: Array[String] = _unsatisfied_orders.duplicate()
|
||||||
# for _i in range(0, randi_range(1, 2)):
|
# for _i in range(0, randi_range(1, 2)):
|
||||||
# new_orders.append(GameManager.get_random_meal())
|
# new_orders.append(GameManager.get_random_meal())
|
||||||
@@ -56,15 +56,18 @@ func place_order() -> void:
|
|||||||
new_orders.append(GameManager.get_random_meal())
|
new_orders.append(GameManager.get_random_meal())
|
||||||
_unsatisfied_orders = new_orders
|
_unsatisfied_orders = new_orders
|
||||||
_original_orders = _unsatisfied_orders.duplicate()
|
_original_orders = _unsatisfied_orders.duplicate()
|
||||||
|
_set_state(TableState.WAITING_PRIMARY)
|
||||||
|
SweetLogger.info("Placed order, orders: {0}", [_unsatisfied_orders])
|
||||||
|
|
||||||
@rpc("any_peer", "call_remote", "reliable")
|
@rpc("any_peer", "call_remote", "reliable")
|
||||||
func server_place_order() -> void:
|
func server_place_order() -> void:
|
||||||
|
SweetLogger.debug("->[]")
|
||||||
if NetworkManager.owns_world():
|
if NetworkManager.owns_world():
|
||||||
place_order()
|
place_order()
|
||||||
|
|
||||||
|
|
||||||
func absorb_items():
|
func absorb_items():
|
||||||
SweetLogger.debug("absorb_items()")
|
SweetLogger.debug("->[]")
|
||||||
for snap_zone_node in snap_zones:
|
for snap_zone_node in snap_zones:
|
||||||
var held_object = snap_zone_node.picked_up_object
|
var held_object = snap_zone_node.picked_up_object
|
||||||
if not held_object:
|
if not held_object:
|
||||||
@@ -73,8 +76,36 @@ func absorb_items():
|
|||||||
_absorb_item_if_correct(held_object)
|
_absorb_item_if_correct(held_object)
|
||||||
|
|
||||||
|
|
||||||
|
# Flattens items held across all of this table's snap zones
|
||||||
|
func get_exposed_food_items() -> Array[FoodItem]:
|
||||||
|
var items: Array[FoodItem] = []
|
||||||
|
for zone in snap_zones:
|
||||||
|
var held_object = zone.picked_up_object
|
||||||
|
if not held_object:
|
||||||
|
continue
|
||||||
|
var plate: PlateController = _get_plate_controller_from_item(held_object)
|
||||||
|
if plate:
|
||||||
|
items.append_array(plate.container.contained_items)
|
||||||
|
continue
|
||||||
|
var food_item: FoodItem = Helper.find_food_item(held_object)
|
||||||
|
if food_item:
|
||||||
|
items.append(food_item)
|
||||||
|
return items
|
||||||
|
|
||||||
|
|
||||||
|
# Only the group leader orchestrates the FSM and shows its visuals
|
||||||
|
func _on_group_changed() -> void:
|
||||||
|
_is_leader = is_group_leader()
|
||||||
|
if label_3d:
|
||||||
|
label_3d.visible = _is_leader
|
||||||
|
if label_3d_time:
|
||||||
|
label_3d_time.visible = _is_leader
|
||||||
|
if progress_bar:
|
||||||
|
progress_bar.set_bar_visible(_is_leader and progress_bar.is_bar_visible())
|
||||||
|
|
||||||
|
|
||||||
func satisfyAllOrders() -> void:
|
func satisfyAllOrders() -> void:
|
||||||
SweetLogger.debug("satisfyAllOrders()")
|
SweetLogger.debug("->[]")
|
||||||
_unsatisfied_orders.clear()
|
_unsatisfied_orders.clear()
|
||||||
_original_orders.clear()
|
_original_orders.clear()
|
||||||
clearAllFood()
|
clearAllFood()
|
||||||
@@ -82,7 +113,7 @@ func satisfyAllOrders() -> void:
|
|||||||
|
|
||||||
|
|
||||||
func clearAllFood() -> void:
|
func clearAllFood() -> void:
|
||||||
SweetLogger.debug("clearAllFood()")
|
SweetLogger.debug("->[]")
|
||||||
for zone in snap_zones:
|
for zone in snap_zones:
|
||||||
var held_object = zone.picked_up_object
|
var held_object = zone.picked_up_object
|
||||||
if not held_object:
|
if not held_object:
|
||||||
@@ -103,26 +134,37 @@ func clearAllFood() -> void:
|
|||||||
# Group called from Queue when trying to assign customers to tables
|
# Group called from Queue when trying to assign customers to tables
|
||||||
func try_consume_customer() -> bool:
|
func try_consume_customer() -> bool:
|
||||||
if _state == TableState.EMPTY:
|
if _state == TableState.EMPTY:
|
||||||
SweetLogger.debug("try_consume_customer, consumed a customer")
|
SweetLogger.debug("Try consume customer, consumed a customer")
|
||||||
_state_end(TableState.EMPTY)
|
_state_end(TableState.EMPTY)
|
||||||
return true
|
return true
|
||||||
return false
|
return false
|
||||||
|
|
||||||
|
|
||||||
|
func _enter_tree() -> void:
|
||||||
|
super._enter_tree()
|
||||||
|
var properties: Array[NodePath] = [".:_state_duration", ".:_state", ".:_state_time", ".:_unsatisfied_orders", "Customers:visible"]
|
||||||
|
for property_path in properties:
|
||||||
|
sync_config.add_property(property_path)
|
||||||
|
sync_config.property_set_spawn(property_path, false)
|
||||||
|
sync_config.property_set_replication_mode(property_path, SceneReplicationConfig.REPLICATION_MODE_ON_CHANGE)
|
||||||
|
SweetLogger.info("DEBUG sync_config properties: {0} | root_path: {1} | authority: {2} | peer: {3}", [sync_config.get_properties(), synchronizer.root_path, get_multiplayer_authority(), multiplayer.get_unique_id()]) # temp diagnostic
|
||||||
|
|
||||||
|
|
||||||
func _ready() -> void:
|
func _ready() -> void:
|
||||||
|
super.ready()
|
||||||
if not label_3d:
|
if not label_3d:
|
||||||
push_error("Table is missing reference to Label3D")
|
SweetLogger.warning("{0} missing label_3d reference", [name])
|
||||||
if not label_3d_time:
|
if not label_3d_time:
|
||||||
push_error("Table is missing reference to Label3DTime")
|
SweetLogger.warning("{0} missing label_3d_time reference", [name])
|
||||||
if not progress_bar or progress_bar is not ProgressBar3D:
|
if not progress_bar or progress_bar is not ProgressBar3D:
|
||||||
push_error("Table missing reference to progressbar, or wrong type:", progress_bar)
|
SweetLogger.warning("{0} missing progress_bar reference", [name])
|
||||||
progress_bar.y_billboard = true
|
progress_bar.y_billboard = true
|
||||||
progress_bar.exponential = true
|
progress_bar.exponential = true
|
||||||
# Render whatever state already arrived from the server before we were in
|
# Render whatever state already arrived from the server before we were in
|
||||||
# the tree (see the guard in _refresh_display).
|
# the tree (see the guard in _refresh_display).
|
||||||
_refresh_display.call_deferred()
|
_refresh_display.call_deferred()
|
||||||
if not audio_player:
|
if not audio_player:
|
||||||
push_error("Table is missing reference to AudioStreamPlayer3D")
|
SweetLogger.warning("{0} missing audio_player reference", [name])
|
||||||
|
|
||||||
# Get snap_zones for plates, store in array snap_zones
|
# Get snap_zones for plates, store in array snap_zones
|
||||||
for child in get_children():
|
for child in get_children():
|
||||||
@@ -131,31 +173,24 @@ func _ready() -> void:
|
|||||||
snap_zones.append(snap_zone_node)
|
snap_zones.append(snap_zone_node)
|
||||||
|
|
||||||
if snap_zones.is_empty():
|
if snap_zones.is_empty():
|
||||||
push_error("Table is missing XRToolsSnapZone children")
|
SweetLogger.warning("{0} missing XRToolsSnapZone children", [name])
|
||||||
return
|
return
|
||||||
|
|
||||||
for snap_zone_node in snap_zones:
|
for snap_zone_node in snap_zones:
|
||||||
snap_zone_node.has_picked_up.connect(_on_object_picked_up)
|
snap_zone_node.has_picked_up.connect(_on_object_picked_up)
|
||||||
snap_zone_node.has_dropped.connect(_on_object_dropped)
|
snap_zone_node.has_dropped.connect(_on_object_dropped)
|
||||||
# Never on a client: the state machine is server-authoritative and _state is
|
|
||||||
# synced down. NetworkManager._gate_station() already turned processing off,
|
|
||||||
# but a spawned station is gated BEFORE its _ready() runs, so an unconditional
|
|
||||||
# set_process(true) here would quietly re-arm the FSM on every client — and
|
|
||||||
# _state_end(EATING) re-enables the snap zones, which then fight the server
|
|
||||||
# for items sitting on the table.
|
|
||||||
set_process(NetworkManager.owns_world())
|
|
||||||
_set_state(TableState.EMPTY)
|
_set_state(TableState.EMPTY)
|
||||||
|
|
||||||
|
|
||||||
func _on_object_picked_up(_item) -> void:
|
func _on_object_picked_up(_item) -> void:
|
||||||
SweetLogger.debug("object picked up: {0}", [_item])
|
SweetLogger.debug("Object picked up: {0}", [_item])
|
||||||
if _state == TableState.EATING:
|
if _state == TableState.EATING:
|
||||||
return
|
return
|
||||||
_absorb_item_if_correct(_item)
|
_absorb_item_if_correct(_item)
|
||||||
|
|
||||||
|
|
||||||
func _on_object_dropped(_item) -> void:
|
func _on_object_dropped(_item) -> void:
|
||||||
SweetLogger.debug("object dropped, item: {0}", [_item])
|
SweetLogger.debug("Object dropped, item: {0}", [_item])
|
||||||
# If then player picks up a food_item (side) the table has already registerd, unregister
|
# If then player picks up a food_item (side) the table has already registerd, unregister
|
||||||
var food_item: FoodItem = Helper.find_food_item(_item)
|
var food_item: FoodItem = Helper.find_food_item(_item)
|
||||||
if food_item and food_item.type == FoodItem.Type.SIDE:
|
if food_item and food_item.type == FoodItem.Type.SIDE:
|
||||||
@@ -172,42 +207,32 @@ func _on_object_dropped(_item) -> void:
|
|||||||
# There is no on_stay signal, we have to track player with bool
|
# There is no on_stay signal, we have to track player with bool
|
||||||
func _on_player_enter(_body):
|
func _on_player_enter(_body):
|
||||||
_players_count += 1
|
_players_count += 1
|
||||||
SweetLogger.debug("_on_player_enter() players_count: {0}", [_players_count])
|
SweetLogger.debug("Player enter, players_count: {0}", [_players_count])
|
||||||
|
if _is_leader and _state == TableState.ORDERING:
|
||||||
|
place_order()
|
||||||
|
|
||||||
|
|
||||||
func _on_player_exit(_body):
|
func _on_player_exit(_body):
|
||||||
_players_count -= 1
|
_players_count -= 1
|
||||||
SweetLogger.debug("_on_player_exit() players_count: {0}", [_players_count])
|
SweetLogger.debug("Player exit, players_count: {0}", [_players_count])
|
||||||
|
|
||||||
|
|
||||||
func _place_order_if_player():
|
|
||||||
if _state != TableState.ORDERING:
|
|
||||||
return
|
|
||||||
if _players_count > 0:
|
|
||||||
place_order()
|
|
||||||
_set_state(TableState.WAITING_PRIMARY)
|
|
||||||
|
|
||||||
|
|
||||||
# func _get_plate_controller_from_item(_item: Node) -> PlateController:
|
|
||||||
# return _item.get_children().filter(func(c): return c is PlateController).front() as PlateController
|
|
||||||
|
|
||||||
|
|
||||||
func _get_plate_controller_from_item(_item: Node) -> PlateController:
|
func _get_plate_controller_from_item(_item: Node) -> PlateController:
|
||||||
if not _item:
|
if not _item:
|
||||||
SweetLogger.debug("_item is null")
|
SweetLogger.debug("Item is null")
|
||||||
return null
|
return null
|
||||||
|
|
||||||
for child in _item.get_children():
|
for child in _item.get_children():
|
||||||
if child is PlateController:
|
if child is PlateController:
|
||||||
SweetLogger.debug("found child")
|
SweetLogger.debug("Found child")
|
||||||
return child
|
return child
|
||||||
|
|
||||||
SweetLogger.debug("no match")
|
SweetLogger.debug("No match")
|
||||||
return null
|
return null
|
||||||
|
|
||||||
|
|
||||||
func _absorb_item_if_correct(_item: Node) -> void:
|
func _absorb_item_if_correct(_item: Node) -> void:
|
||||||
SweetLogger.debug("_absorb_item_if_correct, item: {0}", [_item])
|
SweetLogger.debug("Absorb item if correct, item: {0}", [_item])
|
||||||
if not _item:
|
if not _item:
|
||||||
return
|
return
|
||||||
if not (_state == TableState.WAITING_PRIMARY or _state == TableState.WAITING_FRIEND):
|
if not (_state == TableState.WAITING_PRIMARY or _state == TableState.WAITING_FRIEND):
|
||||||
@@ -215,14 +240,14 @@ func _absorb_item_if_correct(_item: Node) -> void:
|
|||||||
|
|
||||||
# Plate: Get plate controller in child of _item (hopefully a plate XRpickable)
|
# Plate: Get plate controller in child of _item (hopefully a plate XRpickable)
|
||||||
var plate_controller = _get_plate_controller_from_item(_item)
|
var plate_controller = _get_plate_controller_from_item(_item)
|
||||||
SweetLogger.debug("_absorb_item_if_correct plate_controller ref: {0}", [plate_controller])
|
SweetLogger.debug("Plate_controller ref: {0}", [plate_controller])
|
||||||
_item.print_tree_pretty()
|
_item.print_tree_pretty()
|
||||||
|
|
||||||
if plate_controller:
|
if plate_controller:
|
||||||
# Absorm items from the plate we want
|
# Absorm items from the plate we want
|
||||||
for food_item: FoodItem in plate_controller.container.contained_items: # TOOD: handle registering the meal again when a side is added to the plate
|
for food_item: FoodItem in plate_controller.container.contained_items: # TOOD: handle registering the meal again when a side is added to the plate
|
||||||
if food_item.id in _unsatisfied_orders and not food_item.is_absorbed:
|
if food_item.id in _unsatisfied_orders and not food_item.is_absorbed:
|
||||||
SweetLogger.debug("_absorb_item_if_correct held a plate with FoodItem that is in unsatisfied orders, removing it")
|
SweetLogger.debug("Held a plate with FoodItem that is in unsatisfied orders, removing it")
|
||||||
(plate_controller.get_parent() as XRToolsPickable).get_picked_up_by().enabled = false # Lock meal that is deliverd
|
(plate_controller.get_parent() as XRToolsPickable).get_picked_up_by().enabled = false # Lock meal that is deliverd
|
||||||
_unsatisfied_orders.erase(food_item.id)
|
_unsatisfied_orders.erase(food_item.id)
|
||||||
food_item.is_absorbed = true
|
food_item.is_absorbed = true
|
||||||
@@ -232,17 +257,17 @@ func _absorb_item_if_correct(_item: Node) -> void:
|
|||||||
# Side pickable item, no container
|
# Side pickable item, no container
|
||||||
var food_item: FoodItem = Helper.find_food_item(_item)
|
var food_item: FoodItem = Helper.find_food_item(_item)
|
||||||
if food_item and food_item.type == FoodItem.Type.SIDE:
|
if food_item and food_item.type == FoodItem.Type.SIDE:
|
||||||
SweetLogger.debug("_absorb_item_if_correct held a side that is in unsatisfied orders, removing it")
|
SweetLogger.debug("Held a side that is in unsatisfied orders, removing it")
|
||||||
# Do not lock snap zone here. Problem if table want many meals, but to many sides have filled up slots, so can't place plates.
|
# Do not lock snap zone here. Problem if table want many meals, but to many sides have filled up slots, so can't place plates.
|
||||||
_unsatisfied_orders.erase(food_item.id)
|
_unsatisfied_orders.erase(food_item.id)
|
||||||
_update_state_from_orders()
|
_update_state_from_orders()
|
||||||
return
|
return
|
||||||
|
|
||||||
SweetLogger.debug("absorb_item_if_correct() held object is not a Plate or Side")
|
SweetLogger.debug("Held object is not a Plate or Side")
|
||||||
|
|
||||||
|
|
||||||
func _update_state_from_orders():
|
func _update_state_from_orders():
|
||||||
SweetLogger.debug("_update_state_from_orders: unsatisfied_orders: {0}", [_unsatisfied_orders])
|
SweetLogger.debug("Unsatisfied_orders: {0}", [_unsatisfied_orders])
|
||||||
if _unsatisfied_orders.size() > 0 and _state != TableState.EATING:
|
if _unsatisfied_orders.size() > 0 and _state != TableState.EATING:
|
||||||
_set_state(TableState.WAITING_FRIEND)
|
_set_state(TableState.WAITING_FRIEND)
|
||||||
|
|
||||||
@@ -265,15 +290,15 @@ func _collect_money_from_food():
|
|||||||
elif food_item:
|
elif food_item:
|
||||||
GameManager.set_money(GameManager.money + food_item.sell_value)
|
GameManager.set_money(GameManager.money + food_item.sell_value)
|
||||||
|
|
||||||
SweetLogger.debug("_collect_money_from_food(), money: {0}", [GameManager.money])
|
SweetLogger.debug("Money: {0}", [GameManager.money])
|
||||||
|
|
||||||
|
|
||||||
func _set_snap_zones_enabled(value: bool) -> void:
|
func _set_snap_zones_enabled(value: bool) -> void:
|
||||||
# Enabling is the world owner's call only — a client's zones stay gated no
|
# Enabling is the world owner's call only — a client's zones stay gated no
|
||||||
# matter what state its copy of the FSM thinks it is in.
|
# matter what state its copy of the FSM thinks it is in.
|
||||||
var enabled := value and NetworkManager.owns_world()
|
var is_enabled := value and NetworkManager.owns_world()
|
||||||
for zone in snap_zones:
|
for zone in snap_zones:
|
||||||
zone.enabled = enabled
|
zone.enabled = is_enabled
|
||||||
|
|
||||||
|
|
||||||
## Server-only state transition: sets the new state's timer and assigns
|
## Server-only state transition: sets the new state's timer and assigns
|
||||||
@@ -302,7 +327,7 @@ func _set_state(newState: TableState) -> void:
|
|||||||
_state_time = primary_duration
|
_state_time = primary_duration
|
||||||
_state_duration = primary_duration
|
_state_duration = primary_duration
|
||||||
_state = newState
|
_state = newState
|
||||||
# Absorm meals that were already in the table when the state starts
|
# Absorm meals that were already in the table when the state starts (We missed the pickup event)
|
||||||
for zone in snap_zones:
|
for zone in snap_zones:
|
||||||
_absorb_item_if_correct(zone.picked_up_object)
|
_absorb_item_if_correct(zone.picked_up_object)
|
||||||
TableState.WAITING_FRIEND:
|
TableState.WAITING_FRIEND:
|
||||||
@@ -349,7 +374,7 @@ func _refresh_display() -> void:
|
|||||||
# null. Bail out until _ready() has resolved them; _ready() calls back in
|
# null. Bail out until _ready() has resolved them; _ready() calls back in
|
||||||
# once it has, so nothing that arrived early is lost.
|
# once it has, so nothing that arrived early is lost.
|
||||||
if not progress_bar or not label_3d or not label_3d_time:
|
if not progress_bar or not label_3d or not label_3d_time:
|
||||||
push_error("Table missing progress bar or label")
|
SweetLogger.warning("{0} missing progress_bar or label reference", [name])
|
||||||
return
|
return
|
||||||
match _state:
|
match _state:
|
||||||
TableState.IDLE:
|
TableState.IDLE:
|
||||||
@@ -383,13 +408,18 @@ func _refresh_display() -> void:
|
|||||||
|
|
||||||
|
|
||||||
func _process(delta: float) -> void:
|
func _process(delta: float) -> void:
|
||||||
|
super.process(delta)
|
||||||
|
#SweetLogger.debug("State {0} time: {1} duration: {2} is_leader: {3}", [TableState.keys()[_state], _state_time, _state_duration, _is_leader])
|
||||||
_refresh_display()
|
_refresh_display()
|
||||||
|
if not _is_leader:
|
||||||
|
return # Follower: the group leader orchestrates the FSM, we just mirror its synced state.
|
||||||
|
|
||||||
if not NetworkManager.owns_world():
|
if not NetworkManager.owns_world():
|
||||||
|
# SweetLogger.debug("Not server, skipping state update")
|
||||||
return
|
return
|
||||||
|
|
||||||
if GameManager.game_state == GameManager.GameState.GAME_OVER:
|
if GameManager.game_state == GameManager.GameState.GAME_OVER:
|
||||||
return
|
return
|
||||||
_place_order_if_player()
|
|
||||||
|
|
||||||
# If build mode, set, exit loop, be idle
|
# If build mode, set, exit loop, be idle
|
||||||
if GameManager.game_state == GameManager.GameState.BUILDING and not _state == TableState.IDLE:
|
if GameManager.game_state == GameManager.GameState.BUILDING and not _state == TableState.IDLE:
|
||||||
|
|||||||
+76
-62
@@ -1,37 +1,14 @@
|
|||||||
[gd_scene format=3 uid="uid://caf0xanmxbshy"]
|
[gd_scene format=3 uid="uid://caf0xanmxbshy"]
|
||||||
|
|
||||||
[ext_resource type="Script" uid="uid://caeikc7e3igkd" path="res://stations/table.gd" id="1_2vcpj"]
|
[ext_resource type="Script" uid="uid://caeikc7e3igkd" path="res://stations/table.gd" id="1_2vcpj"]
|
||||||
[ext_resource type="PackedScene" uid="uid://cvucwxibtol5f" path="res://stations/StationMovement.tscn" id="1_5mi7y"]
|
|
||||||
[ext_resource type="Script" uid="uid://cquqe4f1m1sw6" path="res://addons/godot-xr-tools/objects/snap_zone.gd" id="1_8j1nt"]
|
[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://cbs8jiqe8rcmn" path="res://abstract/station.tscn" id="1_station"]
|
||||||
[ext_resource type="AudioStream" uid="uid://ck72h06t8hyyk" path="res://sounds/money.mp3" id="2_jslhm"]
|
[ext_resource type="AudioStream" uid="uid://ck72h06t8hyyk" path="res://sounds/money.mp3" id="2_jslhm"]
|
||||||
[ext_resource type="AudioStream" uid="uid://dllgyc8jh83an" path="res://sounds/220195__gameaudio__click-wooden-1.wav" id="3_0s6ir"]
|
[ext_resource type="AudioStream" uid="uid://dllgyc8jh83an" path="res://sounds/220195__gameaudio__click-wooden-1.wav" id="3_0s6ir"]
|
||||||
[ext_resource type="PackedScene" uid="uid://bxbocxdaayvwx" path="res://UI/progress_bar.tscn" id="3_kjf1i"]
|
[ext_resource type="PackedScene" uid="uid://bxbocxdaayvwx" path="res://UI/progress_bar.tscn" id="3_kjf1i"]
|
||||||
|
|
||||||
[sub_resource type="SceneReplicationConfig" id="SceneReplicationConfig_np_table"]
|
[sub_resource type="BoxShape3D" id="BoxShape3D_probe"]
|
||||||
properties/0/path = NodePath(".:position")
|
size = Vector3(0.2, 0.3, 0.2)
|
||||||
properties/0/spawn = false
|
|
||||||
properties/0/replication_mode = 1
|
|
||||||
properties/1/path = NodePath(".:rotation")
|
|
||||||
properties/1/spawn = false
|
|
||||||
properties/1/replication_mode = 1
|
|
||||||
properties/2/path = NodePath(".:visible")
|
|
||||||
properties/2/spawn = false
|
|
||||||
properties/2/replication_mode = 1
|
|
||||||
properties/3/path = NodePath(".:_state_duration")
|
|
||||||
properties/3/spawn = false
|
|
||||||
properties/3/replication_mode = 1
|
|
||||||
properties/4/path = NodePath(".:_state")
|
|
||||||
properties/4/spawn = false
|
|
||||||
properties/4/replication_mode = 1
|
|
||||||
properties/5/path = NodePath(".:_state_time")
|
|
||||||
properties/5/spawn = false
|
|
||||||
properties/5/replication_mode = 1
|
|
||||||
properties/6/path = NodePath(".:_unsatisfied_orders")
|
|
||||||
properties/6/spawn = false
|
|
||||||
properties/6/replication_mode = 1
|
|
||||||
properties/7/path = NodePath("Customers:visible")
|
|
||||||
properties/7/spawn = false
|
|
||||||
properties/7/replication_mode = 1
|
|
||||||
|
|
||||||
[sub_resource type="BoxShape3D" id="BoxShape3D_24d3s"]
|
[sub_resource type="BoxShape3D" id="BoxShape3D_24d3s"]
|
||||||
size = Vector3(0.7983472, 0.060000002, 0.59873295)
|
size = Vector3(0.7983472, 0.060000002, 0.59873295)
|
||||||
@@ -45,28 +22,65 @@ albedo_color = Color(0.31, 0.21576, 0.1333, 1)
|
|||||||
[sub_resource type="BoxShape3D" id="BoxShape3D_vlqg6"]
|
[sub_resource type="BoxShape3D" id="BoxShape3D_vlqg6"]
|
||||||
size = Vector3(2.1, 0.5, 2.1)
|
size = Vector3(2.1, 0.5, 2.1)
|
||||||
|
|
||||||
[node name="Table" type="Node3D" unique_id=987495548]
|
[node name="Table" unique_id=987495548 instance=ExtResource("1_station")]
|
||||||
|
|
||||||
[node name="StationMovement" parent="." unique_id=946873975 node_paths=PackedStringArray("station") instance=ExtResource("1_5mi7y")]
|
[node name="StationMovement" parent="." index="0" unique_id=946873975 node_paths=PackedStringArray("station")]
|
||||||
station = NodePath("../Table")
|
station = NodePath("../Table")
|
||||||
|
|
||||||
[node name="MultiplayerSyncronizer" type="MultiplayerSynchronizer" parent="." unique_id=2000411505]
|
[node name="ProgressBar3D" parent="." index="4" unique_id=654673176]
|
||||||
root_path = NodePath("../Table")
|
visible = false
|
||||||
replication_config = SubResource("SceneReplicationConfig_np_table")
|
|
||||||
|
|
||||||
[node name="Table" type="StaticBody3D" parent="." unique_id=1863572470 groups=["station", "table"]]
|
[node name="SnapZone" parent="." index="5" unique_id=1315859105]
|
||||||
|
enabled = false
|
||||||
|
|
||||||
|
[node name="Table" type="StaticBody3D" parent="." index="6" unique_id=1863572470 node_paths=PackedStringArray("notification_audio", "ambient_audio", "snap_zone", "synchronizer") groups=["station", "table"]]
|
||||||
script = ExtResource("1_2vcpj")
|
script = ExtResource("1_2vcpj")
|
||||||
money_sound = ExtResource("2_jslhm")
|
money_sound = ExtResource("2_jslhm")
|
||||||
|
probe_paths = Array[NodePath]([NodePath("ProbeForward"), NodePath("ProbeRight"), NodePath("ProbeBack"), NodePath("ProbeLeft")])
|
||||||
|
pickup_sound = ExtResource("3_0s6ir")
|
||||||
|
drop_sound = ExtResource("3_0s6ir")
|
||||||
|
notification_audio = NodePath("../AudioStreamPlayer3DNotification")
|
||||||
|
ambient_audio = NodePath("../AudioStreamPlayer3DAmbient")
|
||||||
|
snap_zone = NodePath("XRToolsSnapZone")
|
||||||
|
synchronizer = NodePath("../MultiplayerSynchronizer")
|
||||||
|
|
||||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="Table" unique_id=228053941]
|
[node name="ProbeForward" type="Area3D" parent="Table" index="0" unique_id=-1294555795]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.5, -0.45)
|
||||||
|
collision_layer = 512
|
||||||
|
|
||||||
|
[node name="CollisionShape3D" type="CollisionShape3D" parent="Table/ProbeForward" index="0" unique_id=-1294555794]
|
||||||
|
shape = SubResource("BoxShape3D_probe")
|
||||||
|
|
||||||
|
[node name="ProbeRight" type="Area3D" parent="Table" index="1" unique_id=-1294555793]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.45, 0.5, 0)
|
||||||
|
collision_layer = 512
|
||||||
|
|
||||||
|
[node name="CollisionShape3D" type="CollisionShape3D" parent="Table/ProbeRight" index="0" unique_id=-1294555792]
|
||||||
|
shape = SubResource("BoxShape3D_probe")
|
||||||
|
|
||||||
|
[node name="ProbeBack" type="Area3D" parent="Table" index="2" unique_id=-1294555791]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.5, 0.45)
|
||||||
|
collision_layer = 512
|
||||||
|
|
||||||
|
[node name="CollisionShape3D" type="CollisionShape3D" parent="Table/ProbeBack" index="0" unique_id=-1294555790]
|
||||||
|
shape = SubResource("BoxShape3D_probe")
|
||||||
|
|
||||||
|
[node name="ProbeLeft" type="Area3D" parent="Table" index="3" unique_id=-1294555789]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.45, 0.5, 0)
|
||||||
|
collision_layer = 512
|
||||||
|
|
||||||
|
[node name="CollisionShape3D" type="CollisionShape3D" parent="Table/ProbeLeft" index="0" unique_id=-1294555788]
|
||||||
|
shape = SubResource("BoxShape3D_probe")
|
||||||
|
|
||||||
|
[node name="CollisionShape3D" type="CollisionShape3D" parent="Table" index="4" unique_id=228053941]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.50155246, 0)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.50155246, 0)
|
||||||
shape = SubResource("BoxShape3D_24d3s")
|
shape = SubResource("BoxShape3D_24d3s")
|
||||||
|
|
||||||
[node name="CollisionShape3D2" type="CollisionShape3D" parent="Table" unique_id=276384063]
|
[node name="CollisionShape3D2" type="CollisionShape3D" parent="Table" index="5" unique_id=276384063]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.094791204, 0.9715525, 0.0012244582)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.094791204, 0.9715525, 0.0012244582)
|
||||||
shape = SubResource("BoxShape3D_24d3s")
|
shape = SubResource("BoxShape3D_24d3s")
|
||||||
|
|
||||||
[node name="XRToolsSnapZone" type="Area3D" parent="Table" unique_id=1947858647 groups=["station_zone"]]
|
[node name="XRToolsSnapZone" type="Area3D" parent="Table" index="6" unique_id=1947858647 groups=["station_zone"]]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.0285525, 0)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.0285525, 0)
|
||||||
collision_layer = 65536
|
collision_layer = 65536
|
||||||
collision_mask = 65540
|
collision_mask = 65540
|
||||||
@@ -75,90 +89,90 @@ stash_sound = ExtResource("3_0s6ir")
|
|||||||
snap_mode = 1
|
snap_mode = 1
|
||||||
metadata/_custom_type_script = "uid://cquqe4f1m1sw6"
|
metadata/_custom_type_script = "uid://cquqe4f1m1sw6"
|
||||||
|
|
||||||
[node name="CollisionShape3D2" type="CollisionShape3D" parent="Table/XRToolsSnapZone" unique_id=1176887393]
|
[node name="CollisionShape3D2" type="CollisionShape3D" parent="Table/XRToolsSnapZone" index="0" unique_id=1176887393]
|
||||||
transform = Transform3D(0.5, 0, 0, 0, 0.5, 0, 0, 0, 0.5, 0, -0.000975132, 0)
|
transform = Transform3D(0.5, 0, 0, 0, 0.5, 0, 0, 0, 0.5, 0, -0.000975132, 0)
|
||||||
shape = SubResource("SphereShape3D_dlkho")
|
shape = SubResource("SphereShape3D_dlkho")
|
||||||
|
|
||||||
[node name="AudioStreamPlayer3D" type="AudioStreamPlayer3D" parent="Table/XRToolsSnapZone" unique_id=2135860710]
|
[node name="AudioStreamPlayer3D" type="AudioStreamPlayer3D" parent="Table/XRToolsSnapZone" index="1" unique_id=2135860710]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.013531357, -0.015141487, 0.012176305)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.013531357, -0.015141487, 0.012176305)
|
||||||
|
|
||||||
[node name="CSGCombiner3D" type="CSGCombiner3D" parent="Table" unique_id=2085635675]
|
[node name="CSGCombiner3D" type="CSGCombiner3D" parent="Table" index="7" unique_id=2085635675]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.50155246, 0)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.50155246, 0)
|
||||||
|
|
||||||
[node name="CSGBox3D" type="CSGBox3D" parent="Table/CSGCombiner3D" unique_id=411048765]
|
[node name="CSGBox3D" type="CSGBox3D" parent="Table/CSGCombiner3D" index="0" unique_id=411048765]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.46137518, 0)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.46137518, 0)
|
||||||
size = Vector3(0.6, 0.077, 0.6)
|
size = Vector3(0.6, 0.077, 0.6)
|
||||||
material = SubResource("StandardMaterial3D_24d3s")
|
material = SubResource("StandardMaterial3D_24d3s")
|
||||||
|
|
||||||
[node name="CSGBox3D2" type="CSGBox3D" parent="Table/CSGCombiner3D" unique_id=2093582402]
|
[node name="CSGBox3D2" type="CSGBox3D" parent="Table/CSGCombiner3D" index="1" unique_id=2093582402]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.02685462, 0)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.02685462, 0)
|
||||||
size = Vector3(0.1, 0.9258911, 0.1)
|
size = Vector3(0.1, 0.9258911, 0.1)
|
||||||
material = SubResource("StandardMaterial3D_24d3s")
|
material = SubResource("StandardMaterial3D_24d3s")
|
||||||
|
|
||||||
[node name="CSGBox3D4" type="CSGBox3D" parent="Table/CSGCombiner3D" unique_id=345709075]
|
[node name="CSGBox3D4" type="CSGBox3D" parent="Table/CSGCombiner3D" index="2" unique_id=345709075]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.41408914, 0)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.41408914, 0)
|
||||||
size = Vector3(0.1, 0.15142211, 0.5341797)
|
size = Vector3(0.1, 0.15142211, 0.5341797)
|
||||||
material = SubResource("StandardMaterial3D_24d3s")
|
material = SubResource("StandardMaterial3D_24d3s")
|
||||||
|
|
||||||
[node name="CSGBox3D5" type="CSGBox3D" parent="Table/CSGCombiner3D" unique_id=550923256]
|
[node name="CSGBox3D5" type="CSGBox3D" parent="Table/CSGCombiner3D" index="3" unique_id=550923256]
|
||||||
transform = Transform3D(-4.371139e-08, 0, -1, 0, 1, 0, 1, 0, -4.371139e-08, 0, -0.41408914, 0)
|
transform = Transform3D(-4.371139e-08, 0, -1, 0, 1, 0, 1, 0, -4.371139e-08, 0, -0.41408914, 0)
|
||||||
size = Vector3(0.1, 0.15142211, 0.5341797)
|
size = Vector3(0.1, 0.15142211, 0.5341797)
|
||||||
material = SubResource("StandardMaterial3D_24d3s")
|
material = SubResource("StandardMaterial3D_24d3s")
|
||||||
|
|
||||||
[node name="Customers" type="Node3D" parent="Table" unique_id=2147179512]
|
[node name="Customers" type="Node3D" parent="Table" index="8" unique_id=2147179512]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.50155246, 0)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.50155246, 0)
|
||||||
|
|
||||||
[node name="Customer" type="Node3D" parent="Table/Customers" unique_id=1265943831]
|
[node name="Customer" type="Node3D" parent="Table/Customers" index="0" unique_id=1265943831]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.016780734, -0.08218986, 0)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.016780734, -0.08218986, 0)
|
||||||
|
|
||||||
[node name="CSGCombiner3D" type="CSGCombiner3D" parent="Table/Customers/Customer" unique_id=1211819222]
|
[node name="CSGCombiner3D" type="CSGCombiner3D" parent="Table/Customers/Customer" index="0" unique_id=1211819222]
|
||||||
transform = Transform3D(1.095, 0, 0, 0, 1.095, 0, 0, 0, 1.095, 0.08442788, -0.19989291, 0)
|
transform = Transform3D(1.095, 0, 0, 0, 1.095, 0, 0, 0, 1.095, 0.08442788, -0.19989291, 0)
|
||||||
|
|
||||||
[node name="CSGSphere3D" type="CSGSphere3D" parent="Table/Customers/Customer/CSGCombiner3D" unique_id=2104132980]
|
[node name="CSGSphere3D" type="CSGSphere3D" parent="Table/Customers/Customer/CSGCombiner3D" index="0" unique_id=2104132980]
|
||||||
transform = Transform3D(0.9999998, 0, 0, 0, 0.9999998, 0, 0, 0, 0.9999998, -0.7149929, 1.2762557, 0)
|
transform = Transform3D(0.9999998, 0, 0, 0, 0.9999998, 0, 0, 0, 0.9999998, -0.7149929, 1.2762557, 0)
|
||||||
radius = 0.17520222
|
radius = 0.17520222
|
||||||
|
|
||||||
[node name="CSGSphere3D2" type="CSGSphere3D" parent="Table/Customers/Customer/CSGCombiner3D" unique_id=808477724]
|
[node name="CSGSphere3D2" type="CSGSphere3D" parent="Table/Customers/Customer/CSGCombiner3D" index="1" unique_id=808477724]
|
||||||
transform = Transform3D(0.9999998, 0, 0, 0, 1.7476468, 0, 0, 0, 0.9999998, -0.7366721, 0.8531885, 0)
|
transform = Transform3D(0.9999998, 0, 0, 0, 1.7476468, 0, 0, 0, 0.9999998, -0.7366721, 0.8531885, 0)
|
||||||
radius = 0.17520222
|
radius = 0.17520222
|
||||||
|
|
||||||
[node name="Seats" type="Node3D" parent="Table" unique_id=1101423789]
|
[node name="Seats" type="Node3D" parent="Table" index="9" unique_id=1101423789]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.50155246, 0)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.50155246, 0)
|
||||||
|
|
||||||
[node name="Seat" type="Node3D" parent="Table/Seats" unique_id=1951252898]
|
[node name="Seat" type="Node3D" parent="Table/Seats" index="0" unique_id=1951252898]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.9079602, -0.37259835, 0)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.9079602, -0.37259835, 0)
|
||||||
|
|
||||||
[node name="CSGCombiner3D" type="CSGCombiner3D" parent="Table/Seats/Seat" unique_id=384912485]
|
[node name="CSGCombiner3D" type="CSGCombiner3D" parent="Table/Seats/Seat" index="0" unique_id=384912485]
|
||||||
|
|
||||||
[node name="CSGCylinder3D" type="CSGCylinder3D" parent="Table/Seats/Seat/CSGCombiner3D" unique_id=170426769]
|
[node name="CSGCylinder3D" type="CSGCylinder3D" parent="Table/Seats/Seat/CSGCombiner3D" index="0" unique_id=170426769]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.18637085, 0.51674986, 0)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.18637085, 0.51674986, 0)
|
||||||
radius = 0.25634766
|
radius = 0.25634766
|
||||||
height = 0.051940918
|
height = 0.051940918
|
||||||
sides = 16
|
sides = 16
|
||||||
|
|
||||||
[node name="CSGCylinder3D2" type="CSGCylinder3D" parent="Table/Seats/Seat/CSGCombiner3D" unique_id=1294605073]
|
[node name="CSGCylinder3D2" type="CSGCylinder3D" parent="Table/Seats/Seat/CSGCombiner3D" index="1" unique_id=1294605073]
|
||||||
transform = Transform3D(0.24355066, 0.98373884, 0, -1.3339849, 0.1796049, 0, 0, 0, 0.8365013, -0.05247748, 0.8547088, 0)
|
transform = Transform3D(0.24355066, 0.98373884, 0, -1.3339849, 0.1796049, 0, 0, 0, 0.8365013, -0.05247748, 0.8547088, 0)
|
||||||
radius = 0.25634766
|
radius = 0.25634766
|
||||||
height = 0.051940918
|
height = 0.051940918
|
||||||
sides = 16
|
sides = 16
|
||||||
|
|
||||||
[node name="CSGBox3D" type="CSGBox3D" parent="Table/Seats/Seat/CSGCombiner3D" unique_id=1761839440]
|
[node name="CSGBox3D" type="CSGBox3D" parent="Table/Seats/Seat/CSGCombiner3D" index="2" unique_id=1761839440]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.030369163, 0.18746406, 0.1341562)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.030369163, 0.18746406, 0.1341562)
|
||||||
size = Vector3(0.05, 0.6713196, 0.05)
|
size = Vector3(0.05, 0.6713196, 0.05)
|
||||||
|
|
||||||
[node name="CSGBox3D2" type="CSGBox3D" parent="Table/Seats/Seat/CSGCombiner3D" unique_id=1395371703]
|
[node name="CSGBox3D2" type="CSGBox3D" parent="Table/Seats/Seat/CSGCombiner3D" index="3" unique_id=1395371703]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.030369163, 0.18746406, -0.15065354)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.030369163, 0.18746406, -0.15065354)
|
||||||
size = Vector3(0.05, 0.6713196, 0.05)
|
size = Vector3(0.05, 0.6713196, 0.05)
|
||||||
|
|
||||||
[node name="CSGBox3D3" type="CSGBox3D" parent="Table/Seats/Seat/CSGCombiner3D" unique_id=96608061]
|
[node name="CSGBox3D3" type="CSGBox3D" parent="Table/Seats/Seat/CSGCombiner3D" index="4" unique_id=96608061]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.33084005, 0.18746406, 0.1341562)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.33084005, 0.18746406, 0.1341562)
|
||||||
size = Vector3(0.05, 0.6713196, 0.05)
|
size = Vector3(0.05, 0.6713196, 0.05)
|
||||||
|
|
||||||
[node name="CSGBox3D4" type="CSGBox3D" parent="Table/Seats/Seat/CSGCombiner3D" unique_id=1684738537]
|
[node name="CSGBox3D4" type="CSGBox3D" parent="Table/Seats/Seat/CSGCombiner3D" index="5" unique_id=1684738537]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.33084005, 0.18746406, -0.15065354)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.33084005, 0.18746406, -0.15065354)
|
||||||
size = Vector3(0.05, 0.6713196, 0.05)
|
size = Vector3(0.05, 0.6713196, 0.05)
|
||||||
|
|
||||||
[node name="Label3D" type="Label3D" parent="Table" unique_id=662960977]
|
[node name="Label3D" type="Label3D" parent="Table" index="10" unique_id=662960977]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.8263302, 0)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.8263302, 0)
|
||||||
pixel_size = 0.003
|
pixel_size = 0.003
|
||||||
billboard = 2
|
billboard = 2
|
||||||
@@ -166,26 +180,26 @@ text = "table state"
|
|||||||
vertical_alignment = 0
|
vertical_alignment = 0
|
||||||
line_spacing = -15.0
|
line_spacing = -15.0
|
||||||
|
|
||||||
[node name="Label3DTime" type="Label3D" parent="Table" unique_id=1534849507]
|
[node name="Label3DTime" type="Label3D" parent="Table" index="11" unique_id=1534849507]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 2.0147986, 0)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 2.0147986, 0)
|
||||||
visible = false
|
visible = false
|
||||||
pixel_size = 0.003
|
pixel_size = 0.003
|
||||||
billboard = 2
|
billboard = 2
|
||||||
text = "20.1s"
|
text = "20.1s"
|
||||||
|
|
||||||
[node name="ProgressBar3D" parent="Table" unique_id=654673176 instance=ExtResource("3_kjf1i")]
|
[node name="ProgressBar3D" parent="Table" index="12" unique_id=600000001 instance=ExtResource("3_kjf1i")]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.8692299, 0)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.8692299, 0)
|
||||||
y_billboard = true
|
y_billboard = true
|
||||||
|
|
||||||
[node name="AudioStreamPlayer3D" type="AudioStreamPlayer3D" parent="Table" unique_id=724610642]
|
[node name="AudioStreamPlayer3D" type="AudioStreamPlayer3D" parent="Table" index="13" unique_id=724610642]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.7950532, 0)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.7950532, 0)
|
||||||
|
|
||||||
[node name="PlayerDetectArea3D" type="Area3D" parent="Table" unique_id=913445150]
|
[node name="PlayerDetectArea3D" type="Area3D" parent="Table" index="14" unique_id=913445150]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.50155246, 0)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.50155246, 0)
|
||||||
collision_layer = 0
|
collision_layer = 0
|
||||||
collision_mask = 524288
|
collision_mask = 524288
|
||||||
|
|
||||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="Table/PlayerDetectArea3D" unique_id=1538221021]
|
[node name="CollisionShape3D" type="CollisionShape3D" parent="Table/PlayerDetectArea3D" index="0" unique_id=1538221021]
|
||||||
shape = SubResource("BoxShape3D_vlqg6")
|
shape = SubResource("BoxShape3D_vlqg6")
|
||||||
|
|
||||||
[connection signal="body_entered" from="Table/PlayerDetectArea3D" to="Table" method="_on_player_enter"]
|
[connection signal="body_entered" from="Table/PlayerDetectArea3D" to="Table" method="_on_player_enter"]
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[gd_resource type="StandardMaterial3D" format=3 uid="uid://cmia50cfqxxo4"]
|
[gd_resource type="StandardMaterial3D" format=3 uid="uid://cmia50cfqxxo4"]
|
||||||
|
|
||||||
[ext_resource type="Texture2D" uid="uid://di387qcr5vmsp" path="res://Textures/devTex.svg" id="1_3jxsn"]
|
[ext_resource type="Texture2D" uid="uid://di387qcr5vmsp" path="res://textures/devTex.svg" id="1_3jxsn"]
|
||||||
|
|
||||||
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_0gbf8"]
|
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_0gbf8"]
|
||||||
transparency = 1
|
transparency = 1
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[gd_resource type="Sky" format=3 uid="uid://c1abtpwhdm2d5"]
|
[gd_resource type="Sky" format=3 uid="uid://c1abtpwhdm2d5"]
|
||||||
|
|
||||||
[ext_resource type="Texture2D" uid="uid://bsuhedl8ltapa" path="res://Textures/sky/NightSkyHDRI009_16K_HDR.exr" id="acg_mft3ic9d"]
|
[ext_resource type="Texture2D" uid="uid://bsuhedl8ltapa" path="res://textures/sky/NightSkyHDRI009_16K_HDR.exr" id="acg_mft3ic9d"]
|
||||||
|
|
||||||
[sub_resource type="PanoramaSkyMaterial" id="acg_025sfqr4"]
|
[sub_resource type="PanoramaSkyMaterial" id="acg_025sfqr4"]
|
||||||
panorama = ExtResource("acg_mft3ic9d")
|
panorama = ExtResource("acg_mft3ic9d")
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ class_name ProgressBar3D
|
|||||||
|
|
||||||
func _ready() -> void:
|
func _ready() -> void:
|
||||||
if not progress_bar:
|
if not progress_bar:
|
||||||
push_error("Progressbar3D missing reference to ProgressBar")
|
SweetLogger.warning("{0} missing progress_bar reference", [name])
|
||||||
if y_billboard:
|
if y_billboard:
|
||||||
$Sprite3D.billboard = BaseMaterial3D.BillboardMode.BILLBOARD_FIXED_Y
|
$Sprite3D.billboard = BaseMaterial3D.BillboardMode.BILLBOARD_FIXED_Y
|
||||||
|
|
||||||
|
|||||||
+12
-12
@@ -3,21 +3,21 @@
|
|||||||
[ext_resource type="Script" uid="uid://xrfp03b32j1t" path="res://UI/shop_ui.gd" id="1_2k6ie"]
|
[ext_resource type="Script" uid="uid://xrfp03b32j1t" path="res://UI/shop_ui.gd" id="1_2k6ie"]
|
||||||
[ext_resource type="PackedScene" uid="uid://u7rpukx5ebqo" path="res://UI/shop_station_panel.tscn" id="1_pogqh"]
|
[ext_resource type="PackedScene" uid="uid://u7rpukx5ebqo" path="res://UI/shop_station_panel.tscn" id="1_pogqh"]
|
||||||
[ext_resource type="PackedScene" uid="uid://efaec6ymgabo" path="res://stations/Counter.tscn" id="2_35otv"]
|
[ext_resource type="PackedScene" uid="uid://efaec6ymgabo" path="res://stations/Counter.tscn" id="2_35otv"]
|
||||||
[ext_resource type="Texture2D" uid="uid://c0nd4nh4vja73" path="res://textures/shop/counter.png" id="3_74fni"]
|
[ext_resource type="Texture2D" uid="uid://dhja7i8tgb3ao" path="res://textures/shop/counter.png" id="3_74fni"]
|
||||||
[ext_resource type="PackedScene" uid="uid://j7caslh27nor" path="res://stations/Hob.tscn" id="4_l3qkl"]
|
[ext_resource type="Texture2D" uid="uid://br4ytiocwouqh" path="res://textures/shop/hob.png" id="5_2k6ie"]
|
||||||
[ext_resource type="Texture2D" uid="uid://ejby14dl1svr" path="res://textures/shop/hob.png" id="5_2k6ie"]
|
[ext_resource type="PackedScene" uid="uid://b052o1fgwq5bw" path="res://stations/Hob.tscn" id="5_6lkkh"]
|
||||||
[ext_resource type="PackedScene" uid="uid://dvrk268s7gkxh" path="res://stations/sink.tscn" id="6_rktus"]
|
[ext_resource type="PackedScene" uid="uid://dvrk268s7gkxh" path="res://stations/sink.tscn" id="6_rktus"]
|
||||||
[ext_resource type="Texture2D" uid="uid://ecdu0qqhib4" path="res://textures/shop/sink.png" id="7_4titf"]
|
[ext_resource type="Texture2D" uid="uid://gi6bksvs8ybx" path="res://textures/shop/sink.png" id="7_4titf"]
|
||||||
[ext_resource type="PackedScene" uid="uid://caf0xanmxbshy" path="res://stations/table.tscn" id="9_84wnh"]
|
[ext_resource type="PackedScene" uid="uid://caf0xanmxbshy" path="res://stations/table.tscn" id="9_84wnh"]
|
||||||
[ext_resource type="PackedScene" uid="uid://cwnwo4i28upap" path="res://stations/raw_burger_dispenser.tscn" id="9_vl3v4"]
|
[ext_resource type="PackedScene" uid="uid://cwnwo4i28upap" path="res://stations/raw_burger_dispenser.tscn" id="9_vl3v4"]
|
||||||
[ext_resource type="Texture2D" uid="uid://dpaqhbpmk7exf" path="res://textures/shop/raw_burger.png" id="10_rkek4"]
|
[ext_resource type="Texture2D" uid="uid://b57nybt7her3k" path="res://textures/shop/raw_burger.png" id="10_rkek4"]
|
||||||
[ext_resource type="Texture2D" uid="uid://cv3grgonwlakt" path="res://textures/shop/table.png" id="10_sb5p3"]
|
[ext_resource type="Texture2D" uid="uid://dp4ccvp2xgpqy" path="res://textures/shop/table.png" id="10_sb5p3"]
|
||||||
[ext_resource type="PackedScene" uid="uid://c6rift56ql3f8" path="res://stations/BurgerBunsDispenser.tscn" id="11_4m5wg"]
|
[ext_resource type="PackedScene" uid="uid://c6rift56ql3f8" path="res://stations/BurgerBunsDispenser.tscn" id="11_4m5wg"]
|
||||||
[ext_resource type="Texture2D" uid="uid://bmomecu0058xg" path="res://textures/shop/burger_buns.png" id="12_84wnh"]
|
[ext_resource type="Texture2D" uid="uid://4p7i3p3ox3qi" path="res://textures/shop/burger_buns.png" id="12_84wnh"]
|
||||||
[ext_resource type="PackedScene" uid="uid://ck5tuftqmyiue" path="res://stations/plate_dispenser.tscn" id="13_4m5wg"]
|
[ext_resource type="PackedScene" uid="uid://ck5tuftqmyiue" path="res://stations/plate_dispenser.tscn" id="13_4m5wg"]
|
||||||
[ext_resource type="Texture2D" uid="uid://cjrwhtsjjhtu7" path="res://textures/shop/plates.png" id="14_84wnh"]
|
[ext_resource type="Texture2D" uid="uid://ouqlicmcjay3" path="res://textures/shop/plates.png" id="14_84wnh"]
|
||||||
[ext_resource type="PackedScene" uid="uid://sc6i0i1f0o48" path="res://stations/potato_dispenser.tscn" id="17_pdan6"]
|
[ext_resource type="PackedScene" uid="uid://sc6i0i1f0o48" path="res://stations/potato_dispenser.tscn" id="17_pdan6"]
|
||||||
[ext_resource type="Texture2D" uid="uid://blekcmdjkxs0q" path="res://textures/shop/potatoes.png" id="18_6lkkh"]
|
[ext_resource type="Texture2D" uid="uid://br4y6kq8w3usi" path="res://textures/shop/potatoes.png" id="18_6lkkh"]
|
||||||
|
|
||||||
[sub_resource type="LabelSettings" id="LabelSettings_vlqg6"]
|
[sub_resource type="LabelSettings" id="LabelSettings_vlqg6"]
|
||||||
font_size = 35
|
font_size = 35
|
||||||
@@ -59,10 +59,9 @@ offset_left = 20.0
|
|||||||
offset_top = 80.0
|
offset_top = 80.0
|
||||||
offset_right = -20.0
|
offset_right = -20.0
|
||||||
offset_bottom = -20.0
|
offset_bottom = -20.0
|
||||||
current_tab = 1
|
current_tab = 0
|
||||||
|
|
||||||
[node name="Stations" type="GridContainer" parent="TabContainer" unique_id=189446761]
|
[node name="Stations" type="GridContainer" parent="TabContainer" unique_id=189446761]
|
||||||
visible = false
|
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
columns = 6
|
columns = 6
|
||||||
metadata/_tab_index = 0
|
metadata/_tab_index = 0
|
||||||
@@ -76,7 +75,7 @@ cost = 30
|
|||||||
|
|
||||||
[node name="Panel2" parent="TabContainer/Stations" unique_id=467593590 instance=ExtResource("1_pogqh")]
|
[node name="Panel2" parent="TabContainer/Stations" unique_id=467593590 instance=ExtResource("1_pogqh")]
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
station_scene = ExtResource("4_l3qkl")
|
station_scene = ExtResource("5_6lkkh")
|
||||||
icon_texture = ExtResource("5_2k6ie")
|
icon_texture = ExtResource("5_2k6ie")
|
||||||
station_name = "Hob"
|
station_name = "Hob"
|
||||||
cost = 60
|
cost = 60
|
||||||
@@ -103,6 +102,7 @@ station_name = "Plates"
|
|||||||
cost = 80
|
cost = 80
|
||||||
|
|
||||||
[node name="Food" type="GridContainer" parent="TabContainer" unique_id=422899445]
|
[node name="Food" type="GridContainer" parent="TabContainer" unique_id=422899445]
|
||||||
|
visible = false
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
columns = 6
|
columns = 6
|
||||||
metadata/_tab_index = 1
|
metadata/_tab_index = 1
|
||||||
|
|||||||
@@ -21,12 +21,12 @@ func _process(_delta: float) -> void:
|
|||||||
|
|
||||||
|
|
||||||
func _on_button_pressed() -> void:
|
func _on_button_pressed() -> void:
|
||||||
SweetLogger.debug("buy {0}", [station_name])
|
SweetLogger.debug("Buy {0}", [station_name])
|
||||||
_buy_station()
|
_buy_station()
|
||||||
|
|
||||||
|
|
||||||
func _buy_station() -> void:
|
func _buy_station() -> void:
|
||||||
SweetLogger.debug("cost={0} current money={1}", [cost, GameManager.money])
|
SweetLogger.debug("Cost={0} current money={1}", [cost, GameManager.money])
|
||||||
GameManager.set_money(GameManager.money - cost)
|
GameManager.set_money(GameManager.money - cost)
|
||||||
var transform = Helper.get_snapped_transform(XRHelpers.get_xr_origin(self).get_node_or_null("PlayerBody"))
|
var transform = Helper.get_snapped_transform(XRHelpers.get_xr_origin(self).get_node_or_null("PlayerBody"))
|
||||||
var forward: Vector3 = -transform.basis.z.normalized()
|
var forward: Vector3 = -transform.basis.z.normalized()
|
||||||
|
|||||||
+8
-8
@@ -22,7 +22,7 @@ func _ready() -> void:
|
|||||||
Signals.station_bought.connect(_on_station_bought)
|
Signals.station_bought.connect(_on_station_bought)
|
||||||
viewport = get_parent().get_parent() as XRToolsViewport2DIn3D
|
viewport = get_parent().get_parent() as XRToolsViewport2DIn3D
|
||||||
if not viewport:
|
if not viewport:
|
||||||
push_error("Shop UI could not find XRToolsViewport2DIn3D grand parent")
|
SweetLogger.error("{0} could not find XRToolsViewport2DIn3D grandparent", [name])
|
||||||
enabled = false
|
enabled = false
|
||||||
|
|
||||||
|
|
||||||
@@ -32,9 +32,9 @@ func _process(_delta: float) -> void:
|
|||||||
|
|
||||||
func toggle_shop():
|
func toggle_shop():
|
||||||
if GameManager.game_state == GameManager.GameState.BUILDING:
|
if GameManager.game_state == GameManager.GameState.BUILDING:
|
||||||
SweetLogger.debug("toggle shop")
|
SweetLogger.debug("Toggle shop")
|
||||||
enabled = !enabled
|
enabled = !enabled
|
||||||
SweetLogger.debug("_process: money={0} label text={1}", [GameManager.money, money_label.text])
|
SweetLogger.debug("Money={0} label text={1}", [GameManager.money, money_label.text])
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -54,11 +54,11 @@ func _set_poke_enabled_for_controller(controller_node: XRController3D, value: bo
|
|||||||
|
|
||||||
var poke_node = Helper.find_first_child_of_type(controller_node, XRToolsPoke)
|
var poke_node = Helper.find_first_child_of_type(controller_node, XRToolsPoke)
|
||||||
if poke_node:
|
if poke_node:
|
||||||
SweetLogger.debug("_set_poke_enabled_for_controller: {0} poke enabled: {1}", [poke_node.name, value])
|
SweetLogger.debug("Poke enabled: {0} on {1}", [value, poke_node.name])
|
||||||
poke_node.enabled = value
|
poke_node.enabled = value
|
||||||
poke_node.visible = value
|
poke_node.visible = value
|
||||||
else:
|
else:
|
||||||
SweetLogger.debug("_set_poke_enabled_for_controller: {0} poke not found", [controller_node.name])
|
SweetLogger.debug("Poke not found on {0}", [controller_node.name])
|
||||||
|
|
||||||
# For some reason, this is called every frame the button is down. So we need our own timer.
|
# For some reason, this is called every frame the button is down. So we need our own timer.
|
||||||
func _on_controller_button_pressed(button_name: String) -> void:
|
func _on_controller_button_pressed(button_name: String) -> void:
|
||||||
@@ -80,13 +80,13 @@ func _on_other_controller_button_pressed(button_name: String) -> void:
|
|||||||
func _on_station_bought(_instance) -> void:
|
func _on_station_bought(_instance) -> void:
|
||||||
enabled = false
|
enabled = false
|
||||||
money_label.text = str(GameManager.money) + "$"
|
money_label.text = str(GameManager.money) + "$"
|
||||||
SweetLogger.debug("_on_station_bought: new money: {0}", [GameManager.money])
|
SweetLogger.debug("New money: {0}", [GameManager.money])
|
||||||
|
|
||||||
|
|
||||||
func detect_hand_from_xr_ancestor() -> void:
|
func detect_hand_from_xr_ancestor() -> void:
|
||||||
controller = XRHelpers.get_xr_controller(self)
|
controller = XRHelpers.get_xr_controller(self)
|
||||||
if not controller:
|
if not controller:
|
||||||
push_error("Shop UI could not find XRController3D ancestor")
|
SweetLogger.error("{0} could not find XRController3D ancestor", [name])
|
||||||
return
|
return
|
||||||
|
|
||||||
var left_controller := XRHelpers.get_left_controller(self)
|
var left_controller := XRHelpers.get_left_controller(self)
|
||||||
@@ -96,4 +96,4 @@ func detect_hand_from_xr_ancestor() -> void:
|
|||||||
other_controller = right_controller
|
other_controller = right_controller
|
||||||
elif controller == right_controller:
|
elif controller == right_controller:
|
||||||
other_controller = left_controller
|
other_controller = left_controller
|
||||||
SweetLogger.debug("detected hand: {0}", [controller.get_tracker_hand()])
|
SweetLogger.debug("Detected hand: {0}", [controller.get_tracker_hand()])
|
||||||
|
|||||||
@@ -0,0 +1,71 @@
|
|||||||
|
[gd_scene format=3 uid="uid://d8jo0402pgl6"]
|
||||||
|
|
||||||
|
[ext_resource type="PackedScene" uid="uid://c8l60rnugru40" path="res://addons/godot-xr-tools/objects/pickable.tscn" id="1_cvkx3"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://c25yxb0vt53vc" path="res://addons/godot-xr-tools/objects/grab_points/grab_point_hand_left.tscn" id="3_q03o5"]
|
||||||
|
[ext_resource type="Animation" uid="uid://db62hs5s4n2b3" path="res://addons/godot-xr-tools/hands/animations/left/Grip 4.res" id="4_6r7kg"]
|
||||||
|
[ext_resource type="Script" uid="uid://dvobm6vcfnqe8" path="res://addons/godot-xr-tools/hands/poses/hand_pose_settings.gd" id="5_l1fi6"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://ctw7nbntd5pcj" path="res://addons/godot-xr-tools/objects/grab_points/grab_point_hand_right.tscn" id="6_iejgm"]
|
||||||
|
[ext_resource type="Animation" uid="uid://d1xnpyc08njjx" path="res://addons/godot-xr-tools/hands/animations/right/Grip 4.res" id="7_hei0k"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://bfj80jh13t6e5" path="res://prefabs/food_item.tscn" id="8_tkk28"]
|
||||||
|
[ext_resource type="Script" uid="uid://bwd0pe2udb5xo" path="res://Net/net_pickable.gd" id="9_8m8gg"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://b5ukku8i0hilb" path="res://prefabs/despawning_item.tscn" id="10_vkoit"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://3lr2dhy62rhk" path="res://prefabs/combinable_item.tscn" id="11_combinable"]
|
||||||
|
|
||||||
|
[sub_resource type="CylinderShape3D" id="CylinderShape3D_fco8w"]
|
||||||
|
height = 0.054896355
|
||||||
|
radius = 0.05517578
|
||||||
|
|
||||||
|
[sub_resource type="Resource" id="Resource_lc22d"]
|
||||||
|
script = ExtResource("5_l1fi6")
|
||||||
|
closed_pose = ExtResource("4_6r7kg")
|
||||||
|
metadata/_custom_type_script = "uid://dvobm6vcfnqe8"
|
||||||
|
|
||||||
|
[sub_resource type="Resource" id="Resource_qyiot"]
|
||||||
|
script = ExtResource("5_l1fi6")
|
||||||
|
closed_pose = ExtResource("7_hei0k")
|
||||||
|
metadata/_custom_type_script = "uid://dvobm6vcfnqe8"
|
||||||
|
|
||||||
|
[sub_resource type="SceneReplicationConfig" id="SceneReplicationConfig_np_burger"]
|
||||||
|
properties/0/path = NodePath(".:position")
|
||||||
|
properties/0/spawn = false
|
||||||
|
properties/0/replication_mode = 1
|
||||||
|
properties/1/path = NodePath(".:quaternion")
|
||||||
|
properties/1/spawn = false
|
||||||
|
properties/1/replication_mode = 1
|
||||||
|
properties/2/path = NodePath("NetPickable:net_held_by")
|
||||||
|
properties/2/spawn = true
|
||||||
|
properties/2/replication_mode = 1
|
||||||
|
properties/3/path = NodePath(".:enabled")
|
||||||
|
properties/3/spawn = false
|
||||||
|
properties/3/replication_mode = 1
|
||||||
|
|
||||||
|
[node name="FoodItem" unique_id=1675596942 instance=ExtResource("1_cvkx3")]
|
||||||
|
second_hand_grab = 1
|
||||||
|
|
||||||
|
[node name="CollisionShape3D" parent="." index="0"]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.028505921, 0)
|
||||||
|
shape = SubResource("CylinderShape3D_fco8w")
|
||||||
|
|
||||||
|
[node name="GrabPointHandLeft" parent="." index="1" unique_id=1571481674 instance=ExtResource("3_q03o5")]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.067650706, 0.04601878, -0.08606844)
|
||||||
|
hand_pose = SubResource("Resource_lc22d")
|
||||||
|
|
||||||
|
[node name="GrabPointHandRight" parent="." index="2" unique_id=514404634 instance=ExtResource("6_iejgm")]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.06531982, 0.042291984, -0.08604182)
|
||||||
|
hand_pose = SubResource("Resource_qyiot")
|
||||||
|
|
||||||
|
[node name="NetPickable" type="MultiplayerSynchronizer" parent="." index="3" unique_id=1382968688]
|
||||||
|
replication_config = SubResource("SceneReplicationConfig_np_burger")
|
||||||
|
script = ExtResource("9_8m8gg")
|
||||||
|
|
||||||
|
[node name="FoodItem" parent="." index="4" unique_id=63948206 instance=ExtResource("8_tkk28")]
|
||||||
|
id = "item_id"
|
||||||
|
sell_value = 0
|
||||||
|
|
||||||
|
[node name="DespawningItem" parent="." index="5" unique_id=303090111 instance=ExtResource("10_vkoit")]
|
||||||
|
|
||||||
|
[node name="CombinableItem" parent="." index="6" unique_id=996936271 instance=ExtResource("11_combinable")]
|
||||||
|
|
||||||
|
[node name="SoundManager" type="Node3D" parent="." index="7" unique_id=118155212]
|
||||||
|
|
||||||
|
[node name="Model" type="Node3D" parent="." index="8" unique_id=1015960306]
|
||||||
@@ -0,0 +1,124 @@
|
|||||||
|
class_name SharedInventoryStation
|
||||||
|
extends Station
|
||||||
|
|
||||||
|
### Abstract 'class', should never be instantiated ###
|
||||||
|
# Backbone for stations that need to know about neighboring stations of the
|
||||||
|
# same kind (tables, belts).
|
||||||
|
|
||||||
|
## Path to one Area3D probe per direction this station should watch for a
|
||||||
|
## same-kind neighbor. Wired explicitly per concrete scene (e.g. a belt
|
||||||
|
## wires one path, a table wires four).
|
||||||
|
@export var probe_paths: Array[NodePath] = []
|
||||||
|
|
||||||
|
## Resolved from probe_paths in ready().
|
||||||
|
var probes: Array[Area3D] = []
|
||||||
|
|
||||||
|
## Area3D probe -> the SharedInventoryStation neighbor detected through it
|
||||||
|
## (or null if that direction is currently unoccupied).
|
||||||
|
var neighbors: Dictionary = {}
|
||||||
|
|
||||||
|
|
||||||
|
# The child station has to call super._enter_tree() for this to be called
|
||||||
|
func _enter_tree() -> void:
|
||||||
|
super._enter_tree()
|
||||||
|
var properties: Array[NodePath] = [".:position", ".:rotation", ".:visible"]
|
||||||
|
for property_path in properties:
|
||||||
|
sync_config.add_property(property_path)
|
||||||
|
sync_config.property_set_spawn(property_path, false)
|
||||||
|
sync_config.property_set_replication_mode(property_path, SceneReplicationConfig.REPLICATION_MODE_ON_CHANGE)
|
||||||
|
|
||||||
|
|
||||||
|
# The child station has to call super.ready() for this to be called
|
||||||
|
func ready() -> void:
|
||||||
|
super.ready()
|
||||||
|
# Find probes
|
||||||
|
for path in probe_paths:
|
||||||
|
var probe := get_node_or_null(path) as Area3D
|
||||||
|
if probe:
|
||||||
|
probes.append(probe)
|
||||||
|
else:
|
||||||
|
SweetLogger.warning("{0} could not resolve neighbor probe at path {1}", [name, path])
|
||||||
|
if probes.is_empty():
|
||||||
|
SweetLogger.warning("{0} has no neighbor probes wired", [name])
|
||||||
|
for probe in probes:
|
||||||
|
neighbors[probe] = null
|
||||||
|
probe.body_entered.connect(_on_probe_body_entered.bind(probe))
|
||||||
|
probe.body_exited.connect(_on_probe_body_exited.bind(probe))
|
||||||
|
# Init leader state before any probe signal has a chance to fire
|
||||||
|
_broadcast_group_changed.call_deferred()
|
||||||
|
|
||||||
|
|
||||||
|
## Cycle-safe search of the neighbor graph (handles circular belt/table loops)
|
||||||
|
func get_connected_group() -> Array[SharedInventoryStation]:
|
||||||
|
var visited: Dictionary = {get_instance_id(): true}
|
||||||
|
var queue: Array[SharedInventoryStation] = [self]
|
||||||
|
var group: Array[SharedInventoryStation] = []
|
||||||
|
while not queue.is_empty():
|
||||||
|
var current: SharedInventoryStation = queue.pop_front()
|
||||||
|
group.append(current)
|
||||||
|
for neighbor in current.neighbors.values():
|
||||||
|
if neighbor and not visited.has(neighbor.get_instance_id()):
|
||||||
|
visited[neighbor.get_instance_id()] = true
|
||||||
|
queue.append(neighbor)
|
||||||
|
return group
|
||||||
|
|
||||||
|
|
||||||
|
## Deterministic leader: smallest grid position, computed the same on every peer
|
||||||
|
func is_group_leader() -> bool:
|
||||||
|
var leader: SharedInventoryStation = self
|
||||||
|
for member in get_connected_group():
|
||||||
|
if _grid_sort_key(member) < _grid_sort_key(leader):
|
||||||
|
leader = member
|
||||||
|
return leader == self
|
||||||
|
|
||||||
|
|
||||||
|
static func _grid_sort_key(station: SharedInventoryStation) -> Vector2i:
|
||||||
|
var pos := station.global_position
|
||||||
|
return Vector2i(roundi(pos.x / Helper.SNAP_GRID_SIZE), roundi(pos.z / Helper.SNAP_GRID_SIZE))
|
||||||
|
|
||||||
|
|
||||||
|
## Food items this station holds, exposed for neighbors to read; override for multi-zone stations
|
||||||
|
func get_exposed_food_items() -> Array[FoodItem]:
|
||||||
|
var items: Array[FoodItem] = []
|
||||||
|
if snap_zone and snap_zone.picked_up_object:
|
||||||
|
var food_item := Helper.find_food_item(snap_zone.picked_up_object)
|
||||||
|
if food_item:
|
||||||
|
items.append(food_item)
|
||||||
|
return items
|
||||||
|
|
||||||
|
|
||||||
|
## Every food item held anywhere in this station's connected group
|
||||||
|
func get_group_food_items() -> Array[FoodItem]:
|
||||||
|
var items: Array[FoodItem] = []
|
||||||
|
for member in get_connected_group():
|
||||||
|
items.append_array(member.get_exposed_food_items())
|
||||||
|
return items
|
||||||
|
|
||||||
|
|
||||||
|
func _on_probe_body_entered(body: Node3D, probe: Area3D) -> void:
|
||||||
|
var station := body as SharedInventoryStation
|
||||||
|
if not station or station == self:
|
||||||
|
return
|
||||||
|
neighbors[probe] = station
|
||||||
|
_broadcast_group_changed()
|
||||||
|
|
||||||
|
|
||||||
|
func _on_probe_body_exited(body: Node3D, probe: Area3D) -> void:
|
||||||
|
var former: SharedInventoryStation = neighbors.get(probe)
|
||||||
|
if not former or body != former:
|
||||||
|
return
|
||||||
|
neighbors[probe] = null
|
||||||
|
# former is no longer reachable from self, so it needs telling separately
|
||||||
|
former._broadcast_group_changed()
|
||||||
|
_broadcast_group_changed()
|
||||||
|
|
||||||
|
|
||||||
|
## Notifies every member of this station's current connected group (not just the two that changed)
|
||||||
|
func _broadcast_group_changed() -> void:
|
||||||
|
for member in get_connected_group():
|
||||||
|
member._on_group_changed()
|
||||||
|
|
||||||
|
|
||||||
|
## Virtual hook: override to react to this station's group membership/leadership changing
|
||||||
|
func _on_group_changed() -> void:
|
||||||
|
pass
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
uid://bciln4f4tjwgy
|
||||||
@@ -0,0 +1,127 @@
|
|||||||
|
class_name Station
|
||||||
|
extends Node3D
|
||||||
|
|
||||||
|
### Abstract 'class', should never be instantiated ###
|
||||||
|
# - Keep all logic all stations share.
|
||||||
|
# - Contain as much of the networking code syncing stations as possible.
|
||||||
|
|
||||||
|
## Sounds
|
||||||
|
@export var pickup_sound: AudioStream
|
||||||
|
@export var drop_sound: AudioStream
|
||||||
|
|
||||||
|
## Node references. These are all required snd should be set in the inspector
|
||||||
|
@export var notification_audio: AudioStreamPlayer3D # Short sounds like pickup or complete
|
||||||
|
@export var ambient_audio: AudioStreamPlayer3D # Releating sounds like a cooking noise
|
||||||
|
@export var snap_zone: XRToolsSnapZone
|
||||||
|
@export var synchronizer: MultiplayerSynchronizer
|
||||||
|
|
||||||
|
var sync_config: SceneReplicationConfig
|
||||||
|
|
||||||
|
var enabled: bool: # When disabled the station only updated display and sounds.
|
||||||
|
get: return snap_zone.enabled
|
||||||
|
set(p_enabled):
|
||||||
|
SweetLogger.info("Set enabled {0} on station {1} on client {2}", [p_enabled, name, multiplayer.get_unique_id()])
|
||||||
|
snap_zone.enabled = p_enabled
|
||||||
|
snap_zone.set_process(p_enabled)
|
||||||
|
|
||||||
|
|
||||||
|
# Godot requires replication_config to be fully built before _ready. So in _enter_tree
|
||||||
|
# The child station has to call super._enter_tree() for this to be called.
|
||||||
|
func _enter_tree() -> void:
|
||||||
|
# Always a fresh config - abstract/station.tscn's config sub-resource is shared
|
||||||
|
# in memory across every station scene that instances it, so reusing it here
|
||||||
|
# would pile every station type's properties onto the same shared object.
|
||||||
|
synchronizer.root_path = get_path()
|
||||||
|
synchronizer.replication_config = SceneReplicationConfig.new()
|
||||||
|
sync_config = synchronizer.replication_config
|
||||||
|
|
||||||
|
|
||||||
|
# The child station has to call super.ready() for this to be called
|
||||||
|
func ready() -> void:
|
||||||
|
SweetLogger.debug("Station {0} ready", [name])
|
||||||
|
if not notification_audio:
|
||||||
|
SweetLogger.warning("{0} missing notification_audio reference", [name])
|
||||||
|
if not ambient_audio:
|
||||||
|
SweetLogger.warning("{0} missing ambient_audio reference", [name])
|
||||||
|
if not snap_zone:
|
||||||
|
SweetLogger.warning("{0} missing snap_zone reference", [name])
|
||||||
|
if not synchronizer:
|
||||||
|
SweetLogger.warning("{0} missing synchronizer reference", [name])
|
||||||
|
# Disable if we're not the server.
|
||||||
|
if not NetworkManager.owns_world():
|
||||||
|
enabled = false
|
||||||
|
|
||||||
|
snap_zone.has_picked_up.connect(_on_object_picked_up_handler)
|
||||||
|
snap_zone.has_dropped.connect(_on_object_dropped_handler)
|
||||||
|
|
||||||
|
# The child station has to call super.process(delta) for this to be called
|
||||||
|
func process(_delta: float) -> void:
|
||||||
|
refresh_display()
|
||||||
|
|
||||||
|
|
||||||
|
## Signal handles ##
|
||||||
|
func _on_object_picked_up_handler(item: Node3D) -> void:
|
||||||
|
if not NetworkManager.owns_world():
|
||||||
|
return
|
||||||
|
_clients_on_object_picked_up_handler.rpc(item.get_path())
|
||||||
|
_apply_object_picked_up(item)
|
||||||
|
|
||||||
|
|
||||||
|
func _on_object_dropped_handler(item: Node3D) -> void:
|
||||||
|
if not NetworkManager.owns_world():
|
||||||
|
return
|
||||||
|
_clients_on_object_dropped_handler.rpc(item.get_path())
|
||||||
|
_apply_object_dropped(item)
|
||||||
|
|
||||||
|
|
||||||
|
func _apply_object_picked_up(item: Node3D) -> void:
|
||||||
|
SweetLogger.debug("Pickup: {0}", [item.name])
|
||||||
|
Helper.play_sound(notification_audio, pickup_sound)
|
||||||
|
on_object_picked_up(item)
|
||||||
|
var food_item = Helper.find_food_item(item)
|
||||||
|
if food_item:
|
||||||
|
on_food_item_picked_up(food_item)
|
||||||
|
|
||||||
|
|
||||||
|
func _apply_object_dropped(item: Node3D) -> void:
|
||||||
|
Helper.play_sound(notification_audio, drop_sound, 0.8)
|
||||||
|
SweetLogger.debug("Drop: {0}", [item.name])
|
||||||
|
on_object_dropped(item)
|
||||||
|
var food_item = Helper.find_food_item(item)
|
||||||
|
if food_item:
|
||||||
|
on_food_item_dropped(food_item)
|
||||||
|
|
||||||
|
|
||||||
|
# Propagate events to clients
|
||||||
|
@rpc("authority", "call_remote", "reliable")
|
||||||
|
func _clients_on_object_picked_up_handler(item_path: NodePath):
|
||||||
|
var item := Helper.get_node_from_path(self, item_path) as Node3D
|
||||||
|
if not item:
|
||||||
|
return
|
||||||
|
_apply_object_picked_up(item)
|
||||||
|
|
||||||
|
@rpc("authority", "call_remote", "reliable")
|
||||||
|
func _clients_on_object_dropped_handler(item_path: NodePath):
|
||||||
|
var item := Helper.get_node_from_path(self, item_path) as Node3D
|
||||||
|
if not item:
|
||||||
|
return
|
||||||
|
_apply_object_dropped(item)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## Virutal methods
|
||||||
|
# The child station implements these if it cares about them.
|
||||||
|
func on_object_picked_up(_item: Node3D) -> void:
|
||||||
|
pass
|
||||||
|
|
||||||
|
func on_object_dropped(_item: Node3D) -> void:
|
||||||
|
pass
|
||||||
|
|
||||||
|
func on_food_item_picked_up(_food_item: FoodItem) -> void:
|
||||||
|
pass
|
||||||
|
|
||||||
|
func on_food_item_dropped(_food_item: FoodItem) -> void:
|
||||||
|
pass
|
||||||
|
|
||||||
|
func refresh_display() -> void:
|
||||||
|
pass
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
uid://1ii5ov17p2p6
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
[gd_scene format=3 uid="uid://cbs8jiqe8rcmn"]
|
||||||
|
|
||||||
|
[ext_resource type="PackedScene" uid="uid://cvucwxibtol5f" path="res://stations/StationMovement.tscn" id="1_yuo1j"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://bxbocxdaayvwx" path="res://UI/progress_bar.tscn" id="2_be8yi"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://ce7vysyvondf8" path="res://addons/godot-xr-tools/objects/snap_zone.tscn" id="3_be8yi"]
|
||||||
|
|
||||||
|
[sub_resource type="SceneReplicationConfig" id="SceneReplicationConfig_0o2ds"]
|
||||||
|
|
||||||
|
[node name="Station" type="Node3D" unique_id=707500902]
|
||||||
|
|
||||||
|
[node name="StationMovement" parent="." unique_id=946873975 instance=ExtResource("1_yuo1j")]
|
||||||
|
|
||||||
|
[node name="MultiplayerSynchronizer" type="MultiplayerSynchronizer" parent="." unique_id=1536666704]
|
||||||
|
replication_config = SubResource("SceneReplicationConfig_0o2ds")
|
||||||
|
|
||||||
|
[node name="AudioStreamPlayer3DNotification" type="AudioStreamPlayer3D" parent="." unique_id=1976975302]
|
||||||
|
|
||||||
|
[node name="AudioStreamPlayer3DAmbient" type="AudioStreamPlayer3D" parent="." unique_id=925832848]
|
||||||
|
|
||||||
|
[node name="ProgressBar3D" parent="." unique_id=654673176 instance=ExtResource("2_be8yi")]
|
||||||
|
|
||||||
|
[node name="SnapZone" parent="." unique_id=1315859105 groups=["station_zone"] instance=ExtResource("3_be8yi")]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0)
|
||||||
@@ -0,0 +1,123 @@
|
|||||||
|
class_name WorkStation
|
||||||
|
extends Station
|
||||||
|
|
||||||
|
### Abstract 'class', should never be instantiated ###
|
||||||
|
# This script serves two main jobs:
|
||||||
|
# - Keep all logic all workstations (sink, hob...) share.
|
||||||
|
# - Contain as much of the networking code syncing stations as possible.
|
||||||
|
|
||||||
|
## Sounds
|
||||||
|
@export var process_sound: AudioStream
|
||||||
|
@export var complete_sound: AudioStream
|
||||||
|
|
||||||
|
## Node references. These are all required snd should be set in the inspector
|
||||||
|
@export var progress_bar: ProgressBar3D
|
||||||
|
|
||||||
|
|
||||||
|
## Synced by MultiplayerSyncronizer ##
|
||||||
|
var current_work: float # How far a FoodItem conversion is toward completion
|
||||||
|
var max_work: float # How much work has to be acheived to trigger conversion
|
||||||
|
var result_id: String # Station active if not empty. What FoodItem id the conversion turns the current FoodItem into.
|
||||||
|
|
||||||
|
# The child station has to call super._enter_tree() for this to be called
|
||||||
|
func _enter_tree() -> void:
|
||||||
|
super._enter_tree()
|
||||||
|
var properties: Array[NodePath] = [".:current_work", ".:max_work", ".:result_id"]
|
||||||
|
for property_path in properties:
|
||||||
|
sync_config.add_property(property_path)
|
||||||
|
sync_config.property_set_spawn(property_path, false)
|
||||||
|
sync_config.property_set_replication_mode(property_path, SceneReplicationConfig.REPLICATION_MODE_ON_CHANGE)
|
||||||
|
|
||||||
|
|
||||||
|
# The child station has to call super.ready() for this to be called
|
||||||
|
func ready() -> void:
|
||||||
|
super.ready()
|
||||||
|
if not progress_bar:
|
||||||
|
SweetLogger.warning("{0} missing progress_bar reference", [name])
|
||||||
|
|
||||||
|
|
||||||
|
# The child station has to call super.process(delta) for this to be called
|
||||||
|
func process(delta: float) -> void:
|
||||||
|
super.process(delta)
|
||||||
|
#SweetLogger.debug("station process result_id: {0}, work: {1}, max_work: {2}", [result_id, current_work, max_work])
|
||||||
|
refresh_display()
|
||||||
|
|
||||||
|
|
||||||
|
# Propagate events to clients
|
||||||
|
@rpc("authority", "call_local", "reliable")
|
||||||
|
func _everyone_on_work_complete():
|
||||||
|
on_work_complete()
|
||||||
|
|
||||||
|
|
||||||
|
## Virutal methods ##
|
||||||
|
# The child station implements these if it cares about them.
|
||||||
|
func on_work_complete() -> void:
|
||||||
|
SweetLogger.debug("Not implemented in {0}", [name])
|
||||||
|
|
||||||
|
|
||||||
|
# The child station has to call super.refresh_display for this to be called
|
||||||
|
func refresh_display() -> void:
|
||||||
|
super.refresh_display()
|
||||||
|
var is_active: bool = not result_id.is_empty()
|
||||||
|
progress_bar.set_bar_visible(is_active)
|
||||||
|
progress_bar.set_progress((current_work / max_work) if is_active else 0.0)
|
||||||
|
|
||||||
|
|
||||||
|
## Public methods ##
|
||||||
|
# Will be called by clients to the server, and server to server
|
||||||
|
func add_work(work: float) -> void:
|
||||||
|
SweetLogger.debug("Add work: {0} current: {1} max_work: {2}", [snappedf(work, 0.01), snappedf(current_work, 0.01), snappedf(max_work, 0.01)])
|
||||||
|
if work <= 0:
|
||||||
|
SweetLogger.warning("Work to add must be positive, work: {0}", [work])
|
||||||
|
return
|
||||||
|
if not NetworkManager.owns_world():
|
||||||
|
server_add_work.rpc_id(1, work)
|
||||||
|
return
|
||||||
|
if not result_id or result_id.is_empty():
|
||||||
|
SweetLogger.warning("Work can not be added when result_id is empty")
|
||||||
|
return
|
||||||
|
current_work += work
|
||||||
|
if current_work >= max_work:
|
||||||
|
_everyone_on_work_complete.rpc()
|
||||||
|
|
||||||
|
|
||||||
|
@rpc("any_peer", "call_remote", "reliable")
|
||||||
|
func server_add_work(work: float) -> void:
|
||||||
|
add_work(work)
|
||||||
|
|
||||||
|
|
||||||
|
# Converts the currenly held item into result_id, by despawning it and instantiating a new item
|
||||||
|
func convert_item() -> Node3D:
|
||||||
|
if not NetworkManager.owns_world():
|
||||||
|
return
|
||||||
|
SweetLogger.info("Convert item, result_id: {0}", [result_id])
|
||||||
|
if not NetworkManager.owns_world:
|
||||||
|
SweetLogger.warning("Only the server should ever call this!")
|
||||||
|
return null
|
||||||
|
if not result_id or result_id.is_empty():
|
||||||
|
SweetLogger.warning("Station tried to convert item, but result_id is null or empty!")
|
||||||
|
return
|
||||||
|
var old_pickable = snap_zone.picked_up_object
|
||||||
|
if not old_pickable:
|
||||||
|
SweetLogger.warning("Station tried to convert item, but item is missing!")
|
||||||
|
return null
|
||||||
|
var target_id := result_id
|
||||||
|
var original_transform = old_pickable.global_transform
|
||||||
|
var new_scene_instance = NetworkManager.spawn_item(RecipeManager.get_item_scene(target_id).resource_path, original_transform)
|
||||||
|
|
||||||
|
reset()
|
||||||
|
|
||||||
|
# Drop and free the old item and pick up the new one
|
||||||
|
SweetLogger.debug("Freeing old_pickable {0}", [old_pickable])
|
||||||
|
snap_zone.drop_object()
|
||||||
|
NetworkManager.despawn_item(old_pickable)
|
||||||
|
snap_zone.pick_up_object(new_scene_instance)
|
||||||
|
SweetLogger.info("Convert item into id: {0}, node name: {1}", [target_id, new_scene_instance.name])
|
||||||
|
return new_scene_instance
|
||||||
|
|
||||||
|
|
||||||
|
func reset() -> void:
|
||||||
|
SweetLogger.debug("->[]")
|
||||||
|
current_work = 0
|
||||||
|
max_work = 0
|
||||||
|
result_id = ""
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
uid://b25s3bhslrlxc
|
||||||
@@ -98,15 +98,15 @@ const TIMESTAMP_BG_COLOR = "#1e3a5f"
|
|||||||
#===================================================================================#
|
#===================================================================================#
|
||||||
## Column widths for alignment (in characters)
|
## Column widths for alignment (in characters)
|
||||||
const PEER_ID_COLUMN_WIDTH = 6
|
const PEER_ID_COLUMN_WIDTH = 6
|
||||||
const LOG_TYPE_COLUMN_WIDTH = 13
|
const LOG_TYPE_COLUMN_WIDTH = 10
|
||||||
## Default mm:ss:ms; with SHOW_TIMESTAMP_HOURS, hh:mm:ss:ms
|
## Default mm:ss:ms; with SHOW_TIMESTAMP_HOURS, hh:mm:ss:ms
|
||||||
const TIMESTAMP_COLUMN_WIDTH_MMSSMS = 9
|
const TIMESTAMP_COLUMN_WIDTH_MMSSMS = 9
|
||||||
const TIMESTAMP_COLUMN_WIDTH_HHMMSSMS = 12
|
const TIMESTAMP_COLUMN_WIDTH_HHMMSSMS = 12
|
||||||
const SCRIPT_FUNCTION_COLUMN_WIDTH = 50
|
const SCRIPT_FUNCTION_COLUMN_WIDTH = 46
|
||||||
|
|
||||||
const TRUNCATE_PEER_NAME = 6
|
const TRUNCATE_PEER_NAME = 6
|
||||||
const TRUNCATE_SCRIPT_NAME = 20
|
const TRUNCATE_SCRIPT_NAME = 20
|
||||||
const TRUNCATE_FUNCTION_NAME = 30
|
const TRUNCATE_FUNCTION_NAME = 26
|
||||||
#===================================================================================#
|
#===================================================================================#
|
||||||
|
|
||||||
# CONFIGURATION
|
# CONFIGURATION
|
||||||
@@ -229,7 +229,7 @@ func _print_rich_log(peer_id_str: String, log_type: String, message: String, scr
|
|||||||
var peer_padded = _truncate_text(_pad_text(peer_label, PEER_ID_COLUMN_WIDTH), TRUNCATE_PEER_NAME)
|
var peer_padded = _truncate_text(_pad_text(peer_label, PEER_ID_COLUMN_WIDTH), TRUNCATE_PEER_NAME)
|
||||||
|
|
||||||
# Format peer ID with its background color
|
# Format peer ID with its background color
|
||||||
var peer_formatted = _format_rich_text(peer_padded, peer_color.bg_color, peer_color.text_color)
|
var peer_formatted = _format_rich_text(" " + peer_padded, peer_color.bg_color, peer_color.text_color)
|
||||||
|
|
||||||
# Format log type with its background color
|
# Format log type with its background color
|
||||||
var log_type_padded = _pad_text(log_type_label, LOG_TYPE_COLUMN_WIDTH)
|
var log_type_padded = _pad_text(log_type_label, LOG_TYPE_COLUMN_WIDTH)
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
[gd_scene format=3 uid="uid://bu6jt26pq2y0k"]
|
[gd_scene format=3 uid="uid://bu6jt26pq2y0k"]
|
||||||
|
|
||||||
[ext_resource type="PackedScene" uid="uid://q37nqadkibbp" path="res://environment/door.tscn" id="1_hgrxd"]
|
[ext_resource type="PackedScene" uid="uid://q37nqadkibbp" path="res://environment/door.tscn" id="1_hgrxd"]
|
||||||
[ext_resource type="PackedScene" uid="uid://j7caslh27nor" path="res://stations/Hob.tscn" id="1_p8umn"]
|
[ext_resource type="PackedScene" uid="uid://j7caslh27nor" path="res://stations/Hob_old.tscn" id="1_p8umn"]
|
||||||
[ext_resource type="PackedScene" uid="uid://caf0xanmxbshy" path="res://stations/table.tscn" id="2_d63j6"]
|
[ext_resource type="PackedScene" uid="uid://caf0xanmxbshy" path="res://stations/table.tscn" id="2_d63j6"]
|
||||||
[ext_resource type="PackedScene" uid="uid://dlw5geheupgpt" path="res://stations/hatch.tscn" id="3_d63j6"]
|
[ext_resource type="PackedScene" uid="uid://dlw5geheupgpt" path="res://stations/hatch.tscn" id="3_d63j6"]
|
||||||
[ext_resource type="PackedScene" uid="uid://da6yrsnxvsrif" path="res://environment/wall.tscn" id="4_41vpv"]
|
[ext_resource type="PackedScene" uid="uid://da6yrsnxvsrif" path="res://environment/wall.tscn" id="4_41vpv"]
|
||||||
|
|||||||
@@ -1,17 +1,17 @@
|
|||||||
[gd_scene format=3 uid="uid://damrxtlt7uswf"]
|
[gd_scene format=3 uid="uid://damrxtlt7uswf"]
|
||||||
|
|
||||||
[ext_resource type="PackedScene" uid="uid://j7caslh27nor" path="res://stations/Hob.tscn" id="1_1wuvq"]
|
[ext_resource type="PackedScene" uid="uid://b052o1fgwq5bw" path="res://stations/Hob.tscn" id="1_1wuvq"]
|
||||||
[ext_resource type="PackedScene" uid="uid://efaec6ymgabo" path="res://stations/Counter.tscn" id="2_3qwcq"]
|
[ext_resource type="PackedScene" uid="uid://efaec6ymgabo" path="res://stations/Counter.tscn" id="2_3qwcq"]
|
||||||
[ext_resource type="PackedScene" uid="uid://dvrk268s7gkxh" path="res://stations/sink.tscn" id="3_3qwcq"]
|
[ext_resource type="PackedScene" uid="uid://dvrk268s7gkxh" path="res://stations/sink.tscn" id="3_3qwcq"]
|
||||||
[ext_resource type="PackedScene" uid="uid://c6rift56ql3f8" path="res://stations/BurgerBunsDispenser.tscn" id="4_5eled"]
|
[ext_resource type="PackedScene" uid="uid://c6rift56ql3f8" path="res://stations/BurgerBunsDispenser.tscn" id="4_5eled"]
|
||||||
[ext_resource type="PackedScene" uid="uid://cwnwo4i28upap" path="res://stations/raw_burger_dispenser.tscn" id="5_0342k"]
|
[ext_resource type="PackedScene" uid="uid://cwnwo4i28upap" path="res://stations/raw_burger_dispenser.tscn" id="5_0342k"]
|
||||||
[ext_resource type="PackedScene" uid="uid://ck5tuftqmyiue" path="res://stations/plate_dispenser.tscn" id="6_b5gb1"]
|
[ext_resource type="PackedScene" uid="uid://ck5tuftqmyiue" path="res://stations/plate_dispenser.tscn" id="6_b5gb1"]
|
||||||
[ext_resource type="PackedScene" uid="uid://caf0xanmxbshy" path="res://stations/table.tscn" id="7_0342k"]
|
[ext_resource type="PackedScene" uid="uid://caf0xanmxbshy" path="res://stations/table.tscn" id="7_0342k"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://cnjwtnhwh0i8q" path="res://stations/dirt_station.tscn" id="8_b5gb1"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://sc6i0i1f0o48" path="res://stations/potato_dispenser.tscn" id="9_ok0xr"]
|
||||||
|
|
||||||
[node name="SmallLine" type="Node3D" unique_id=1844128818]
|
[node name="SmallLine" type="Node3D" unique_id=1844128818]
|
||||||
|
|
||||||
[node name="Hob" parent="." unique_id=1687971542 instance=ExtResource("1_1wuvq")]
|
|
||||||
|
|
||||||
[node name="Counter" parent="." unique_id=1487893288 instance=ExtResource("2_3qwcq")]
|
[node name="Counter" parent="." unique_id=1487893288 instance=ExtResource("2_3qwcq")]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.6, 0, 0)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.6, 0, 0)
|
||||||
|
|
||||||
@@ -29,3 +29,13 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1.8000001, 0, 0)
|
|||||||
|
|
||||||
[node name="Table" parent="." unique_id=987495548 instance=ExtResource("7_0342k")]
|
[node name="Table" parent="." unique_id=987495548 instance=ExtResource("7_0342k")]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -2.4, 0, 1.2)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -2.4, 0, 1.2)
|
||||||
|
|
||||||
|
[node name="Hob" parent="." unique_id=707500902 instance=ExtResource("1_1wuvq")]
|
||||||
|
|
||||||
|
[node name="DirtStation" parent="." unique_id=784427347 instance=ExtResource("8_b5gb1")]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 1.8000001, 0, 0)
|
||||||
|
|
||||||
|
[node name="PotatoDispenser" parent="." unique_id=522124817 instance=ExtResource("9_ok0xr")]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1.8000001, 0, 0.6)
|
||||||
|
|
||||||
|
[editable path="Table"]
|
||||||
|
|||||||
+40
-1
@@ -1,4 +1,42 @@
|
|||||||
|
### Full game systems (hardest part)
|
||||||
|
- Star day modifiers
|
||||||
|
- research unlock
|
||||||
|
- Mess and cleaning (How it works in VR?)
|
||||||
|
- Automation basic logistics (SharedInventories)
|
||||||
|
- Player charaters and customization (Hat Selection and mirror)
|
||||||
|
- Sound effects and music
|
||||||
|
- Animated customers (Pathfinding)
|
||||||
|
- Acheivements (Statisticsmanager)
|
||||||
|
- Level generation
|
||||||
|
- Proper 3D models (Git gud @ blender)
|
||||||
|
**[Undecided]**
|
||||||
|
- Automation logic, wireing
|
||||||
|
- Decorations
|
||||||
|
- Win condition / across games reward / progression
|
||||||
|
- Fire
|
||||||
|
- Arms (Inverse Kinematics)
|
||||||
|
**[Scopecreep]**
|
||||||
|
- Freshness
|
||||||
|
- Fullbody tracking (Height calibration)
|
||||||
|
|
||||||
|
|
||||||
|
### Station inheritence suggestion
|
||||||
|
Station
|
||||||
|
WorkStation (performs work on a food item to convert it)
|
||||||
|
Hob
|
||||||
|
Sink
|
||||||
|
Counter
|
||||||
|
StorageStation (one snap zone and list of positions, FILO item dispenser, like a gun magazine)
|
||||||
|
Shelf
|
||||||
|
PlateRak
|
||||||
|
Dishwasher
|
||||||
|
SharedInventoryStation (one snap zone, shares a list of connected stations with which items exist in each of them)
|
||||||
|
Table
|
||||||
|
Belt
|
||||||
|
Dispenser
|
||||||
|
|
||||||
|
|
||||||
|
### Multiplayer bugs
|
||||||
- despan flicker for clien broken
|
- despan flicker for clien broken
|
||||||
- client keep autorityu of thrown object until lands
|
- client keep autorityu of thrown object until lands
|
||||||
- in build mode, snap zones off, stations disabled
|
- in build mode, snap zones off, stations disabled
|
||||||
@@ -6,8 +44,9 @@
|
|||||||
- pickables being picked up is not RELIABLY synced
|
- pickables being picked up is not RELIABLY synced
|
||||||
- sounds played on pickable in new script / node, when collides or picked_up or dropped, server tells clinetns with RPC to play sound
|
- sounds played on pickable in new script / node, when collides or picked_up or dropped, server tells clinetns with RPC to play sound
|
||||||
|
|
||||||
|
- Contaioner / plate sometimes doesn't sync to clients that it picked someting up. Only when client moves a plate near a hamburger that is in a station,
|
||||||
|
|
||||||
|
- Update stations to have enable function thaat _tate_stations in network manager calls instead of disableing processing
|
||||||
|
|
||||||
|
|
||||||
## Stations
|
## Stations
|
||||||
|
|||||||
@@ -1,68 +1,115 @@
|
|||||||
# RecipeManager
|
# Recipes
|
||||||
|
|
||||||
## Overview
|
## FoodItem
|
||||||
|
|
||||||
`RecipeManager` is a static Godot class that centralizes recipe data for food item combinations and allows runtime lookup of result scenes.
|
Every ingredient, meal, and side in the game is a `FoodItem` node (`prefabs/food_item.gd`), a sibling component on the pickable item's scene. It's just three exported fields:
|
||||||
|
|
||||||
The manager loads a single YAML file at startup: `res://recipes.yaml`, using the installed `addons/yaml` addon.
|
- `id: String` — the recipe key this item is looked up by in `recipes.yaml` (e.g. `"raw_burger"`).
|
||||||
|
- `type: Type` — `MEAL`, `SIDE`, `INGREDIENT`, or `NONE`. Used for things like which plate slot an item lands in.
|
||||||
|
- `sell_value: int` — money paid out when the item is sold/consumed.
|
||||||
|
|
||||||
## Responsibilities
|
`id` is the link between a spawned scene and its entry in `recipes.yaml` — every process below keys off it.
|
||||||
|
|
||||||
- Load recipe definitions from `recipes.yaml`.
|
## `recipes.yaml`
|
||||||
- Provide symmetric lookups for two-item combining recipes so `A + B` and `B + A` map to the same result.
|
|
||||||
- Resolve item IDs to their corresponding scene resources.
|
|
||||||
- Print all loaded combining recipes when the application starts.
|
|
||||||
|
|
||||||
## Data structure in `recipes.yaml`
|
`RecipeManager` loads a single file, `res://recipes.yaml`, with one top-level section per process plus an `items` section mapping each `id` to its scene:
|
||||||
|
|
||||||
The recipe YAML file contains two top-level sections:
|
|
||||||
|
|
||||||
- `items`: maps item IDs to their scene path and optional metadata.
|
|
||||||
- `combining`: maps result item IDs to one or more recipe pairs.
|
|
||||||
|
|
||||||
Example structure:
|
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
items:
|
items:
|
||||||
hamburger:
|
raw_burger:
|
||||||
scene: res://Items/hamburger.tscn
|
scene: res://items/burger.tscn
|
||||||
type: meal
|
cooked_burger:
|
||||||
burger_buns:
|
scene: res://items/cooked_burger.tscn
|
||||||
scene: res://Items/BurgerBuns.tscn
|
|
||||||
type: ingredient
|
|
||||||
|
|
||||||
combining:
|
combining: # instant, two items -> one
|
||||||
hamburger:
|
hamburger:
|
||||||
- [cooked_burger, burger_buns]
|
- [cooked_burger, burger_buns]
|
||||||
- [charcoal, charcoal]
|
|
||||||
charcoal:
|
cooking: # timed, one item -> one (a station's work meter)
|
||||||
- [cube, cube]
|
cooked_burger:
|
||||||
|
ingredient: raw_burger
|
||||||
|
time: 4
|
||||||
|
|
||||||
|
chopping: # timed, one item -> one
|
||||||
|
chopped_potato:
|
||||||
|
ingredient: potato
|
||||||
|
work: 30
|
||||||
|
|
||||||
|
rolling: # parsed, no station consumes it yet
|
||||||
|
pie_base:
|
||||||
|
ingredient: dough
|
||||||
|
work: 80
|
||||||
|
|
||||||
|
augmenting: # parsed, no station consumes it yet
|
||||||
|
cooked_burger:
|
||||||
|
has_tomato: sliced_tomato
|
||||||
```
|
```
|
||||||
|
|
||||||
### `items`
|
`cooking` entries may also be a list, so multiple ingredients can produce the same result (see `charcoal` in the real file, which can be made by overcooking three different things).
|
||||||
|
|
||||||
Each entry under `items` uses the item ID as the key.
|
## RecipeManager
|
||||||
The manager reads the `scene` field for each item and uses it to resolve the packed scene for recipe results.
|
|
||||||
|
|
||||||
### `combining`
|
`RecipeManager` (`global/RecipeManager.gd`) is a static class — no instance needed. On first use it lazily parses `recipes.yaml` (via the `YAML` addon) into five internal maps (`_combining_map`, `_cooking_map`, `_chopping_map`, `_rolling_map`, `_augmenting_map`) plus `_scene_paths`, and never re-parses after (`_loaded` guard).
|
||||||
|
|
||||||
Each entry under `combining` represents a result item ID, and its value is a list of recipe pairs.
|
It doesn't hand out those raw maps. Instead it exposes narrow getters that the rest of the game calls:
|
||||||
Each recipe pair is a two-item array of ingredient IDs.
|
|
||||||
This allows a single result item to have multiple valid recipes.
|
|
||||||
|
|
||||||
The manager normalizes each ingredient pair using a sorted key string internally, so lookups are symmetric.
|
| Function | Returns |
|
||||||
|
|---|---|
|
||||||
|
| `get_combination_result(a, b)` | `PackedScene` for combining two ids (order-independent) |
|
||||||
|
| `get_cooking_result(ingredient)` | result id, or `""` if not cookable |
|
||||||
|
| `get_cooking_time(ingredient)` | seconds of work needed |
|
||||||
|
| `get_chopping_result(ingredient)` | result id, or `""` if not choppable |
|
||||||
|
| `get_chopping_work(ingredient)` | work needed |
|
||||||
|
| `get_item_scene(id)` | `PackedScene` for any item id |
|
||||||
|
| `print_all_recipes()` | debug dump of every loaded recipe, called once from `main.gd` at startup |
|
||||||
|
|
||||||
## Runtime behavior
|
`rolling` and `augmenting` are parsed and included in `print_all_recipes()`, but currently have no matching getters or station — they're not wired into a conversion process yet.
|
||||||
|
|
||||||
- `FoodItem.id` is used when combining items to look up the recipe result.
|
## Conversion processes
|
||||||
- `RecipeManager.get_combination(first_id, second_id)` computes a canonical key for the pair and returns the resulting item's scene.
|
|
||||||
- On startup, `main.gd` calls `RecipeManager.print_all_recipes()`, which logs each combining recipe in the form:
|
|
||||||
|
|
||||||
`ingredient_a + ingredient_b -> result_id`
|
Two different mechanisms turn one `FoodItem` into another today:
|
||||||
|
|
||||||
## Notes
|
**Combining** — instant, no station involved. `CombinableItem` (`prefabs/combinable_item.gd`) sits on every pickable item; while the item is snapped into a zone, its trigger area watches for another `FoodItem` entering. On contact it asks `RecipeManager.get_combination_result(a, b)` — if a recipe exists, it despawns both ingredients and spawns the result in their place.
|
||||||
|
|
||||||
- `RecipeManager` prefers the installed YAML addon to parse `recipes.yaml` when it is available.
|
**Cooking / chopping** — timed, driven by `WorkStation`'s shared work meter (`current_work` / `max_work` / `result_id`, see [Stations.md](Stations.md)). When a `Hob` or `Counter` picks up a `FoodItem`, it asks `RecipeManager` whether that ingredient has a recipe for its process (`get_cooking_result`/`get_chopping_result`) and, if so, how much work it needs (`get_cooking_time`/`get_chopping_work`), then starts accumulating work — a `Hob` ticks it every frame, a `Counter` adds it per knife swipe. Once `current_work` reaches `max_work`, `WorkStation.convert_item()` calls `RecipeManager.get_item_scene(result_id)`, despawns the original item, and spawns the result in the same snap zone.
|
||||||
- If the addon is unavailable in the current runtime, the manager falls back to a lightweight built-in parser for the simple `items`/`combining` file format.
|
|
||||||
- Scene paths now live in the YAML data instead of being hardcoded in the manager.
|
Separately, `ItemContainer` (`Containers/container.gd`) calls `get_item_scene(id)` too, but only to instantiate the correct visual mesh for each id in a plate's synced contents list — that's a display lookup, not a conversion.
|
||||||
- Because `RecipeManager` is static, it can be used from any script without creating an instance.
|
|
||||||
|
## Diagram
|
||||||
|
|
||||||
|
```mermaid
|
||||||
|
flowchart TD
|
||||||
|
YAML["recipes.yaml"] -->|"YAML.load_file()"| RM["RecipeManager<br/>(global/RecipeManager.gd)"]
|
||||||
|
RM --> Maps["_combining_map / _cooking_map / _chopping_map / _scene_paths<br/>(_rolling_map / _augmenting_map parsed, not yet consumed)"]
|
||||||
|
|
||||||
|
subgraph Instant["Instant conversion"]
|
||||||
|
direction TB
|
||||||
|
CI["CombinableItem<br/>(prefabs/combinable_item.gd)"]
|
||||||
|
end
|
||||||
|
|
||||||
|
subgraph Timed["Timed conversion"]
|
||||||
|
direction TB
|
||||||
|
Hob["Hob<br/>(stations/hob.gd)"]
|
||||||
|
Counter["Counter<br/>(stations/counter.gd)"]
|
||||||
|
WS["WorkStation.convert_item()<br/>(abstract/work_station.gd)"]
|
||||||
|
Hob -.->|"result_id, max_work"| WS
|
||||||
|
Counter -.->|"result_id, max_work"| WS
|
||||||
|
end
|
||||||
|
|
||||||
|
subgraph Display["Display only, not a conversion"]
|
||||||
|
direction TB
|
||||||
|
Container["ItemContainer<br/>(Containers/container.gd)"]
|
||||||
|
end
|
||||||
|
|
||||||
|
CI -->|"get_combination_result(a, b)"| RM
|
||||||
|
Hob -->|"get_cooking_result / get_cooking_time"| RM
|
||||||
|
Counter -->|"get_chopping_result / get_chopping_work"| RM
|
||||||
|
WS -->|"get_item_scene(result_id)"| RM
|
||||||
|
Container -->|"get_item_scene(id)"| RM
|
||||||
|
|
||||||
|
Spawn(("NetworkManager.spawn_item"))
|
||||||
|
CI ==>|"instantiates result"| Spawn
|
||||||
|
WS ==>|"instantiates result"| Spawn
|
||||||
|
```
|
||||||
|
|
||||||
|
Solid arrows are calls into `RecipeManager`; dotted arrows are `Hob`/`Counter` handing their recipe off to `WorkStation`'s shared work meter; thick arrows are the actual item conversion. `CombinableItem` and `WorkStation` are grouped in adjacent lanes so both paths to `NetworkManager.spawn_item` stay short; `ItemContainer` sits in its own lane since it never spawns anything.
|
||||||
|
|||||||
@@ -0,0 +1,122 @@
|
|||||||
|
# Stations
|
||||||
|
|
||||||
|
## Overview
|
||||||
|
|
||||||
|
A "station" is any interactable kitchen fixture a player works at: `Counter`, `Hob`, `Sink`, `Table`, `DirtStation`, and the item dispensers. They share networking, sound, and snap-zone plumbing through a common script base, and share their node layout through a common base scene.
|
||||||
|
|
||||||
|
Two independent inheritance mechanisms combine to build a concrete station, e.g. `Table`:
|
||||||
|
|
||||||
|
- **Scene inheritance** — `table.tscn` is a Godot "inherited scene" of `abstract/station.tscn`, so it gets the same child nodes (snap zone, synchronizer, audio players, progress bar) for free.
|
||||||
|
- **Script inheritance** — `table.gd` (attached as a script override on that inherited scene) extends `SharedInventoryStation`, which extends `Station`.
|
||||||
|
|
||||||
|
These two axes are independent: which base scene a `.tscn` inherits from is unrelated to which class its attached script extends.
|
||||||
|
|
||||||
|
## Scene inheritance
|
||||||
|
|
||||||
|
`abstract/station.tscn` is the base scene every station scene inherits from:
|
||||||
|
|
||||||
|
```
|
||||||
|
Station (Node3D)
|
||||||
|
├─ StationMovement (drag-to-move handle, res://stations/StationMovement.tscn)
|
||||||
|
├─ MultiplayerSynchronizer
|
||||||
|
├─ AudioStreamPlayer3DNotification
|
||||||
|
├─ AudioStreamPlayer3DAmbient
|
||||||
|
├─ ProgressBar3D
|
||||||
|
└─ SnapZone
|
||||||
|
```
|
||||||
|
|
||||||
|
Each concrete station scene inherits this scene and overrides the root node's `script` property to attach its own class:
|
||||||
|
|
||||||
|
| Scene | Script attached |
|
||||||
|
|---|---|
|
||||||
|
| `Counter.tscn` | `stations/counter.gd` (`Counter`) |
|
||||||
|
| `Hob.tscn` | `stations/hob.gd` (`Hob`) |
|
||||||
|
| `sink.tscn` | `stations/sink.gd` (`Sink`) |
|
||||||
|
| `table.tscn` | `stations/table.gd` (`Table`) |
|
||||||
|
| `dirt_station.tscn` | `stations/dirt_station.gd` (`DirtStation`) |
|
||||||
|
| `BurgerBunsDispenser.tscn`, `cube_side_dispense.tscn`, `plate_dispenser.tscn`, `potato_dispenser.tscn`, `raw_burger_dispenser.tscn` | `stations/item_dispenser.gd` (`ItemDispenser`) |
|
||||||
|
|
||||||
|
`StationMovement` (`stations/station_movement.gd`) is a sibling node composed into the base scene, not a station subclass — it's what lets players pick the whole station up and move it in build mode.
|
||||||
|
|
||||||
|
## Script (class) inheritance
|
||||||
|
|
||||||
|
```mermaid
|
||||||
|
classDiagram
|
||||||
|
direction TB
|
||||||
|
Node3D <|-- Station
|
||||||
|
Station <|-- WorkStation
|
||||||
|
Station <|-- SharedInventoryStation
|
||||||
|
Station <|-- DirtStation
|
||||||
|
Station <|-- ItemDispenser
|
||||||
|
WorkStation <|-- Hob
|
||||||
|
WorkStation <|-- Sink
|
||||||
|
WorkStation <|-- Counter
|
||||||
|
SharedInventoryStation <|-- Table
|
||||||
|
|
||||||
|
class Station {
|
||||||
|
<<abstract>>
|
||||||
|
+snap_zone : XRToolsSnapZone
|
||||||
|
+synchronizer : MultiplayerSynchronizer
|
||||||
|
+enabled : bool
|
||||||
|
+on_object_picked_up(item)
|
||||||
|
+on_object_dropped(item)
|
||||||
|
+refresh_display()
|
||||||
|
}
|
||||||
|
class WorkStation {
|
||||||
|
<<abstract>>
|
||||||
|
+current_work : float
|
||||||
|
+max_work : float
|
||||||
|
+result_id : String
|
||||||
|
+add_work(work)
|
||||||
|
+convert_item()
|
||||||
|
}
|
||||||
|
class SharedInventoryStation {
|
||||||
|
<<abstract>>
|
||||||
|
+probes : Area3D[]
|
||||||
|
+neighbors : Dictionary
|
||||||
|
+get_connected_group()
|
||||||
|
+is_group_leader()
|
||||||
|
}
|
||||||
|
class Hob {
|
||||||
|
+cook_speed : float
|
||||||
|
}
|
||||||
|
class Sink {
|
||||||
|
+wash_speed : float
|
||||||
|
}
|
||||||
|
class Counter {
|
||||||
|
+chop_work_steps : float
|
||||||
|
}
|
||||||
|
class DirtStation
|
||||||
|
class ItemDispenser {
|
||||||
|
+item_scene : PackedScene
|
||||||
|
}
|
||||||
|
class Table {
|
||||||
|
+_state : TableState
|
||||||
|
+place_order()
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
| Class | File | Role |
|
||||||
|
|---|---|---|
|
||||||
|
| `Station` | `abstract/station.gd` | Base for every station. Owns the snap zone, sets up the `MultiplayerSynchronizer`'s replication config, propagates pickup/drop events to clients over RPC, and exposes virtual hooks (`on_object_picked_up`, `on_object_dropped`, `on_food_item_picked_up`, `on_food_item_dropped`, `refresh_display`). |
|
||||||
|
| `WorkStation` | `abstract/work_station.gd` | Base for stations that convert a held `FoodItem` over time via a synced work meter (`current_work`/`max_work`/`result_id`). `add_work()` routes through the server via RPC, and `convert_item()` swaps the held item for the recipe result on completion. |
|
||||||
|
| `Hob` | `stations/hob.gd` | Cooks food using `RecipeManager` cooking recipes; plays a cook animation while active. |
|
||||||
|
| `Sink` | `stations/sink.gd` | Washes a dirty `PlateController` over time; drives water/bubble effect nodes. |
|
||||||
|
| `Counter` | `stations/counter.gd` | Chops food when a knife gesture area detects a fast-enough swipe. |
|
||||||
|
| `SharedInventoryStation` | `abstract/shared_inventory_station.gd` | Base for stations that need to know about same-kind neighbors. Resolves `probe_paths` into neighbor `Area3D`s, builds a connected-group graph (cycle-safe, for belt/table loops), and computes a deterministic group leader. |
|
||||||
|
| `Table` | `stations/table.gd` | The only concrete `SharedInventoryStation`. Runs the customer-order finite state machine (`EMPTY → THINKING → ORDERING → WAITING_PRIMARY → WAITING_FRIEND → EATING`); the connected group's leader orchestrates state, followers mirror it. |
|
||||||
|
| `DirtStation` | `stations/dirt_station.gd` | Marks a dropped plate as dirty. Extends `Station` directly (no work meter). |
|
||||||
|
| `ItemDispenser` | `stations/item_dispenser.gd` | Server keeps a fresh instance of `item_scene` spawned into its snap zone whenever it's empty. Extends `Station` directly. |
|
||||||
|
|
||||||
|
## Networking pattern
|
||||||
|
|
||||||
|
Every station follows the same client/server split, established in `Station`:
|
||||||
|
|
||||||
|
- The server (`NetworkManager.owns_world()`) is authoritative for state changes.
|
||||||
|
- A client calls a public method (e.g. `add_work`, `place_order`); if it isn't the server, that method forwards the call via `*_id.rpc_id(1)` and returns.
|
||||||
|
- The server applies the change locally, then RPCs the result back out to clients (e.g. `_clients_on_object_picked_up_handler`, `_everyone_on_work_complete`).
|
||||||
|
- Frequently-changing fields (`current_work`, `result_id`, table `_state`, etc.) are also registered on `sync_config` in `_enter_tree()` for straight property replication.
|
||||||
|
|
||||||
|
## Notes
|
||||||
|
|
||||||
|
- `stations/station.gd` (`extends "res://stations/hob.gd"`, no `class_name`) is not attached to any scene and isn't part of this hierarchy — it looks like leftover scaffolding.
|
||||||
+27
-27
@@ -9,9 +9,9 @@ func set_money(value):
|
|||||||
if multiplayer.is_server():
|
if multiplayer.is_server():
|
||||||
money = max(0,value)
|
money = max(0,value)
|
||||||
client_sync_money.rpc(money)
|
client_sync_money.rpc(money)
|
||||||
SweetLogger.info("set_money money set to {0}", [money])
|
SweetLogger.info("Set to {0}", [money])
|
||||||
else:
|
else:
|
||||||
SweetLogger.info("set_money client/(peer_id={0}) attempted to set money directly, sending request to server", [multiplayer.get_unique_id()])
|
SweetLogger.info("Client (peer {0}) attempted direct set, forwarding to server", [multiplayer.get_unique_id()])
|
||||||
server_set_money.rpc_id(1, value)
|
server_set_money.rpc_id(1, value)
|
||||||
|
|
||||||
@rpc("any_peer", "call_remote", "reliable") # CLIENT -> SERVER: Request a change
|
@rpc("any_peer", "call_remote", "reliable") # CLIENT -> SERVER: Request a change
|
||||||
@@ -29,9 +29,9 @@ func set_day_number(value: int) -> void:
|
|||||||
if multiplayer.is_server():
|
if multiplayer.is_server():
|
||||||
day_number = value
|
day_number = value
|
||||||
client_sync_day_number.rpc(day_number)
|
client_sync_day_number.rpc(day_number)
|
||||||
SweetLogger.info("set_day_number day_number set to {0}", [day_number])
|
SweetLogger.info("Set to {0}", [day_number])
|
||||||
else:
|
else:
|
||||||
SweetLogger.info("set_day_number client/(peer_id={0}) attempted to set day_number directly, sending request to server", [multiplayer.get_unique_id()])
|
SweetLogger.info("Client (peer {0}) attempted direct set, forwarding to server", [multiplayer.get_unique_id()])
|
||||||
server_set_day_number.rpc_id(1, value)
|
server_set_day_number.rpc_id(1, value)
|
||||||
|
|
||||||
@rpc("any_peer", "call_remote", "reliable")
|
@rpc("any_peer", "call_remote", "reliable")
|
||||||
@@ -51,9 +51,9 @@ func set_meals_in_play(value: Array[String]) -> void:
|
|||||||
if multiplayer.is_server():
|
if multiplayer.is_server():
|
||||||
meals_in_play = value
|
meals_in_play = value
|
||||||
client_sync_meals_in_play.rpc(meals_in_play)
|
client_sync_meals_in_play.rpc(meals_in_play)
|
||||||
SweetLogger.info("set_meals_in_play meals_in_play set to {0}", [meals_in_play])
|
SweetLogger.info("Set to {0}", [meals_in_play])
|
||||||
else:
|
else:
|
||||||
SweetLogger.info("set_meals_in_play client/(peer_id={0}) attempted to set meals_in_play directly, sending request to server", [multiplayer.get_unique_id()])
|
SweetLogger.info("Client (peer {0}) attempted direct set, forwarding to server", [multiplayer.get_unique_id()])
|
||||||
server_set_meals_in_play.rpc_id(1, value)
|
server_set_meals_in_play.rpc_id(1, value)
|
||||||
|
|
||||||
@rpc("any_peer", "call_remote", "reliable")
|
@rpc("any_peer", "call_remote", "reliable")
|
||||||
@@ -73,9 +73,9 @@ func set_sides_in_play(value: Array[String]) -> void:
|
|||||||
if multiplayer.is_server():
|
if multiplayer.is_server():
|
||||||
sides_in_play = value
|
sides_in_play = value
|
||||||
client_sync_sides_in_play.rpc(sides_in_play)
|
client_sync_sides_in_play.rpc(sides_in_play)
|
||||||
SweetLogger.info("set_sides_in_play sides_in_play set to {0}", [sides_in_play])
|
SweetLogger.info("Set to {0}", [sides_in_play])
|
||||||
else:
|
else:
|
||||||
SweetLogger.info("set_sides_in_play client/(peer_id={0}) attempted to set sides_in_play directly, sending request to server", [multiplayer.get_unique_id()])
|
SweetLogger.info("Client (peer {0}) attempted direct set, forwarding to server", [multiplayer.get_unique_id()])
|
||||||
server_set_sides_in_play.rpc_id(1, value)
|
server_set_sides_in_play.rpc_id(1, value)
|
||||||
|
|
||||||
@rpc("any_peer", "call_remote", "reliable")
|
@rpc("any_peer", "call_remote", "reliable")
|
||||||
@@ -96,9 +96,9 @@ func set_day_length_seconds(value: float) -> void:
|
|||||||
if multiplayer.is_server():
|
if multiplayer.is_server():
|
||||||
day_length_seconds = value
|
day_length_seconds = value
|
||||||
client_sync_day_length_seconds.rpc(day_length_seconds)
|
client_sync_day_length_seconds.rpc(day_length_seconds)
|
||||||
SweetLogger.info("set_day_length_seconds day_length_seconds set to {0}", [day_length_seconds])
|
SweetLogger.info("Set to {0}", [day_length_seconds])
|
||||||
else:
|
else:
|
||||||
SweetLogger.info("set_day_length_seconds client/(peer_id={0}) attempted to set day_length_seconds directly, sending request to server", [multiplayer.get_unique_id()])
|
SweetLogger.info("Client (peer {0}) attempted direct set, forwarding to server", [multiplayer.get_unique_id()])
|
||||||
server_set_day_length_seconds.rpc_id(1, value)
|
server_set_day_length_seconds.rpc_id(1, value)
|
||||||
|
|
||||||
@rpc("any_peer", "call_remote", "reliable")
|
@rpc("any_peer", "call_remote", "reliable")
|
||||||
@@ -118,9 +118,9 @@ func set_customers_per_day(value: float) -> void:
|
|||||||
if multiplayer.is_server():
|
if multiplayer.is_server():
|
||||||
customers_per_day = value
|
customers_per_day = value
|
||||||
client_sync_customers_per_day.rpc(customers_per_day)
|
client_sync_customers_per_day.rpc(customers_per_day)
|
||||||
SweetLogger.info("set_customers_per_day customers_per_day set to {0}", [customers_per_day])
|
SweetLogger.info("Set to {0}", [customers_per_day])
|
||||||
else:
|
else:
|
||||||
SweetLogger.info("set_customers_per_day client/(peer_id={0}) attempted to set customers_per_day directly, sending request to server", [multiplayer.get_unique_id()])
|
SweetLogger.info("Client (peer {0}) attempted direct set, forwarding to server", [multiplayer.get_unique_id()])
|
||||||
server_set_customers_per_day.rpc_id(1, value)
|
server_set_customers_per_day.rpc_id(1, value)
|
||||||
|
|
||||||
@rpc("any_peer", "call_remote", "reliable")
|
@rpc("any_peer", "call_remote", "reliable")
|
||||||
@@ -140,9 +140,9 @@ func set_customers_count_increase_per_day(value: float) -> void:
|
|||||||
if multiplayer.is_server():
|
if multiplayer.is_server():
|
||||||
customers_count_increase_per_day = value
|
customers_count_increase_per_day = value
|
||||||
client_sync_customers_count_increase_per_day.rpc(customers_count_increase_per_day)
|
client_sync_customers_count_increase_per_day.rpc(customers_count_increase_per_day)
|
||||||
SweetLogger.info("set_customers_count_increase_per_day customers_count_increase_per_day set to {0}", [customers_count_increase_per_day])
|
SweetLogger.info("Set to {0}", [customers_count_increase_per_day])
|
||||||
else:
|
else:
|
||||||
SweetLogger.info("set_customers_count_increase_per_day client/(peer_id={0}) attempted to set customers_count_increase_per_day directly, sending request to server", [multiplayer.get_unique_id()])
|
SweetLogger.info("Client (peer {0}) attempted direct set, forwarding to server", [multiplayer.get_unique_id()])
|
||||||
server_set_customers_count_increase_per_day.rpc_id(1, value)
|
server_set_customers_count_increase_per_day.rpc_id(1, value)
|
||||||
|
|
||||||
@rpc("any_peer", "call_remote", "reliable")
|
@rpc("any_peer", "call_remote", "reliable")
|
||||||
@@ -162,9 +162,9 @@ func set_group_min_size(value: int) -> void:
|
|||||||
if multiplayer.is_server():
|
if multiplayer.is_server():
|
||||||
group_min_size = value
|
group_min_size = value
|
||||||
client_sync_group_min_size.rpc(group_min_size)
|
client_sync_group_min_size.rpc(group_min_size)
|
||||||
SweetLogger.info("set_group_min_size group_min_size set to {0}", [group_min_size])
|
SweetLogger.info("Set to {0}", [group_min_size])
|
||||||
else:
|
else:
|
||||||
SweetLogger.info("set_group_min_size client/(peer_id={0}) attempted to set group_min_size directly, sending request to server", [multiplayer.get_unique_id()])
|
SweetLogger.info("Client (peer {0}) attempted direct set, forwarding to server", [multiplayer.get_unique_id()])
|
||||||
server_set_group_min_size.rpc_id(1, value)
|
server_set_group_min_size.rpc_id(1, value)
|
||||||
|
|
||||||
@rpc("any_peer", "call_remote", "reliable")
|
@rpc("any_peer", "call_remote", "reliable")
|
||||||
@@ -184,9 +184,9 @@ func set_group_max_size(value: int) -> void:
|
|||||||
if multiplayer.is_server():
|
if multiplayer.is_server():
|
||||||
group_max_size = value
|
group_max_size = value
|
||||||
client_sync_group_max_size.rpc(group_max_size)
|
client_sync_group_max_size.rpc(group_max_size)
|
||||||
SweetLogger.info("set_group_max_size group_max_size set to {0}", [group_max_size])
|
SweetLogger.info("Set to {0}", [group_max_size])
|
||||||
else:
|
else:
|
||||||
SweetLogger.info("set_group_max_size client/(peer_id={0}) attempted to set group_max_size directly, sending request to server", [multiplayer.get_unique_id()])
|
SweetLogger.info("Client (peer {0}) attempted direct set, forwarding to server", [multiplayer.get_unique_id()])
|
||||||
server_set_group_max_size.rpc_id(1, value)
|
server_set_group_max_size.rpc_id(1, value)
|
||||||
|
|
||||||
@rpc("any_peer", "call_remote", "reliable")
|
@rpc("any_peer", "call_remote", "reliable")
|
||||||
@@ -213,9 +213,9 @@ func set_game_state(value: GameState) -> void:
|
|||||||
game_state = value
|
game_state = value
|
||||||
client_sync_game_state.rpc(game_state)
|
client_sync_game_state.rpc(game_state)
|
||||||
Signals.game_state_changed.emit(game_state)
|
Signals.game_state_changed.emit(game_state)
|
||||||
SweetLogger.info("set_game_state game_state set to {0}", [game_state])
|
SweetLogger.info("Set to {0}", [game_state])
|
||||||
else:
|
else:
|
||||||
SweetLogger.info("set_game_state client/(peer_id={0}) attempted to set game_state directly, sending request to server", [multiplayer.get_unique_id()])
|
SweetLogger.info("Client (peer {0}) attempted direct set, forwarding to server", [multiplayer.get_unique_id()])
|
||||||
server_set_game_state.rpc_id(1, value)
|
server_set_game_state.rpc_id(1, value)
|
||||||
|
|
||||||
@rpc("any_peer", "call_remote", "reliable")
|
@rpc("any_peer", "call_remote", "reliable")
|
||||||
@@ -230,29 +230,29 @@ func client_sync_game_state(value: GameState) -> void:
|
|||||||
|
|
||||||
func get_random_meal() -> String:
|
func get_random_meal() -> String:
|
||||||
if meals_in_play.size() == 0:
|
if meals_in_play.size() == 0:
|
||||||
push_error("GameManager: get_random_meal() called but meals_in_play is empty")
|
SweetLogger.error("Get_random_meal() called but meals_in_play is empty")
|
||||||
return ""
|
return ""
|
||||||
var rand_index = randi() % meals_in_play.size()
|
var rand_index = randi() % meals_in_play.size()
|
||||||
SweetLogger.debug("get_random_meal() returning {0}", [meals_in_play[rand_index]])
|
SweetLogger.debug("Get_random_meal() returning {0}", [meals_in_play[rand_index]])
|
||||||
return meals_in_play[rand_index]
|
return meals_in_play[rand_index]
|
||||||
|
|
||||||
|
|
||||||
func get_random_side() -> String:
|
func get_random_side() -> String:
|
||||||
SweetLogger.debug("get_random_side()")
|
SweetLogger.debug("->[]")
|
||||||
if sides_in_play.size() == 0:
|
if sides_in_play.size() == 0:
|
||||||
push_error("GameManager: get_random_side() called but sides_in_play is empty")
|
SweetLogger.error("Get_random_side() called but sides_in_play is empty")
|
||||||
return ""
|
return ""
|
||||||
var rand_index = randi() % sides_in_play.size()
|
var rand_index = randi() % sides_in_play.size()
|
||||||
SweetLogger.debug("get_random_side() list={0} returning {1}", [sides_in_play, sides_in_play[rand_index]], "GameManager.gd", "get_random_side")
|
SweetLogger.debug("List={0} returning {1}", [sides_in_play, sides_in_play[rand_index]], "GameManager.gd", "get_random_side")
|
||||||
return sides_in_play[rand_index]
|
return sides_in_play[rand_index]
|
||||||
|
|
||||||
|
|
||||||
func _restart():
|
func _restart():
|
||||||
SweetLogger.info("restart Game")
|
SweetLogger.info("Restart game")
|
||||||
game_state = GameState.RUNNING
|
game_state = GameState.RUNNING
|
||||||
|
|
||||||
|
|
||||||
func game_over():
|
func game_over():
|
||||||
SweetLogger.info("Game Over")
|
SweetLogger.info("Game over")
|
||||||
game_state = GameState.GAME_OVER
|
game_state = GameState.GAME_OVER
|
||||||
Signals.game_over.emit()
|
Signals.game_over.emit()
|
||||||
|
|||||||
+21
-21
@@ -16,7 +16,7 @@ static func load_recipes() -> void:
|
|||||||
|
|
||||||
var recipe_path := "res://recipes.yaml"
|
var recipe_path := "res://recipes.yaml"
|
||||||
if not FileAccess.file_exists(recipe_path):
|
if not FileAccess.file_exists(recipe_path):
|
||||||
push_error("RecipeManager: recipes.yaml was not found at %s" % recipe_path)
|
SweetLogger.error("Recipes.yaml was not found at {0}", [recipe_path])
|
||||||
return
|
return
|
||||||
|
|
||||||
var yaml_available := ClassDB.class_exists("YAML")
|
var yaml_available := ClassDB.class_exists("YAML")
|
||||||
@@ -25,7 +25,7 @@ static func load_recipes() -> void:
|
|||||||
if result != null and not result.has_error():
|
if result != null and not result.has_error():
|
||||||
var data = result.get_data()
|
var data = result.get_data()
|
||||||
if typeof(data) != TYPE_DICTIONARY:
|
if typeof(data) != TYPE_DICTIONARY:
|
||||||
push_warning("RecipeManager: YAML addon parsed recipes.yaml but returned an unsupported structure")
|
SweetLogger.warning("YAML addon parsed recipes.yaml but returned an unsupported structure")
|
||||||
|
|
||||||
_recipes = data
|
_recipes = data
|
||||||
_build_scene_paths()
|
_build_scene_paths()
|
||||||
@@ -98,12 +98,12 @@ static func get_item_scene(item_id: StringName) -> PackedScene:
|
|||||||
load_recipes()
|
load_recipes()
|
||||||
var scene_path = _scene_paths.get(str(item_id), "")
|
var scene_path = _scene_paths.get(str(item_id), "")
|
||||||
if typeof(scene_path) != TYPE_STRING or scene_path.is_empty():
|
if typeof(scene_path) != TYPE_STRING or scene_path.is_empty():
|
||||||
push_error("RecipeManager: no scene mapping found for item id '%s'" % item_id)
|
SweetLogger.error("No scene mapping found for item id '{0}'", [item_id])
|
||||||
return null
|
return null
|
||||||
|
|
||||||
var scene = ResourceLoader.load(scene_path)
|
var scene = ResourceLoader.load(scene_path)
|
||||||
if not scene:
|
if not scene:
|
||||||
push_error("RecipeManager: failed to load scene '%s' for item '%s'" % [scene_path, item_id])
|
SweetLogger.error("Failed to load scene '{0}' for item '{1}'", [scene_path, item_id])
|
||||||
return null
|
return null
|
||||||
return scene as PackedScene
|
return scene as PackedScene
|
||||||
|
|
||||||
@@ -111,14 +111,14 @@ static func get_item_scene(item_id: StringName) -> PackedScene:
|
|||||||
static func print_all_recipes() -> void:
|
static func print_all_recipes() -> void:
|
||||||
load_recipes()
|
load_recipes()
|
||||||
if not _loaded:
|
if not _loaded:
|
||||||
SweetLogger.warning("could not load recipes.yaml; no recipes printed.")
|
SweetLogger.warning("Could not load recipes.yaml; no recipes printed")
|
||||||
return
|
return
|
||||||
|
|
||||||
if _combining_map.is_empty():
|
if _combining_map.is_empty():
|
||||||
SweetLogger.warning("no combining recipes found")
|
SweetLogger.warning("No combining recipes found")
|
||||||
return
|
return
|
||||||
|
|
||||||
SweetLogger.info("#### RecipeManager: Loaded recipes ####")
|
SweetLogger.info("#### Loaded recipes ####")
|
||||||
_print_combining_recipes()
|
_print_combining_recipes()
|
||||||
SweetLogger.info("")
|
SweetLogger.info("")
|
||||||
_print_cooking_recipes()
|
_print_cooking_recipes()
|
||||||
@@ -135,7 +135,7 @@ static func _print_combining_recipes() -> void:
|
|||||||
var key_str = str(pair_key)
|
var key_str = str(pair_key)
|
||||||
var separator_index = key_str.find("|")
|
var separator_index = key_str.find("|")
|
||||||
if separator_index == -1:
|
if separator_index == -1:
|
||||||
SweetLogger.warning("invalid combining map key '{0}'", [key_str])
|
SweetLogger.warning("Invalid combining map key '{0}'", [key_str])
|
||||||
continue
|
continue
|
||||||
|
|
||||||
var first = key_str.substr(0, separator_index)
|
var first = key_str.substr(0, separator_index)
|
||||||
@@ -198,7 +198,7 @@ static func _build_combining_map() -> void:
|
|||||||
for result_id in combining.keys():
|
for result_id in combining.keys():
|
||||||
var recipe_entries = _get_recipe_entries(combining[result_id])
|
var recipe_entries = _get_recipe_entries(combining[result_id])
|
||||||
if recipe_entries.is_empty():
|
if recipe_entries.is_empty():
|
||||||
push_error("RecipeManager: combining recipe '%s' must contain at least one valid recipe" % result_id)
|
SweetLogger.error("Combining recipe '{0}' must contain at least one valid recipe", [result_id])
|
||||||
continue
|
continue
|
||||||
for recipe in recipe_entries:
|
for recipe in recipe_entries:
|
||||||
var first = StringName(recipe[0])
|
var first = StringName(recipe[0])
|
||||||
@@ -251,24 +251,24 @@ static func _build_cooking_map() -> void:
|
|||||||
if typeof(cook_val) == TYPE_ARRAY:
|
if typeof(cook_val) == TYPE_ARRAY:
|
||||||
for entry in cook_val:
|
for entry in cook_val:
|
||||||
if typeof(entry) != TYPE_DICTIONARY:
|
if typeof(entry) != TYPE_DICTIONARY:
|
||||||
push_error("RecipeManager: cooking recipe for '%s' contains a non-dictionary entry" % cooked_id)
|
SweetLogger.error("Cooking recipe for '{0}' contains a non-dictionary entry", [cooked_id])
|
||||||
continue
|
continue
|
||||||
entries.append(entry)
|
entries.append(entry)
|
||||||
elif typeof(cook_val) == TYPE_DICTIONARY:
|
elif typeof(cook_val) == TYPE_DICTIONARY:
|
||||||
entries.append(cook_val)
|
entries.append(cook_val)
|
||||||
else:
|
else:
|
||||||
push_error("RecipeManager: cooking recipe for '%s' must be a dictionary or array of dictionaries" % cooked_id)
|
SweetLogger.error("Cooking recipe for '{0}' must be a dictionary or array of dictionaries", [cooked_id])
|
||||||
continue
|
continue
|
||||||
|
|
||||||
var parsed_entries: Array = []
|
var parsed_entries: Array = []
|
||||||
for cook_def in entries:
|
for cook_def in entries:
|
||||||
var ingredient = cook_def.get("ingredient", "")
|
var ingredient = cook_def.get("ingredient", "")
|
||||||
if typeof(ingredient) != TYPE_STRING or str(ingredient).is_empty():
|
if typeof(ingredient) != TYPE_STRING or str(ingredient).is_empty():
|
||||||
push_error("RecipeManager: cooking recipe '%s' missing a valid 'ingredient' field" % cooked_id)
|
SweetLogger.error("Cooking recipe '{0}' missing a valid 'ingredient' field", [cooked_id])
|
||||||
continue
|
continue
|
||||||
var time_val = cook_def.get("time", null)
|
var time_val = cook_def.get("time", null)
|
||||||
if typeof(time_val) != TYPE_INT and typeof(time_val) != TYPE_FLOAT:
|
if typeof(time_val) != TYPE_INT and typeof(time_val) != TYPE_FLOAT:
|
||||||
push_error("RecipeManager: cooking recipe '%s' missing a valid 'time' field" % cooked_id)
|
SweetLogger.error("Cooking recipe '{0}' missing a valid 'time' field", [cooked_id])
|
||||||
continue
|
continue
|
||||||
parsed_entries.append({"ingredient": StringName(str(ingredient)), "time": float(time_val)})
|
parsed_entries.append({"ingredient": StringName(str(ingredient)), "time": float(time_val)})
|
||||||
|
|
||||||
@@ -289,15 +289,15 @@ static func _build_chopping_map() -> void:
|
|||||||
for chopped_id in chopping.keys():
|
for chopped_id in chopping.keys():
|
||||||
var chop_def = chopping[chopped_id]
|
var chop_def = chopping[chopped_id]
|
||||||
if typeof(chop_def) != TYPE_DICTIONARY:
|
if typeof(chop_def) != TYPE_DICTIONARY:
|
||||||
push_error("RecipeManager: chopping recipe for '%s' must be a dictionary" % chopped_id)
|
SweetLogger.error("Chopping recipe for '{0}' must be a dictionary", [chopped_id])
|
||||||
continue
|
continue
|
||||||
var ingredient = chop_def.get("ingredient", "")
|
var ingredient = chop_def.get("ingredient", "")
|
||||||
if typeof(ingredient) != TYPE_STRING or str(ingredient).is_empty():
|
if typeof(ingredient) != TYPE_STRING or str(ingredient).is_empty():
|
||||||
push_error("RecipeManager: chopping recipe '%s' missing a valid 'ingredient' field" % chopped_id)
|
SweetLogger.error("Chopping recipe '{0}' missing a valid 'ingredient' field", [chopped_id])
|
||||||
continue
|
continue
|
||||||
var work_val = chop_def.get("work", null)
|
var work_val = chop_def.get("work", null)
|
||||||
if typeof(work_val) != TYPE_INT and typeof(work_val) != TYPE_FLOAT:
|
if typeof(work_val) != TYPE_INT and typeof(work_val) != TYPE_FLOAT:
|
||||||
push_error("RecipeManager: chopping recipe '%s' missing a valid 'work' field" % chopped_id)
|
SweetLogger.error("Chopping recipe '{0}' missing a valid 'work' field", [chopped_id])
|
||||||
continue
|
continue
|
||||||
# store chopped item -> { ingredient: StringName, work: float }
|
# store chopped item -> { ingredient: StringName, work: float }
|
||||||
_chopping_map[StringName(chopped_id)] = {"ingredient": StringName(str(ingredient)), "work": float(work_val)}
|
_chopping_map[StringName(chopped_id)] = {"ingredient": StringName(str(ingredient)), "work": float(work_val)}
|
||||||
@@ -316,15 +316,15 @@ static func _build_rolling_map() -> void:
|
|||||||
for rolled_id in rolling.keys():
|
for rolled_id in rolling.keys():
|
||||||
var roll_def = rolling[rolled_id]
|
var roll_def = rolling[rolled_id]
|
||||||
if typeof(roll_def) != TYPE_DICTIONARY:
|
if typeof(roll_def) != TYPE_DICTIONARY:
|
||||||
push_error("RecipeManager: rolling recipe for '%s' must be a dictionary" % rolled_id)
|
SweetLogger.error("Rolling recipe for '{0}' must be a dictionary", [rolled_id])
|
||||||
continue
|
continue
|
||||||
var ingredient = roll_def.get("ingredient", "")
|
var ingredient = roll_def.get("ingredient", "")
|
||||||
if typeof(ingredient) != TYPE_STRING or str(ingredient).is_empty():
|
if typeof(ingredient) != TYPE_STRING or str(ingredient).is_empty():
|
||||||
push_error("RecipeManager: rolling recipe '%s' missing a valid 'ingredient' field" % rolled_id)
|
SweetLogger.error("Rolling recipe '{0}' missing a valid 'ingredient' field", [rolled_id])
|
||||||
continue
|
continue
|
||||||
var work_val = roll_def.get("work", null)
|
var work_val = roll_def.get("work", null)
|
||||||
if typeof(work_val) != TYPE_INT and typeof(work_val) != TYPE_FLOAT:
|
if typeof(work_val) != TYPE_INT and typeof(work_val) != TYPE_FLOAT:
|
||||||
push_error("RecipeManager: rolling recipe '%s' missing a valid 'work' field" % rolled_id)
|
SweetLogger.error("Rolling recipe '{0}' missing a valid 'work' field", [rolled_id])
|
||||||
continue
|
continue
|
||||||
# store rolled item -> { ingredient: StringName, work: float }
|
# store rolled item -> { ingredient: StringName, work: float }
|
||||||
_rolling_map[StringName(rolled_id)] = {"ingredient": StringName(str(ingredient)), "work": float(work_val)}
|
_rolling_map[StringName(rolled_id)] = {"ingredient": StringName(str(ingredient)), "work": float(work_val)}
|
||||||
@@ -343,13 +343,13 @@ static func _build_augmenting_map() -> void:
|
|||||||
for target_id in augmenting.keys():
|
for target_id in augmenting.keys():
|
||||||
var augment_def = augmenting[target_id]
|
var augment_def = augmenting[target_id]
|
||||||
if typeof(augment_def) != TYPE_DICTIONARY:
|
if typeof(augment_def) != TYPE_DICTIONARY:
|
||||||
push_error("RecipeManager: augmenting recipe for '%s' must be a dictionary" % target_id)
|
SweetLogger.error("Augmenting recipe for '{0}' must be a dictionary", [target_id])
|
||||||
continue
|
continue
|
||||||
var map: Dictionary = {}
|
var map: Dictionary = {}
|
||||||
for attr_key in augment_def.keys():
|
for attr_key in augment_def.keys():
|
||||||
var ingredient = augment_def[attr_key]
|
var ingredient = augment_def[attr_key]
|
||||||
if typeof(ingredient) != TYPE_STRING or str(ingredient).is_empty():
|
if typeof(ingredient) != TYPE_STRING or str(ingredient).is_empty():
|
||||||
push_error("RecipeManager: augmenting recipe '%s' has invalid ingredient for '%s'" % [target_id, attr_key])
|
SweetLogger.error("Augmenting recipe '{0}' has invalid ingredient for '{1}'", [target_id, attr_key])
|
||||||
continue
|
continue
|
||||||
# store ingredient -> attribute_key (e.g. sliced_tomato -> has_tomato)
|
# store ingredient -> attribute_key (e.g. sliced_tomato -> has_tomato)
|
||||||
map[StringName(str(ingredient))] = StringName(str(attr_key))
|
map[StringName(str(ingredient))] = StringName(str(attr_key))
|
||||||
|
|||||||
+24
-3
@@ -25,15 +25,15 @@ static func find_first_child_of_type(node: Node, type: Variant) -> Node:
|
|||||||
# Returns true if decendant is a decendant node of root, false otherwise. Returns false if either node is null.
|
# Returns true if decendant is a decendant node of root, false otherwise. Returns false if either node is null.
|
||||||
static func is_node_decendant_of(decendant: Node, root: Node) -> bool:
|
static func is_node_decendant_of(decendant: Node, root: Node) -> bool:
|
||||||
if not decendant or not root:
|
if not decendant or not root:
|
||||||
SweetLogger.debug("is_node_decendant_of: decendant or root is null")
|
SweetLogger.debug("Decendant or root is null")
|
||||||
return false
|
return false
|
||||||
var current: Node = decendant
|
var current: Node = decendant
|
||||||
while current:
|
while current:
|
||||||
if current == root:
|
if current == root:
|
||||||
SweetLogger.debug("is_node_decendant_of: decendant {0} is a descendant of root {1}", [decendant.name, root.name])
|
SweetLogger.debug("Decendant {0} is a descendant of root {1}", [decendant.name, root.name])
|
||||||
return true
|
return true
|
||||||
current = current.get_parent()
|
current = current.get_parent()
|
||||||
SweetLogger.debug("is_node_decendant_of: decendant {0} is NOT a descendant of root {1}", [decendant.name, root.name])
|
SweetLogger.debug("Decendant {0} is NOT a descendant of root {1}", [decendant.name, root.name])
|
||||||
return false
|
return false
|
||||||
|
|
||||||
|
|
||||||
@@ -46,3 +46,24 @@ static func get_snapped_transform(node: Node3D) -> Transform3D:
|
|||||||
var target_yaw: float = snappedf(node.global_rotation_degrees.y, 90)
|
var target_yaw: float = snappedf(node.global_rotation_degrees.y, 90)
|
||||||
new_transform.basis = Basis(Vector3.UP, deg_to_rad(target_yaw))
|
new_transform.basis = Basis(Vector3.UP, deg_to_rad(target_yaw))
|
||||||
return new_transform
|
return new_transform
|
||||||
|
|
||||||
|
static func get_node_from_path(from: Node, node_path: NodePath) -> Node3D:
|
||||||
|
var item := from.get_node_or_null(node_path) as Node3D
|
||||||
|
if not item:
|
||||||
|
SweetLogger.warning("Could not resolve node from node_path: {0}, are the trees in sync?", [node_path])
|
||||||
|
return null
|
||||||
|
return item
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
static func play_sound(player: AudioStreamPlayer3D, stream: AudioStream, pitch_scale: float = 1):
|
||||||
|
if not player:
|
||||||
|
SweetLogger.warning("AudioStreamPlayer3D is null, can not play sound")
|
||||||
|
return
|
||||||
|
if not stream:
|
||||||
|
SweetLogger.warning("AudioStream is null, can not play sound")
|
||||||
|
return
|
||||||
|
player.pitch_scale = pitch_scale
|
||||||
|
player.stream = stream
|
||||||
|
player.play()
|
||||||
|
SweetLogger.debug("Play sound: {0} with pitch_scale: {1} on {2}", [stream.resource_path, pitch_scale, player.get_parent().name])
|
||||||
|
|||||||
@@ -53,6 +53,7 @@ station="Hobs, Counters ..."
|
|||||||
table="all nodes with table script"
|
table="all nodes with table script"
|
||||||
chopping_tool="A pickable body that chops"
|
chopping_tool="A pickable body that chops"
|
||||||
persistent_inventory="A station that keeps it's held items in build mode"
|
persistent_inventory="A station that keeps it's held items in build mode"
|
||||||
|
station_zone="The snap_zone node on stations should have this"
|
||||||
|
|
||||||
[input]
|
[input]
|
||||||
|
|
||||||
|
|||||||
@@ -1 +0,0 @@
|
|||||||
uid://be8o8m6xpp3kc
|
|
||||||
@@ -4,7 +4,7 @@
|
|||||||
[ext_resource type="PackedScene" uid="uid://j5s5wus7tuhb" path="res://prefabs/XROrigin.tscn" id="2_j7vd1"]
|
[ext_resource type="PackedScene" uid="uid://j5s5wus7tuhb" path="res://prefabs/XROrigin.tscn" id="2_j7vd1"]
|
||||||
[ext_resource type="Material" uid="uid://cmia50cfqxxo4" path="res://textures/dev_material_3d.tres" id="3_ssbaf"]
|
[ext_resource type="Material" uid="uid://cmia50cfqxxo4" path="res://textures/dev_material_3d.tres" id="3_ssbaf"]
|
||||||
[ext_resource type="Sky" uid="uid://c1abtpwhdm2d5" path="res://textures/sky/NightSkyHDRI009_16K.tres" id="4_081u3"]
|
[ext_resource type="Sky" uid="uid://c1abtpwhdm2d5" path="res://textures/sky/NightSkyHDRI009_16K.tres" id="4_081u3"]
|
||||||
[ext_resource type="PackedScene" uid="uid://j7caslh27nor" path="res://stations/Hob.tscn" id="5_t1fa7"]
|
[ext_resource type="PackedScene" uid="uid://j7caslh27nor" path="res://stations/Hob_old.tscn" id="5_t1fa7"]
|
||||||
[ext_resource type="PackedScene" uid="uid://dvrk268s7gkxh" path="res://stations/sink.tscn" id="6_6jhmh"]
|
[ext_resource type="PackedScene" uid="uid://dvrk268s7gkxh" path="res://stations/sink.tscn" id="6_6jhmh"]
|
||||||
[ext_resource type="PackedScene" uid="uid://bp3v1jl8pctro" path="res://Containers/plate.tscn" id="7_bowes"]
|
[ext_resource type="PackedScene" uid="uid://bp3v1jl8pctro" path="res://Containers/plate.tscn" id="7_bowes"]
|
||||||
[ext_resource type="PackedScene" uid="uid://cnjwtnhwh0i8q" path="res://stations/dirt_station.tscn" id="8_pvl84"]
|
[ext_resource type="PackedScene" uid="uid://cnjwtnhwh0i8q" path="res://stations/dirt_station.tscn" id="8_pvl84"]
|
||||||
|
|||||||
@@ -42,17 +42,17 @@ func _run() -> void:
|
|||||||
_clear_previous_results(logs_dir)
|
_clear_previous_results(logs_dir)
|
||||||
|
|
||||||
print_rich("[b]Running the multiplayer test suite...[/b]")
|
print_rich("[b]Running the multiplayer test suite...[/b]")
|
||||||
SweetLogger.info("the editor will be unresponsive until it finishes (~2 minutes)")
|
SweetLogger.info("The editor will be unresponsive until it finishes (~2 minutes)")
|
||||||
|
|
||||||
var server_pid := _launch(exe, project_dir, ["--server"], SERVER_SCENE)
|
var server_pid := _launch(exe, project_dir, ["--server"], SERVER_SCENE)
|
||||||
if server_pid <= 0:
|
if server_pid <= 0:
|
||||||
push_error("Could not start the server instance")
|
SweetLogger.error("Could not start the server instance")
|
||||||
return
|
return
|
||||||
# Give the host time to come up and open its port before the client dials in.
|
# Give the host time to come up and open its port before the client dials in.
|
||||||
OS.delay_msec(5000)
|
OS.delay_msec(5000)
|
||||||
var client_pid := _launch(exe, project_dir, ["--join", "127.0.0.1"], CLIENT_SCENE)
|
var client_pid := _launch(exe, project_dir, ["--join", "127.0.0.1"], CLIENT_SCENE)
|
||||||
if client_pid <= 0:
|
if client_pid <= 0:
|
||||||
push_error("Could not start the client instance")
|
SweetLogger.error("Could not start the client instance")
|
||||||
OS.kill(server_pid)
|
OS.kill(server_pid)
|
||||||
return
|
return
|
||||||
|
|
||||||
@@ -61,7 +61,7 @@ func _run() -> void:
|
|||||||
OS.delay_msec(500)
|
OS.delay_msec(500)
|
||||||
waited += 0.5
|
waited += 0.5
|
||||||
if OS.is_process_running(server_pid):
|
if OS.is_process_running(server_pid):
|
||||||
SweetLogger.warning("timed out after {0}s, stopping the instances", [TIMEOUT_SEC])
|
SweetLogger.warning("Timed out after {0}s, stopping the instances", [TIMEOUT_SEC])
|
||||||
OS.kill(server_pid)
|
OS.kill(server_pid)
|
||||||
if OS.is_process_running(client_pid):
|
if OS.is_process_running(client_pid):
|
||||||
OS.kill(client_pid)
|
OS.kill(client_pid)
|
||||||
@@ -105,7 +105,7 @@ func _clear_previous_results(logs_dir: String) -> void:
|
|||||||
func _print_report(logs_dir: String) -> void:
|
func _print_report(logs_dir: String) -> void:
|
||||||
var path := logs_dir.path_join("mptest_report.txt")
|
var path := logs_dir.path_join("mptest_report.txt")
|
||||||
if not FileAccess.file_exists(path):
|
if not FileAccess.file_exists(path):
|
||||||
push_error("No report at %s — the run did not finish. Check logs/mptest_server.log" % path)
|
SweetLogger.error("No report at {0}, the run did not finish, check logs/mptest_server.log", [path])
|
||||||
return
|
return
|
||||||
var text := FileAccess.get_file_as_string(path)
|
var text := FileAccess.get_file_as_string(path)
|
||||||
SweetLogger.info("")
|
SweetLogger.info("")
|
||||||
@@ -119,7 +119,7 @@ func _print_report(logs_dir: String) -> void:
|
|||||||
print_rich("[color=gray]%s[/color]" % line)
|
print_rich("[color=gray]%s[/color]" % line)
|
||||||
else:
|
else:
|
||||||
SweetLogger.info("{0}", [line])
|
SweetLogger.info("{0}", [line])
|
||||||
SweetLogger.info("report: {0}", [path])
|
SweetLogger.info("Report: {0}", [path])
|
||||||
|
|
||||||
|
|
||||||
func _build_gif(project_dir: String, logs_dir: String) -> void:
|
func _build_gif(project_dir: String, logs_dir: String) -> void:
|
||||||
@@ -129,9 +129,9 @@ func _build_gif(project_dir: String, logs_dir: String) -> void:
|
|||||||
"-ExecutionPolicy", "Bypass", "-File", script,
|
"-ExecutionPolicy", "Bypass", "-File", script,
|
||||||
], out, true)
|
], out, true)
|
||||||
for line in out:
|
for line in out:
|
||||||
print(line)
|
SweetLogger.debug("{0}", [line])
|
||||||
var gif := logs_dir.path_join("mptest_run.gif")
|
var gif := logs_dir.path_join("mptest_run.gif")
|
||||||
if code == 0 and FileAccess.file_exists(gif):
|
if code == 0 and FileAccess.file_exists(gif):
|
||||||
print_rich("[b]gif:[/b] %s" % gif)
|
print_rich("[b]gif:[/b] %s" % gif)
|
||||||
else:
|
else:
|
||||||
push_warning("GIF was not produced (is ffmpeg on PATH?). See the output above.")
|
SweetLogger.warning("GIF was not produced (is ffmpeg on PATH?), see the output above")
|
||||||
|
|||||||
@@ -3,8 +3,8 @@ extends Node
|
|||||||
|
|
||||||
# Called when the node enters the scene tree for the first time.
|
# Called when the node enters the scene tree for the first time.
|
||||||
func _ready() -> void:
|
func _ready() -> void:
|
||||||
SweetLogger.debug("stations: {0}", [get_stations()])
|
SweetLogger.debug("Stations: {0}", [get_stations()])
|
||||||
SweetLogger.debug("items: {0}", [get_items()])
|
SweetLogger.debug("Items: {0}", [get_items()])
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,40 @@
|
|||||||
|
class_name VrSpectatorCamera
|
||||||
|
extends Node
|
||||||
|
|
||||||
|
# Debug tool: on a non-VR client, follows a connected VR client's head so you can spectate it.
|
||||||
|
|
||||||
|
@export var players_path: NodePath = ^"../Players"
|
||||||
|
|
||||||
|
@onready var _players: Node = get_node_or_null(players_path)
|
||||||
|
var _camera: Camera3D
|
||||||
|
|
||||||
|
|
||||||
|
func _ready() -> void:
|
||||||
|
var xr_interface := XRServer.find_interface("OpenXR")
|
||||||
|
if xr_interface and xr_interface.is_initialized():
|
||||||
|
SweetLogger.warning("{0} disabled - this instance is the VR client", [name])
|
||||||
|
return
|
||||||
|
if not _players:
|
||||||
|
SweetLogger.warning("{0} could not resolve players_path {1}", [name, players_path])
|
||||||
|
return
|
||||||
|
_camera = Camera3D.new()
|
||||||
|
add_child(_camera)
|
||||||
|
_camera.make_current()
|
||||||
|
|
||||||
|
|
||||||
|
func _process(_delta: float) -> void:
|
||||||
|
if not _camera:
|
||||||
|
return
|
||||||
|
var head := _find_remote_head()
|
||||||
|
if head:
|
||||||
|
_camera.global_transform = head.global_transform
|
||||||
|
|
||||||
|
|
||||||
|
# First connected player that isn't this local peer
|
||||||
|
func _find_remote_head() -> Node3D:
|
||||||
|
var my_id := multiplayer.get_unique_id()
|
||||||
|
for player in _players.get_children():
|
||||||
|
if player.name == str(my_id):
|
||||||
|
continue
|
||||||
|
return player.get_node_or_null("Head")
|
||||||
|
return null
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
uid://c4y0yigqv7355
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
[gd_scene format=3 uid="uid://3i1xb74cfsh5"]
|
||||||
|
|
||||||
|
[ext_resource type="Script" uid="uid://c4y0yigqv7355" path="res://test/vr_spectator_camera.gd" id="1_6xorv"]
|
||||||
|
|
||||||
|
[node name="VRSpectatorCamera" type="Node" unique_id=310823561]
|
||||||
|
script = ExtResource("1_6xorv")
|
||||||
Reference in New Issue
Block a user