OverviewFilesCommitsIssuesDocsReleasesPeers

hyper-tps_demo commits / 9cd2869

fixed teleporters added teleport sound
9cd286977039a08712320283ad1b9e4ced0a89e0
by Dresk Spidflisk <dreskspidflisk@gmail.com> · 2022-04-14T00:54:48.000Z

Changed files (13) +119 -75

assets/sounds/player/teleport_1.mp3 +0 -0
(no content changes — binary or rename)
assets/sounds/player/teleport_1.mp3.import +15 -0
……@@ -0,0 +1,15 @@
1[remap]
2
3importer="mp3"
4type="AudioStreamMP3"
5path="res://.import/teleport_1.mp3-61298d92ecf3ab492b62616d5364faec.mp3str"
6
7[deps]
8
9source_file="res://assets/sounds/player/teleport_1.mp3"
10dest_files=[ "res://.import/teleport_1.mp3-61298d92ecf3ab492b62616d5364faec.mp3str" ]
11
12[params]
13
14loop=false
15loop_offset=0
game/map_decorations/teleport.scn +0 -0
(no content changes — binary or rename)
game/map_decorations/teleporter.gd +6 -12
……@@ -3,7 +3,6 @@ extends Spatial
33export var teleportation_destination : String = "map_test"
44
55onready var mapsNode : Node = get_tree().get_current_scene().get_node("Maps")
6onready var currentMapNode : Node = get_tree().get_current_scene().get_node("Maps").get_child(0)
76
87
98# Declare member variables here. Examples:
……@@ -20,23 +19,18 @@ func _on_Teleporter_gameplay_entered():
2019
2120
2221func tryMapChange(mapChangeName : String, sendGossip : bool, playerNode):
23 var mapCurrentName = currentMapNode.name
22 var mapCurrentName = playerNode.currentMap.map_name
2423 var mapNode = null
2524 if(mapCurrentName != teleportation_destination):
26 currentMapNode.queue_free()
2725 if(mapChangeName == "map_test"):
28 print("")
29 mapNode = get_tree().get_current_scene().map_test
26 mapNode = mapsNode.find_node("map_test", true, false)
3027 elif(mapChangeName == "map_cyber"):
31 print("")
32 mapNode = get_tree().get_current_scene().map_cyber
28 mapNode = mapsNode.find_node("map_cyber", true, false)
3329 elif(mapChangeName == "map_cyber1"):
34 print("")
35 mapNode = get_tree().get_current_scene().map_cyber1
36 var newMap = mapNode.instance()
37 mapsNode.add_child(newMap)
30 mapNode = mapsNode.find_node("map_cyber1", true, false)
3831 # Find a Respawn Point
39 playerNode.currentSpawnLocation = playerNode.getSpawnLocation()
32 playerNode.currentSpawnLocation = playerNode.getSpawnLocationForMapName(mapChangeName)
33 playerNode.currentMap = mapNode
4034 playerNode.playerWantsToRespawn = true
4135
4236 if(sendGossip):
game/maps/map_core.gd +10 -1
……@@ -2,6 +2,8 @@ extends Spatial
22
33onready var playerSpawnNodes : Node = find_node("PlayerSpawnNodes")
44
5export var map_name : String = ""
6
57func _ready():
68 randomize()
79 addGrapplingHookCollisionMaskToMap()
……@@ -12,7 +14,7 @@ func _process(_delta):
1214func getSpawnLocation() -> Vector3:
1315 var childCount : int = playerSpawnNodes.get_child_count()
1416 var spawnNode : Spatial = playerSpawnNodes.get_child( randi() % childCount )
15 return spawnNode.translation
17 return spawnNode.global_transform.origin
1618
1719func addGrapplingHookCollisionMaskToMap():
1820 var _name = self.name
……@@ -31,3 +33,10 @@ func checkAndSetChildrenGrapplingHookMask(var _Node, indentLevel : int):
3133 var childCount = _Node.get_child_count()
3234 for i in range(childCount):
3335 checkAndSetChildrenGrapplingHookMask(_Node.get_child(i), indentLevel + 1)
36
37
38func _on_Area_body_entered(body, map_name):
39 if(body is KinematicBody):
40 var mapNode = get_tree().get_current_scene().find_node(map_name, true, false)
41 body.currentMap = mapNode
42
game/maps/map_test/map_test.tscn +3 -0
……@@ -46,6 +46,7 @@ glow_hdr_scale = 1.16
4646
4747[node name="map_test" type="Spatial"]
4848script = ExtResource( 2 )
49map_name = "map_test"
4950
5051[node name="asset_map_test" parent="." instance=ExtResource( 1 )]
5152
……@@ -88,3 +89,5 @@ transform = Transform( 0.5, 0, 0, 0, 0.5, 0, 0, 0, 0.5, -9.88113, 8.96284, -17.1
8889[node name="CollisionShape" type="CollisionShape" parent="Area"]
8990transform = Transform( 30, 0, 0, 0, 30, 0, 0, 0, 80, 0, 0, -23.7039 )
9091shape = SubResource( 35 )
92
93[connection signal="body_entered" from="Area" to="." method="_on_Area_body_entered" binds= [ "map_test" ]]
game/player/player_core.gd +13 -11
……@@ -37,7 +37,7 @@ onready var meshCollisionShape : CollisionShape = $CollisionShape
3737onready var grappleHookCast : RayCast = $CameraHead/CameraPivot/GrappleHookCast
3838
3939onready var grappleVisualPoint_1 = $GrapplingHook/GrappleVisualPoint_1
40onready var grappleVisualPoint_2 = $GrapplingHook/GrappleVisualPoint_2
40# onready var grappleVisualPoint_2 = $GrapplingHook/GrappleVisualPoint_2
4141onready var grappleVisualPoint = grappleVisualPoint_1
4242
4343onready var grappleLineHelper : Spatial = $Model/GrappleLineHelper
……@@ -57,7 +57,7 @@ var playerWantsToReleaseGrapplingHook : bool = false
5757#onready var hyperdebugui_gateway_startstop_button : Button = $HyperGodotDebugUI/HypercoreDebugPanel/HypercoreDebugContainer/GatewayStartStopButton
5858#onready var hyperdebugui_gossipid_list : ItemList = get_tree().get_current_scene().get_node("HyperGodot").get_node("HyperGateway")
5959
60var currentMap = null
60onready var currentMap = get_tree().get_current_scene().get_node("Maps").get_child(0)
6161var originalOrigin : Vector3 = Vector3.ZERO
6262var currentSpawnLocation : Vector3 = Vector3.ZERO
6363
……@@ -81,14 +81,11 @@ var collisions : Dictionary = {}
8181var Particles_Land = preload("res://game/player/particles.tscn")
8282
8383func _ready():
84 # Get Current Map
85 currentMap = get_tree().get_current_scene().get_node("Maps").get_child(0)
86
8784 # Backup Origin
8885 originalOrigin = self.translation
8986
9087 # Spawn into Map
91 currentSpawnLocation = getSpawnLocation()
88 currentSpawnLocation = getSpawnLocationForMapName(currentMap.map_name)
9289 playerWantsToRespawn = true
9390
9491 # Get HyperGossip
……@@ -102,9 +99,13 @@ func snapShotUpdate(_translation : Vector3, _meshDirection : Vector3, _lookingDi
10299func directionUpdate(_direction : Vector3):
103100 self.currentDirection = _direction
104101
105func getSpawnLocation() -> Vector3:
106 return get_tree().get_current_scene().getSpawnLocation()
107
102func getSpawnLocationForMapName(mapName : String) -> Vector3:
103 # Get Map Node
104 var mapNode = get_tree().get_current_scene().get_node("Maps").find_node(mapName, true, false)
105 if(mapNode == null):
106 return get_tree().get_current_scene().get_node("Maps").find_node("map_test", true, false).getSpawnLocation()
107 else:
108 return mapNode.getSpawnLocation()
108109
109110func _process(_delta):
110111 if(currentDirection != Vector3.ZERO):
……@@ -289,7 +290,8 @@ func respawnPlayer():
289290 grapplingHook_IsHooked = false
290291 playerWantsToShootGrapplingHook = false
291292 playerWantsToReleaseGrapplingHook = true
292 global_transform.origin = get_tree().get_current_scene().getSpawnLocation()
293 $Model/Sound_Teleport_1.play()
294 global_transform.origin = currentSpawnLocation
293295 # translation = ( get_tree().get_current_scene().getSpawnLocation() )# ) = currentSpawnLocation
294296
295297func playerCanJump() -> bool:
……@@ -336,7 +338,7 @@ func _on_Input_player_move(direction : Vector3):
336338
337339func _on_Input_player_restore_origin() -> void:
338340 playerWantsToRespawn = true
339 var spawnLocation : Vector3 = getSpawnLocation()
341 var spawnLocation : Vector3 = getSpawnLocationForMapName(currentMap.map_name)
340342 currentSpawnLocation = spawnLocation
341343
342344 var data : Dictionary = {
game/player/player_core.tscn +7 -1
……@@ -1,4 +1,4 @@
1[gd_scene load_steps=35 format=2]
1[gd_scene load_steps=36 format=2]
22
33[ext_resource path="res://assets/models/tumble/model_tumble.tscn" type="PackedScene" id=1]
44[ext_resource path="res://assets/models/tumble/tumble/sprint-loop.tres" type="Animation" id=2]
……@@ -32,6 +32,7 @@
3232[ext_resource path="res://assets/sounds/player/release_grapplinghook.wav" type="AudioStream" id=30]
3333[ext_resource path="res://assets/sounds/player/generic_robot_land.wav" type="AudioStream" id=31]
3434[ext_resource path="res://assets/sounds/player/fire_grapplinghook1.mp3" type="AudioStream" id=32]
35[ext_resource path="res://assets/sounds/player/teleport_1.mp3" type="AudioStream" id=33]
3536[ext_resource path="res://game/player/grappling_hook/gh_visual_line_1.tscn" type="PackedScene" id=34]
3637
3738[sub_resource type="CylinderShape" id=1]
……@@ -81,6 +82,11 @@ attenuation_filter_cutoff_hz = 20500.0
8182stream = ExtResource( 30 )
8283attenuation_filter_cutoff_hz = 20500.0
8384
85[node name="Sound_Teleport_1" type="AudioStreamPlayer3D" parent="Model"]
86transform = Transform( 1.53846, 0, 0, 0, 1.53846, 0, 0, 0, 1.53846, 0, 0, 0 )
87stream = ExtResource( 33 )
88attenuation_filter_cutoff_hz = 20500.0
89
8490[node name="GrappleLineHelper" type="Spatial" parent="Model"]
8591transform = Transform( 1.53846, 0, 0, 0, 1.53846, 0, 0, 0, 1.53846, 0, 0.753, 0 )
8692
game/player/player_core_local_debugui.gd +5 -3
……@@ -1,7 +1,8 @@
11extends Control
22
3onready var playerNode = get_node("../../../Players/PlayerLocal")
4onready var currentMapNode : Node = get_tree().get_current_scene().get_node("CurrentMap")
3onready var playerNode = get_tree().get_current_scene().get_node("Players").get_node("PlayerLocal")
4
5onready var currentmapValue : Label = $Panel/MarginContainer/GridContainer/Current_Map_Value
56onready var inputValue : Label = $Panel/MarginContainer/GridContainer/Input_Value
67onready var velocityValue : Label = $Panel/MarginContainer/GridContainer/Velocity_Value
78onready var speedValue : Label = $Panel/MarginContainer/GridContainer/Speed_Value
……@@ -26,6 +27,7 @@ func _ready():
2627 hyperGossip = get_tree().get_current_scene().get_node("HyperGodot").get_node("HyperGossip")
2728
2829func _process(_delta):
30 currentmapValue.text = String(playerNode.currentMap.map_name)
2931 inputValue.text = String(playerNode.currentDirection)
3032 velocityValue.text = String(playerNode.kinematicVelocity)
3133 speedValue.text = String(playerNode.currentSpeed)
……@@ -77,7 +79,7 @@ func tryMapChange(mapChangeName : String, sendGossip : bool):
7779 elif(mapChangeName == "map_cyber1"):
7880 mapNode = get_tree().get_current_scene().map_cyber1
7981 var newMap = mapNode.instance()
80 currentMapNode.add_child(newMap)
82 #currentMapNode.add_child(newMap)
8183 # Update Current Map
8284 playerNode.currentMap = get_tree().get_current_scene().get_node("CurrentMap").get_child(1)
8385 # Update Actual Map
game/player/player_core_local_debugui.tscn +47 -27
……@@ -16,7 +16,7 @@ script = ExtResource( 1 )
1616margin_left = 10.0
1717margin_top = 12.0
1818margin_right = 333.0
19margin_bottom = 92.0
19margin_bottom = 112.0
2020mouse_filter = 2
2121custom_styles/panel = SubResource( 1 )
2222
……@@ -32,88 +32,108 @@ __meta__ = {
3232
3333[node name="GridContainer" type="GridContainer" parent="Panel/MarginContainer"]
3434margin_right = 143.0
35margin_bottom = 68.0
35margin_bottom = 86.0
3636mouse_filter = 2
3737columns = 2
3838__meta__ = {
3939"_edit_use_anchors_": false
4040}
4141
42[node name="Input" type="Label" parent="Panel/MarginContainer/GridContainer"]
43margin_right = 63.0
42[node name="Current_Map" type="Label" parent="Panel/MarginContainer/GridContainer"]
43margin_right = 77.0
4444margin_bottom = 14.0
45text = "Input :"
46align = 2
45text = "Map Name :"
4746__meta__ = {
4847"_edit_use_anchors_": false
4948}
5049
51[node name="Input_Value" type="Label" parent="Panel/MarginContainer/GridContainer"]
52margin_left = 67.0
53margin_right = 67.0
50[node name="Current_Map_Value" type="Label" parent="Panel/MarginContainer/GridContainer"]
51margin_left = 81.0
52margin_right = 105.0
5453margin_bottom = 14.0
54text = "N/A"
5555__meta__ = {
5656"_edit_use_anchors_": false
5757}
5858
59[node name="Velocity" type="Label" parent="Panel/MarginContainer/GridContainer"]
59[node name="Input" type="Label" parent="Panel/MarginContainer/GridContainer"]
6060margin_top = 18.0
61margin_right = 63.0
61margin_right = 77.0
6262margin_bottom = 32.0
63text = "Velocity :"
63text = "Input :"
6464align = 2
6565__meta__ = {
6666"_edit_use_anchors_": false
6767}
6868
69[node name="Velocity_Value" type="Label" parent="Panel/MarginContainer/GridContainer"]
70margin_left = 67.0
69[node name="Input_Value" type="Label" parent="Panel/MarginContainer/GridContainer"]
70margin_left = 81.0
7171margin_top = 18.0
72margin_right = 67.0
72margin_right = 105.0
7373margin_bottom = 32.0
7474__meta__ = {
7575"_edit_use_anchors_": false
7676}
7777
78[node name="Speed" type="Label" parent="Panel/MarginContainer/GridContainer"]
78[node name="Velocity" type="Label" parent="Panel/MarginContainer/GridContainer"]
7979margin_top = 36.0
80margin_right = 63.0
80margin_right = 77.0
8181margin_bottom = 50.0
82text = "Speed :"
82text = "Velocity :"
8383align = 2
8484__meta__ = {
8585"_edit_use_anchors_": false
8686}
8787
88[node name="Speed_Value" type="Label" parent="Panel/MarginContainer/GridContainer"]
89margin_left = 67.0
88[node name="Velocity_Value" type="Label" parent="Panel/MarginContainer/GridContainer"]
89margin_left = 81.0
9090margin_top = 36.0
91margin_right = 67.0
91margin_right = 105.0
9292margin_bottom = 50.0
9393__meta__ = {
9494"_edit_use_anchors_": false
9595}
9696
97[node name="OnFloor" type="Label" parent="Panel/MarginContainer/GridContainer"]
97[node name="Speed" type="Label" parent="Panel/MarginContainer/GridContainer"]
9898margin_top = 54.0
99margin_right = 63.0
99margin_right = 77.0
100100margin_bottom = 68.0
101text = "On Floor :"
101text = "Speed :"
102102align = 2
103103__meta__ = {
104104"_edit_use_anchors_": false
105105}
106106
107[node name="OnFloor_Value" type="Label" parent="Panel/MarginContainer/GridContainer"]
108margin_left = 67.0
107[node name="Speed_Value" type="Label" parent="Panel/MarginContainer/GridContainer"]
108margin_left = 81.0
109109margin_top = 54.0
110margin_right = 67.0
110margin_right = 105.0
111111margin_bottom = 68.0
112112__meta__ = {
113113"_edit_use_anchors_": false
114114}
115115
116[node name="OnFloor" type="Label" parent="Panel/MarginContainer/GridContainer"]
117margin_top = 72.0
118margin_right = 77.0
119margin_bottom = 86.0
120text = "On Floor :"
121align = 2
122__meta__ = {
123"_edit_use_anchors_": false
124}
125
126[node name="OnFloor_Value" type="Label" parent="Panel/MarginContainer/GridContainer"]
127margin_left = 81.0
128margin_top = 72.0
129margin_right = 105.0
130margin_bottom = 86.0
131__meta__ = {
132"_edit_use_anchors_": false
133}
134
116135[node name="Panel2" type="Panel" parent="."]
136visible = false
117137margin_left = 10.0
118138margin_top = 127.0
119139margin_right = 333.0
game/player/player_local_core.tres +1 -1
……@@ -187,4 +187,4 @@ nodes/walk_scale/node = SubResource( 23 )
187187nodes/walk_scale/position = Vector2( -640, 360 )
188188nodes/wall_run/node = SubResource( 50 )
189189nodes/wall_run/position = Vector2( 720, -60 )
190node_connections = [ "output", 0, "wall_run", "TimeScale 3", 0, "strafe", "Blend2", 0, "Animation 8", "Blend2", 1, "Animation 9", "Blend2 2", 0, "Animation 11", "Blend2 2", 1, "Animation 10", "aim_transition", 0, "TimeScale 3", "aim_transition", 1, "iwr_blend", "air_blend", 0, "jump_scale", "air_blend", 1, "falling_scale", "air_blend", 2, "landing_scale", "air_transition", 0, "air_blend", "air_transition", 1, "aim_transition", "falling_scale", 0, "Animation 6", "iwr_blend", 0, "Animation 2", "iwr_blend", 1, "walk_scale", "iwr_blend", 2, "run_scale", "jump_scale", 0, "jump", "landing_scale", 0, "Animation 7", "roll", 0, "air_transition", "roll", 1, "roll_scale", "roll_scale", 0, "Animation", "run_scale", 0, "Animation 4", "walk_scale", 0, "Animation 3", "wall_run", 0, "Blend2", "wall_run", 1, "Blend2 2", "wall_run", 2, "roll" ]
190node_connections = [ "output", 0, "wall_run", "landing_scale", 0, "Animation 7", "TimeScale 3", 0, "strafe", "Blend2", 0, "Animation 8", "Blend2", 1, "Animation 9", "jump_scale", 0, "jump", "roll", 0, "air_transition", "roll", 1, "roll_scale", "air_blend", 0, "jump_scale", "air_blend", 1, "falling_scale", "air_blend", 2, "landing_scale", "Blend2 2", 0, "Animation 11", "Blend2 2", 1, "Animation 10", "run_scale", 0, "Animation 4", "roll_scale", 0, "Animation", "aim_transition", 0, "TimeScale 3", "aim_transition", 1, "iwr_blend", "falling_scale", 0, "Animation 6", "walk_scale", 0, "Animation 3", "iwr_blend", 0, "Animation 2", "iwr_blend", 1, "walk_scale", "iwr_blend", 2, "run_scale", "air_transition", 0, "air_blend", "air_transition", 1, "aim_transition", "wall_run", 0, "Blend2", "wall_run", 1, "Blend2 2", "wall_run", 2, "roll" ]
main.gd +7 -19
……@@ -1,31 +1,19 @@
11extends Node
22
3onready var map_test = preload("res://game/maps/map_test/map_test.tscn")
4onready var map_cyber = preload("res://game/maps/map_cyber/map_cyber.tscn")
5onready var map_cyber1 = preload("res://game/maps/map_cyber1/map_cyber1.scn")
3export(NodePath) var MAP_TEST : NodePath
4export(NodePath) var map_cyber : NodePath
5export(NodePath) var map_cyber1 : NodePath
66
7# Declare member variables here. Examples:
8# var a = 2
9# var b = "text"
10
11func fartPussy():
12 pass
13
14
15# Called when the node enters the scene tree for the first time.
167func _ready():
17 pass # Replace with function body.
8 pass
189
1910
20# Called every frame. 'delta' is the elapsed time since the previous frame.
21#func _process(delta):
22# pass
11func _process(delta):
12 pass
2313
24func getSpawnLocation() -> Vector3:
14func getSpawnLocation(bodyNode, mapNode) -> Vector3:
2515 # Get Number of Maps
2616 var childCount : int = self.get_child(0).get_child_count()
27 # Get Random Map
28 var mapNode = self.get_child(0).get_child( randi() % childCount )
2917
3018 # Get Random Spawn Location from Map
3119 var playerSpawnNodes = mapNode.find_node("PlayerSpawnNodes", true, false)
main.tscn +5 -0
……@@ -12,6 +12,9 @@
1212
1313[node name="Main" type="Node"]
1414script = ExtResource( 7 )
15MAP_TEST = NodePath("Maps/map_test")
16map_cyber = NodePath("Maps/map_cyber")
17map_cyber1 = NodePath("Maps/map_cyber1")
1518
1619[node name="Maps" type="Node" parent="."]
1720
……@@ -20,9 +23,11 @@ transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 82.6497, 0, 204.33 )
2023
2124[node name="map_cyber" parent="Maps" instance=ExtResource( 9 )]
2225transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 132.051, 0, -243 )
26map_name = "map_cyber"
2327
2428[node name="map_cyber1" parent="Maps" instance=ExtResource( 8 )]
2529transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 357.971, 3.8147e-06, 43.2013 )
30map_name = "map_cyber1"
2631
2732[node name="Players" type="Node" parent="."]
2833