diff --git a/Characters/Player/Player.gd b/Characters/Player/Player.gd index d7b0e0e..e8c8041 100644 --- a/Characters/Player/Player.gd +++ b/Characters/Player/Player.gd @@ -37,9 +37,10 @@ var _prev_look var _inventory: Control # public properties -#var IsSuspicios # not needed > Meldewesen handles themselves -var IsHunted # player is beeing flagged if one Meldewesen sees an illegal action - +#var IsSuspicios # not needed > Meldewesen handles themselves +var IsHunted # player is beeing flagged if one Meldewesen sees an illegal action +var IsOutside = true # active while player is not in factory +var IsInFactory = false # only active in factory scene func is_in_illegalzone (): return _illegal_areas > 0 @@ -204,6 +205,19 @@ func _on_area_entered (area: Area): elif area.is_in_group("Workwork"): Logger.info("entering work area!") _work_areas += 1 + elif area.is_in_group("FactoryEntry"): + Logger.info("entering factory") + IsInFactory = true + IsOutside = false + # TODO: move not change_scene! + get_tree().change_scene("res://Level/InFactory.tscn") + # TODO: other entries + elif area.is_in_group("OutsideEntry"): + Logger.info("leaving factory") + IsInFactory = false + IsOutside = true + # TODO: move not change_scene! + get_tree().change_scene("res://Level/World.tscn") func _on_area_exited (area: Area): @@ -221,7 +235,7 @@ func _on_area_exited (area: Area): func _on_respawn (): Logger.info("respawning") # fade to black and restart scene - _inventory.hide() + _inventory.hide() # disable hud for the time of respawn animation _animationFadeOut.play("FadeOut") yield(_animationFadeOut, "animation_finished") _animationFadeOut.seek(0, true) @@ -235,4 +249,4 @@ func _on_respawn (): Logger.info("reload scene") get_tree().reload_current_scene() - _inventory.show() + _inventory.show() # enable hud again diff --git a/Level/Buildings/Factory.tscn b/Level/Buildings/Factory.tscn index 907a411..8ed7757 100644 --- a/Level/Buildings/Factory.tscn +++ b/Level/Buildings/Factory.tscn @@ -1,18 +1,28 @@ -[gd_scene load_steps=2 format=2] +[gd_scene load_steps=4 format=2] + +[ext_resource path="res://Level/Interactables/Door/Door.tscn" type="PackedScene" id=1] [sub_resource type="CylinderMesh" id=1] top_radius = 20.0 bottom_radius = 35.0 height = 100.0 +[sub_resource type="BoxShape" id=2] + [node name="Factory" type="Spatial"] transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -185, 0, -191 ) [node name="MeshInstance" type="MeshInstance" parent="."] -transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 50, 0 ) +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -0.00691223, 50, 0.124863 ) mesh = SubResource( 1 ) material/0 = null +[node name="DoorLeft" parent="MeshInstance" instance=ExtResource( 1 )] +transform = Transform( -2.18557e-007, 0, 1, 0, 5, 0, -5, 0, -4.37114e-008, 35.308, -42, 8.857 ) + +[node name="DoorRight" parent="MeshInstance" instance=ExtResource( 1 )] +transform = Transform( -2.18557e-007, 0, -1, 0, 5, 0, 5, 0, -4.37114e-008, 35.37, -42, -11.118 ) + [node name="MeshInstance2" type="MeshInstance" parent="."] transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 30, 50, 60 ) mesh = SubResource( 1 ) @@ -22,3 +32,12 @@ material/0 = null transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 30, 50, -60 ) mesh = SubResource( 1 ) material/0 = null + +[node name="FactoryEntry" type="Area" parent="." groups=[ +"FactoryEntry", +]] +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 50.9938, 0, 0 ) + +[node name="CollisionShape" type="CollisionShape" parent="FactoryEntry"] +transform = Transform( 15.5705, 0, 0, 0, 1, 0, 0, 0, 25.0132, -18.0871, 0, 0 ) +shape = SubResource( 2 ) diff --git a/Level/Buildings/PlayerHouse.tscn b/Level/Buildings/PlayerHouse.tscn index 10383ee..931088d 100644 --- a/Level/Buildings/PlayerHouse.tscn +++ b/Level/Buildings/PlayerHouse.tscn @@ -18,14 +18,17 @@ mid_height = 2.0 [node name="CSGMesh" type="CSGMesh" parent="."] transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 6, 0 ) +layers = 3 mesh = SubResource( 2 ) [node name="CSGMesh2" type="CSGMesh" parent="CSGMesh"] transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0.00447488, -1, -0.00174999 ) +layers = 3 operation = 2 mesh = SubResource( 3 ) [node name="CSGMesh3" type="CSGMesh" parent="CSGMesh"] transform = Transform( 1, 0, 0, 0, -0.0161161, -0.99987, 0, 0.99987, -0.0161161, 0, -4.59426, -5.98218 ) +layers = 3 operation = 2 mesh = SubResource( 4 ) diff --git a/Level/InFactory.tscn b/Level/InFactory.tscn index 51d423a..eb56565 100644 --- a/Level/InFactory.tscn +++ b/Level/InFactory.tscn @@ -1,77 +1,47 @@ [gd_scene load_steps=7 format=2] -[ext_resource path="res://Level/Interactables/Door/Door.tscn" type="PackedScene" id=1] -[ext_resource path="res://Characters/Player/Player.tscn" type="PackedScene" id=2] +[ext_resource path="res://Level/Buildings/DoubleDoorWall.tscn" type="PackedScene" id=1] +[ext_resource path="res://Level/Buildings/DoorWall.tscn" type="PackedScene" id=2] +[ext_resource path="res://Characters/Player/Player.tscn" type="PackedScene" id=3] -[sub_resource type="CubeMesh" id=4] +[sub_resource type="BoxShape" id=1] -[sub_resource type="BoxShape" id=5] +[sub_resource type="CubeMesh" id=2] -[sub_resource type="BoxShape" id=6] - -[sub_resource type="CubeMesh" id=7] +[sub_resource type="BoxShape" id=3] [node name="InFactory" type="Spatial"] [node name="Architecture" type="Spatial" parent="."] [node name="EntryHall" type="Spatial" parent="Architecture"] -transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 2 ) +editor/display_folded = true -[node name="WallPart1" type="StaticBody" parent="Architecture/EntryHall"] -transform = Transform( 2, 0, 0, 0, 1.5, 0, 0, 0, 0.2, -4, 1.5, 0 ) -collision_layer = 3 +[node name="DoubleDoorWall" parent="Architecture/EntryHall" instance=ExtResource( 1 )] -[node name="MeshInstance" type="MeshInstance" parent="Architecture/EntryHall/WallPart1"] -layers = 3 -mesh = SubResource( 4 ) -material/0 = null - -[node name="CollisionShape" type="CollisionShape" parent="Architecture/EntryHall/WallPart1"] -shape = SubResource( 5 ) - -[node name="WallPart2" type="StaticBody" parent="Architecture/EntryHall"] -transform = Transform( 2, 0, 0, 0, 1.5, 0, 0, 0, 0.2, 4, 1.5, 0 ) -collision_layer = 3 - -[node name="MeshInstance" type="MeshInstance" parent="Architecture/EntryHall/WallPart2"] -layers = 3 -mesh = SubResource( 4 ) -material/0 = null - -[node name="CollisionShape" type="CollisionShape" parent="Architecture/EntryHall/WallPart2"] -shape = SubResource( 5 ) - -[node name="WallPart3" type="StaticBody" parent="Architecture/EntryHall"] -transform = Transform( 6, 0, 0, 0, 1, 0, 0, 0, 0.2, 0, 4, 0 ) -collision_layer = 3 - -[node name="MeshInstance" type="MeshInstance" parent="Architecture/EntryHall/WallPart3"] -layers = 3 -mesh = SubResource( 4 ) -material/0 = null - -[node name="CollisionShape" type="CollisionShape" parent="Architecture/EntryHall/WallPart3"] -shape = SubResource( 5 ) - -[node name="Door" parent="Architecture/EntryHall" instance=ExtResource( 1 )] -transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -2, 1.5, 0 ) - -[node name="Door2" parent="Architecture/EntryHall" instance=ExtResource( 1 )] -transform = Transform( -1, 0, -8.74228e-008, 0, 1, 0, 8.74228e-008, 0, -1, 2, 1.5, 0 ) -invert_open = true +[node name="DoorWall" parent="Architecture/EntryHall" instance=ExtResource( 2 )] +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -12, 0, 2 ) [node name="Floor" type="StaticBody" parent="Architecture"] +editor/display_folded = true transform = Transform( 100, 0, 0, 0, 1, 0, 0, 0, 100, 0, -1, 0 ) collision_layer = 3 [node name="CollisionShape" type="CollisionShape" parent="Architecture/Floor"] -shape = SubResource( 6 ) +shape = SubResource( 1 ) [node name="MeshInstance" type="MeshInstance" parent="Architecture/Floor"] layers = 3 -mesh = SubResource( 7 ) +mesh = SubResource( 2 ) material/0 = null -[node name="Player" parent="." instance=ExtResource( 2 )] +[node name="OutsideEntry" type="Area" parent="Architecture" groups=[ +"OutsideEntry", +]] + +[node name="CollisionShape" type="CollisionShape" parent="Architecture/OutsideEntry"] +transform = Transform( 6.4742, 0, 0, 0, 1, 0, 0, 0, 4.02915, -24.461, 0, 2.21844 ) +shape = SubResource( 3 ) + +[node name="Player" parent="." instance=ExtResource( 3 )] transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 4, 0 ) diff --git a/Level/Labyrinth.tscn b/Level/Labyrinth.tscn index bc2ef63..39c14d5 100644 --- a/Level/Labyrinth.tscn +++ b/Level/Labyrinth.tscn @@ -59,28 +59,28 @@ transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -105, 0, 30 ) transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -75, 0, -30 ) [node name="LabyrinthCorridorTrue5" parent="." instance=ExtResource( 1 )] -transform = Transform( -4.37114e-08, 0, 1, 0, 1, 0, -1, 0, -4.37114e-08, 0, 0, 15 ) +transform = Transform( -4.37114e-008, 0, 1, 0, 1, 0, -1, 0, -4.37114e-008, 0, 0, 15 ) [node name="LabyrinthCorridorTrue6" parent="." instance=ExtResource( 1 )] -transform = Transform( -4.37114e-08, 0, 1, 0, 1, 0, -1, 0, -4.37114e-08, -30, 0, -15 ) +transform = Transform( -4.37114e-008, 0, 1, 0, 1, 0, -1, 0, -4.37114e-008, -30, 0, -15 ) [node name="LabyrinthCorridorTrue17" parent="." instance=ExtResource( 1 )] -transform = Transform( -4.37114e-08, 0, 1, 0, 1, 0, -1, 0, -4.37114e-08, -90, 0, -15 ) +transform = Transform( -4.37114e-008, 0, 1, 0, 1, 0, -1, 0, -4.37114e-008, -90, 0, -15 ) [node name="LabyrinthCorridorTrue18" parent="." instance=ExtResource( 1 )] -transform = Transform( -4.37114e-08, 0, 1, 0, 1, 0, -1, 0, -4.37114e-08, -90, 0, 15 ) +transform = Transform( -4.37114e-008, 0, 1, 0, 1, 0, -1, 0, -4.37114e-008, -90, 0, 15 ) [node name="LabyrinthCorridorTrue8" parent="." instance=ExtResource( 1 )] -transform = Transform( -4.37114e-08, 0, 1, 0, 1, 0, -1, 0, -4.37114e-08, -30, 0, -45 ) +transform = Transform( -4.37114e-008, 0, 1, 0, 1, 0, -1, 0, -4.37114e-008, -30, 0, -45 ) [node name="LabyrinthCorridorTrue12" parent="." instance=ExtResource( 1 )] -transform = Transform( -4.37114e-08, 0, 1, 0, 1, 0, -1, 0, -4.37114e-08, -60, 0, -45 ) +transform = Transform( -4.37114e-008, 0, 1, 0, 1, 0, -1, 0, -4.37114e-008, -60, 0, -45 ) [node name="LabyrinthCorridorTrue10" parent="." instance=ExtResource( 1 )] -transform = Transform( -4.37114e-08, 0, 1, 0, 1, 0, -1, 0, -4.37114e-08, 0, 0, -45 ) +transform = Transform( -4.37114e-008, 0, 1, 0, 1, 0, -1, 0, -4.37114e-008, 0, 0, -45 ) [node name="LabyrinthCorridorTrue7" parent="." instance=ExtResource( 1 )] -transform = Transform( -4.37114e-08, 0, 1, 0, 1, 0, -1, 0, -4.37114e-08, -30, 0, 15 ) +transform = Transform( -4.37114e-008, 0, 1, 0, 1, 0, -1, 0, -4.37114e-008, -30, 0, 15 ) [node name="LabyrinthCrossing" parent="." instance=ExtResource( 2 )] @@ -162,16 +162,16 @@ transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -75, 0, -60 ) transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -105, 0, -60 ) [node name="LabyrinthCorridorMasked2" parent="." instance=ExtResource( 3 )] -transform = Transform( -4.37114e-08, 0, -1, 0, 1, 0, 1, 0, -4.37114e-08, -60, 0, 15 ) +transform = Transform( -4.37114e-008, 0, -1, 0, 1, 0, 1, 0, -4.37114e-008, -60, 0, 15 ) [node name="LabyrinthCorridorMasked3" parent="." instance=ExtResource( 3 )] -transform = Transform( -4.37114e-08, 0, -1, 0, 1, 0, 1, 0, -4.37114e-08, -60, 0, -15 ) +transform = Transform( -4.37114e-008, 0, -1, 0, 1, 0, 1, 0, -4.37114e-008, -60, 0, -15 ) [node name="LabyrinthCorridorMasked13" parent="." instance=ExtResource( 3 )] -transform = Transform( -4.37114e-08, 0, -1, 0, 1, 0, 1, 0, -4.37114e-08, -90, 0, -45 ) +transform = Transform( -4.37114e-008, 0, -1, 0, 1, 0, 1, 0, -4.37114e-008, -90, 0, -45 ) [node name="LabyrinthCorridorMasked8" parent="." instance=ExtResource( 3 )] -transform = Transform( -4.37114e-08, 0, -1, 0, 1, 0, 1, 0, -4.37114e-08, 0, 0, -15 ) +transform = Transform( -4.37114e-008, 0, -1, 0, 1, 0, 1, 0, -4.37114e-008, 0, 0, -15 ) [node name="Player" parent="." instance=ExtResource( 4 )] transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 30, 0, 0 ) @@ -179,7 +179,7 @@ transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 30, 0, 0 ) [node name="OuterWalls" type="Spatial" parent="."] [node name="MeshInstance" type="MeshInstance" parent="OuterWalls"] -transform = Transform( -1, -8.74228e-08, 3.82137e-15, 0, -4.37114e-08, -1, 8.74228e-08, -1, 4.37114e-08, -50, 5, 35 ) +transform = Transform( -1, -8.74228e-008, 3.82137e-015, 0, -4.37114e-008, -1, 8.74228e-008, -1, 4.37114e-008, -50, 5, 35 ) layers = 3 mesh = SubResource( 1 ) material/0 = null @@ -190,7 +190,7 @@ material/0 = null shape = SubResource( 2 ) [node name="MeshInstance2" type="MeshInstance" parent="OuterWalls"] -transform = Transform( 1, 1.74846e-07, -7.64274e-15, 0, -4.37114e-08, -1, -1.74846e-07, 1, -4.37114e-08, -50, 5, -65 ) +transform = Transform( 1, 1.74846e-007, -7.64274e-015, 0, -4.37114e-008, -1, -1.74846e-007, 1, -4.37114e-008, -50, 5, -65 ) layers = 3 mesh = SubResource( 1 ) material/0 = null @@ -201,7 +201,7 @@ material/0 = null shape = SubResource( 3 ) [node name="MeshInstance3" type="MeshInstance" parent="OuterWalls"] -transform = Transform( 1.31134e-07, -1, 4.37114e-08, 0, -4.37114e-08, -1, 1, 1.31134e-07, -5.73206e-15, 4.99999, 5, -70 ) +transform = Transform( 1.31134e-007, -1, 4.37114e-008, 0, -4.37114e-008, -1, 1, 1.31134e-007, -5.73206e-015, 4.99999, 5, -70 ) layers = 3 mesh = SubResource( 1 ) material/0 = null @@ -212,7 +212,7 @@ material/0 = null shape = SubResource( 4 ) [node name="MeshInstance4" type="MeshInstance" parent="OuterWalls"] -transform = Transform( 1.31134e-07, -1, 4.37114e-08, 0, -4.37114e-08, -1, 1, 1.31134e-07, -5.73206e-15, 4.99999, 5, 70 ) +transform = Transform( 1.31134e-007, -1, 4.37114e-008, 0, -4.37114e-008, -1, 1, 1.31134e-007, -5.73206e-015, 4.99999, 5, 70 ) layers = 3 mesh = SubResource( 1 ) material/0 = null @@ -223,7 +223,7 @@ material/0 = null shape = SubResource( 5 ) [node name="MeshInstance5" type="MeshInstance" parent="OuterWalls"] -transform = Transform( 1.31134e-07, -1, 4.37114e-08, 0, -4.37114e-08, -1, 1, 1.31134e-07, -5.73206e-15, 35, 5, -7.62939e-06 ) +transform = Transform( 1.31134e-007, -1, 4.37114e-008, 0, -4.37114e-008, -1, 1, 1.31134e-007, -5.73206e-015, 35, 5, -7.62939e-006 ) layers = 3 mesh = SubResource( 1 ) material/0 = null @@ -234,7 +234,7 @@ material/0 = null shape = SubResource( 6 ) [node name="MeshInstance8" type="MeshInstance" parent="OuterWalls"] -transform = Transform( -7.98311e-08, 1, -4.37114e-08, 0, -4.37114e-08, -1, -0.49, -1.62921e-07, 7.12149e-15, -95, 5, -15 ) +transform = Transform( -7.98311e-008, 1, -4.37114e-008, 0, -4.37114e-008, -1, -0.49, -1.62921e-007, 7.12149e-015, -95, 5, -15 ) layers = 3 mesh = SubResource( 1 ) material/0 = null @@ -245,7 +245,7 @@ material/0 = null shape = SubResource( 6 ) [node name="MeshInstance6" type="MeshInstance" parent="OuterWalls"] -transform = Transform( -1, -8.74228e-08, 3.82137e-15, 0, -4.37114e-08, -1, 8.74228e-08, -1, 4.37114e-08, 75, 5, 4.99999 ) +transform = Transform( -1, -8.74228e-008, 3.82137e-015, 0, -4.37114e-008, -1, 8.74228e-008, -1, 4.37114e-008, 75, 5, 4.99999 ) layers = 3 mesh = SubResource( 1 ) material/0 = null @@ -256,7 +256,7 @@ material/0 = null shape = SubResource( 7 ) [node name="MeshInstance7" type="MeshInstance" parent="OuterWalls"] -transform = Transform( 1, 1.74846e-07, -7.64274e-15, 0, -4.37114e-08, -1, -1.74846e-07, 1, -4.37114e-08, 75, 5, -5.00001 ) +transform = Transform( 1, 1.74846e-007, -7.64274e-015, 0, -4.37114e-008, -1, -1.74846e-007, 1, -4.37114e-008, 75, 5, -5.00001 ) layers = 3 mesh = SubResource( 1 ) material/0 = null