| … | … | @@ -35,7 +35,7 @@ func tryMapChange(mapChangeName : String, sendGossip : bool, playerNode): |
| 35 | 35 | playerNode.playerWantsNewWorldEnvironment = true |
| 36 | 36 | |
| 37 | 37 | if(sendGossip): |
| 38 | var data : Dictionary = { | |
| 38 | var _data : Dictionary = { | |
| 39 | 39 | "map": { |
| 40 | 40 | "name": mapChangeName |
| 41 | 41 | } |
| … | … | @@ -46,7 +46,6 @@ func tryMapChange(mapChangeName : String, sendGossip : bool, playerNode): |
| 46 | 46 | func _on_CollisionShape_gameplay_entered(): |
| 47 | 47 | pass # Replace with function body. |
| 48 | 48 | |
| 49 | ||
| 50 | func _on_Hitbox_body_shape_entered(body_rid, body, body_shape_index, local_shape_index): | |
| 49 | func _on_hitbox_body_entered(body): | |
| 51 | 50 | if(body is CharacterBody3D): |
| 52 | 51 | tryMapChange(teleportation_destination, true, body) |
| … | … | @@ -1,15 +1,14 @@ |
| 1 | [gd_scene load_steps=2 format=2] | |
| 1 | [gd_scene load_steps=2 format=3 uid="uid://bdo2nek3n4knj"] | |
| 2 | 2 | |
| 3 | [sub_resource type="SpatialMaterial" id=1] | |
| 4 | flags_unshaded = true | |
| 5 | flags_no_depth_test = true | |
| 6 | flags_fixed_size = true | |
| 7 | flags_do_not_receive_shadows = true | |
| 8 | flags_disable_ambient_light = true | |
| 9 | albedo_color = Color( 0.407843, 0, 0, 1 ) | |
| 3 | [sub_resource type="StandardMaterial3D" id="1"] | |
| 4 | no_depth_test = true | |
| 5 | shading_mode = 0 | |
| 6 | disable_ambient_light = true | |
| 7 | albedo_color = Color(0.407843, 0, 0, 1) | |
| 8 | disable_receive_shadows = true | |
| 10 | 9 | |
| 11 | [node name="CSGSphere" type="CSGSphere"] | |
| 12 | radius = 0.025 | |
| 10 | [node name="CSGSphere" type="CSGSphere3D"] | |
| 11 | radius = 0.282 | |
| 13 | 12 | radial_segments = 22 |
| 14 | 13 | rings = 22 |
| 15 | material = SubResource( 1 ) | |
| 14 | material = SubResource( "1" ) |
| … | … | @@ -187,4 +187,4 @@ nodes/walk_scale/node = SubResource( "AnimationNodeTimeScale_bvg56" ) |
| 187 | 187 | nodes/walk_scale/position = Vector2(-640, 360) |
| 188 | 188 | nodes/wall_run/node = SubResource( "AnimationNodeTransition_ur2dc" ) |
| 189 | 189 | nodes/wall_run/position = Vector2(720, -60) |
| 190 | node_connections = [&"output", 0, &"wall_run", &"roll", 0, &"air_transition", &"roll", 1, &"roll_scale", &"air_transition", 0, &"air_blend", &"air_transition", 1, &"aim_transition", &"landing_scale", 0, &"Animation 3", &"walk_scale", 0, &"Animation 4", &"Blend2 2", 0, &"Animation 12", &"Blend2 2", 1, &"Animation 10", &"jump_scale", 0, &"Animation 6", &"Blend2", 0, &"Animation 8", &"Blend2", 1, &"Animation 9", &"run_scale", 0, &"Animation 5", &"TimeScale 3", 0, &"strafe", &"aim_transition", 0, &"TimeScale 3", &"aim_transition", 1, &"iwr_blend", &"iwr_blend", 0, &"Animation 2", &"iwr_blend", 1, &"walk_scale", &"iwr_blend", 2, &"run_scale", &"roll_scale", 0, &"Animation", &"air_blend", 0, &"jump_scale", &"air_blend", 1, &"falling_scale", &"air_blend", 2, &"landing_scale", &"falling_scale", 0, &"Animation 7", &"wall_run", 0, &"Blend2", &"wall_run", 1, &"Blend2 2", &"wall_run", 2, &"roll"] | |
| 190 | node_connections = [&"output", 0, &"wall_run", &"roll", 0, &"air_transition", &"roll", 1, &"roll_scale", &"Blend2 2", 0, &"Animation 12", &"Blend2 2", 1, &"Animation 10", &"air_blend", 0, &"jump_scale", &"air_blend", 1, &"falling_scale", &"air_blend", 2, &"landing_scale", &"falling_scale", 0, &"Animation 7", &"TimeScale 3", 0, &"strafe", &"run_scale", 0, &"Animation 5", &"aim_transition", 0, &"TimeScale 3", &"aim_transition", 1, &"iwr_blend", &"roll_scale", 0, &"Animation", &"iwr_blend", 0, &"Animation 2", &"iwr_blend", 1, &"walk_scale", &"iwr_blend", 2, &"run_scale", &"jump_scale", 0, &"Animation 6", &"air_transition", 0, &"air_blend", &"air_transition", 1, &"aim_transition", &"Blend2", 0, &"Animation 8", &"Blend2", 1, &"Animation 9", &"walk_scale", 0, &"Animation 4", &"wall_run", 0, &"Blend2", &"wall_run", 1, &"Blend2 2", &"wall_run", 2, &"roll", &"landing_scale", 0, &"Animation 3"] |
| … | … | @@ -122,7 +122,7 @@ func grapplingHook_Process(): |
| 122 | 122 | grapplingHook_UpdateVisualLine(length) |
| 123 | 123 | # TODO : BIG Hack to prevent running on remote players |
| 124 | 124 | var _name = self.name |
| 125 | if(self.name == "PlayerLocal"): | |
| 125 | if(self.name == "PlayerCoreLocal"): | |
| 126 | 126 | grapplingHook_UpdateVisualPoint() |
| 127 | 127 | |
| 128 | 128 | func grapplingHook_CheckActivation(): |
| … | … | @@ -148,7 +148,7 @@ func grapplingHook_CheckActivation(): |
| 148 | 148 | func grapplingHook_UpdateVisualPoint(): |
| 149 | 149 | if grappleHookCast.is_colliding(): |
| 150 | 150 | grappleVisualPoint.visible = true |
| 151 | grappleVisualPoint.translation = grappleHookCast.get_collision_point() | |
| 151 | grappleVisualPoint.position = grappleHookCast.get_collision_point() | |
| 152 | 152 | else: |
| 153 | 153 | grappleVisualPoint.visible = false |
| 154 | 154 | |
| … | … | @@ -159,31 +159,31 @@ func grapplingHook_UpdateVisualLine(length : float): |
| 159 | 159 | grappleVisualLine.position.z = length / -1.80 |
| 160 | 160 | |
| 161 | 161 | func grapplingHook_UpdatePlayerVelocityAndReturnHookLength() -> float: |
| 162 | # var grapple_speed : float = 0.5 | |
| 163 | # var rest_length : float = 1 | |
| 164 | # var max_grapple_speed : float = 2.75 | |
| 162 | var grapple_speed : float = 0.5 | |
| 163 | var rest_length : float = 1 | |
| 164 | var max_grapple_speed : float = 2.75 | |
| 165 | 165 | |
| 166 | # var player2hook := grapplingHook_GrapplePosition - translation # vector from player to hook | |
| 167 | # var length := player2hook.length() | |
| 168 | # if(grapplingHook_IsHooked): | |
| 166 | var player2hook := grapplingHook_GrapplePosition - position # vector from player to hook | |
| 167 | var length := player2hook.length() | |
| 168 | if(grapplingHook_IsHooked): | |
| 169 | 169 | # if we more than 4 away from line, don't dampen speed as much |
| 170 | # if(length > 4): | |
| 171 | # kinematicVelocity *= .999 | |
| 170 | if(length > 4): | |
| 171 | velocity *= .999 | |
| 172 | 172 | # Otherwise dampen speed more |
| 173 | #else: | |
| 174 | # kinematicVelocity *= .9 | |
| 173 | else: | |
| 174 | velocity *= .9 | |
| 175 | 175 | |
| 176 | 176 | # Hook's law equation |
| 177 | # var force := grapple_speed * (length - rest_length) | |
| 177 | var force := grapple_speed * (length - rest_length) | |
| 178 | 178 | |
| 179 | 179 | # Clamp force to be less than max_grapple_speed |
| 180 | # if abs(force) > max_grapple_speed: | |
| 181 | # force = max_grapple_speed | |
| 180 | if abs(force) > max_grapple_speed: | |
| 181 | force = max_grapple_speed | |
| 182 | 182 | |
| 183 | 183 | # Preserve direction, but scale by force |
| 184 | # kinematicVelocity += player2hook.normalized() * force | |
| 184 | velocity += player2hook.normalized() * force | |
| 185 | 185 | |
| 186 | return 0.0 # length | |
| 186 | return length | |
| 187 | 187 | |
| 188 | 188 | func grapplingHook_DisappearHand(): |
| 189 | 189 | meshSkeletonHiddenHand.visible = false |
| … | … | @@ -3,7 +3,7 @@ |
| 3 | 3 | [ext_resource type="PackedScene" uid="uid://th4ivyj7adfg" path="res://game/player/player_core.tscn" id="1"] |
| 4 | 4 | [ext_resource type="Script" path="res://game/player/player_core_local_input.gd" id="2"] |
| 5 | 5 | [ext_resource type="Script" path="res://game/player/player_core_local_input_special.gd" id="3"] |
| 6 | [ext_resource type="PackedScene" path="res://game/player/grappling_hook/gh_visual_point_1.tscn" id="4"] | |
| 6 | [ext_resource type="PackedScene" uid="uid://bdo2nek3n4knj" path="res://game/player/grappling_hook/gh_visual_point_1.tscn" id="4"] | |
| 7 | 7 | [ext_resource type="PackedScene" uid="uid://cq34ge5fyxan8" path="res://game/player/player_core_local_debugui.tscn" id="5"] |
| 8 | 8 | [ext_resource type="AudioStream" uid="uid://cs26rjexov20r" path="res://assets/sounds/player/fire_grapplinghook1.mp3" id="9"] |
| 9 | 9 | |
| … | … | @@ -11,25 +11,25 @@ |
| 11 | 11 | |
| 12 | 12 | [node name="Skeleton3D" parent="Model/Armature" index="0"] |
| 13 | 13 | bones/0/position = Vector3(0, 0.235168, 0) |
| 14 | bones/1/position = Vector3(-0.0240179, 0.0238949, 0.747739) | |
| 15 | bones/1/rotation = Quaternion(0.00109371, 0.537324, 0.843354, 0.00607089) | |
| 16 | bones/2/rotation = Quaternion(0.114988, 3.43713e-05, -0.000373492, 0.993367) | |
| 17 | bones/3/rotation = Quaternion(0.00134837, 0.99984, -0.015718, -0.00843674) | |
| 14 | bones/1/position = Vector3(0.0117447, 0.0255968, 0.732043) | |
| 15 | bones/1/rotation = Quaternion(8.23238e-05, 0.526573, 0.850102, 0.00693073) | |
| 16 | bones/2/rotation = Quaternion(0.115696, 3.90989e-05, -0.000424333, 0.993285) | |
| 17 | bones/3/rotation = Quaternion(0.000389739, 0.99995, 0.00908603, -0.00414327) | |
| 18 | 18 | bones/3/scale = Vector3(1, 1, 1) |
| 19 | bones/4/rotation = Quaternion(0.155856, 0.00857555, -0.000912705, 0.987742) | |
| 20 | bones/5/rotation = Quaternion(-0.000882708, 0.995072, 0.0989637, 0.00616626) | |
| 21 | bones/6/rotation = Quaternion(0.0931299, 0.000157758, 1.62897e-05, 0.995654) | |
| 22 | bones/7/rotation = Quaternion(0.000822052, 0.989781, 0.142467, 0.00608377) | |
| 23 | bones/8/position = Vector3(0.021036, 0.14111, 0.0955364) | |
| 19 | bones/4/rotation = Quaternion(0.167795, 0.00399943, -0.000936797, 0.985813) | |
| 20 | bones/5/rotation = Quaternion(-3.17e-05, 0.994443, 0.105266, 0.00123067) | |
| 21 | bones/6/rotation = Quaternion(0.0924468, 0.000220146, 2.27558e-05, 0.995718) | |
| 22 | bones/7/rotation = Quaternion(-0.000131001, 0.989569, 0.144059, 0.00110956) | |
| 23 | bones/8/position = Vector3(0.0210361, 0.138876, 0.0967471) | |
| 24 | 24 | bones/8/rotation = Quaternion(-0.574533, -0.380402, -0.372139, 0.621867) |
| 25 | bones/9/rotation = Quaternion(-0.0072548, 0.739461, -0.640532, 0.207034) | |
| 26 | bones/9/scale = Vector3(1.00563, 0.988357, 1.00563) | |
| 27 | bones/10/rotation = Quaternion(1.36131e-07, -0.17504, -1.6109e-08, 0.984561) | |
| 28 | bones/11/rotation = Quaternion(0.396497, -0.159018, 0.0682248, 0.901581) | |
| 29 | bones/11/scale = Vector3(0.999515, 0.989686, 1.01004) | |
| 30 | bones/12/rotation = Quaternion(9.79363e-07, 0.130257, -4.69733e-07, 0.99148) | |
| 31 | bones/13/rotation = Quaternion(0.0736509, 0.139994, -0.0819888, 0.984) | |
| 32 | bones/13/scale = Vector3(0.993985, 1.00997, 0.996089) | |
| 25 | bones/9/rotation = Quaternion(-0.135501, 0.740622, -0.634822, 0.173549) | |
| 26 | bones/9/scale = Vector3(1.00463, 0.989662, 1.00463) | |
| 27 | bones/10/rotation = Quaternion(1.18432e-07, -0.176781, -3.36775e-08, 0.98425) | |
| 28 | bones/11/rotation = Quaternion(0.321431, -0.174466, 0.0600226, 0.928785) | |
| 29 | bones/11/scale = Vector3(0.999515, 0.992039, 1.00768) | |
| 30 | bones/12/rotation = Quaternion(9.60543e-07, 0.178808, -4.56622e-07, 0.983884) | |
| 31 | bones/13/rotation = Quaternion(0.0948042, 0.18416, -0.0438809, 0.977329) | |
| 32 | bones/13/scale = Vector3(0.994725, 1.0098, 0.994647) | |
| 33 | 33 | bones/15/rotation = Quaternion(0.152495, 0.0320204, -0.0648276, 0.985656) |
| 34 | 34 | bones/16/rotation = Quaternion(-0.00581883, 0.00169818, -0.00528004, 0.999968) |
| 35 | 35 | bones/17/rotation = Quaternion(0.00656525, -0.00667401, 0.0208093, 0.99974) |
| … | … | @@ -46,16 +46,16 @@ bones/28/rotation = Quaternion(0.000326481, -0.00915114, 0.0211574, 0.999734) |
| 46 | 46 | bones/30/rotation = Quaternion(0.119319, -0.0143616, 0.0193321, 0.992564) |
| 47 | 47 | bones/31/rotation = Quaternion(-0.014934, 0.0107446, -0.0181569, 0.999666) |
| 48 | 48 | bones/32/rotation = Quaternion(0.0224839, -0.00492407, 0.00846133, 0.999699) |
| 49 | bones/33/position = Vector3(-0.0210362, 0.14111, 0.0955362) | |
| 49 | bones/33/position = Vector3(-0.0210363, 0.138876, 0.096747) | |
| 50 | 50 | bones/33/rotation = Quaternion(-0.574533, 0.380402, 0.372139, 0.621867) |
| 51 | bones/34/rotation = Quaternion(0.0871951, 0.74376, -0.635559, -0.187838) | |
| 52 | bones/34/scale = Vector3(1.00372, 0.991867, 1.00372) | |
| 53 | bones/35/rotation = Quaternion(2.2563e-07, 0.123919, 6.7336e-07, 0.992292) | |
| 54 | bones/36/rotation = Quaternion(0.265666, 0.121616, -0.0333382, 0.955782) | |
| 55 | bones/36/scale = Vector3(0.999974, 0.99751, 1.00274) | |
| 56 | bones/37/rotation = Quaternion(-3.65474e-07, -0.124538, -1.96684e-07, 0.992215) | |
| 57 | bones/38/rotation = Quaternion(-0.243179, -0.1246, 0.262713, 0.925376) | |
| 58 | bones/38/scale = Vector3(0.998802, 1.00289, 0.997614) | |
| 51 | bones/34/rotation = Quaternion(0.013987, 0.75324, -0.621938, -0.213607) | |
| 52 | bones/34/scale = Vector3(1.00438, 0.993717, 1.00438) | |
| 53 | bones/35/rotation = Quaternion(2.30571e-07, 0.112536, 6.4212e-07, 0.993648) | |
| 54 | bones/36/rotation = Quaternion(0.365253, 0.104518, -0.0408451, 0.92412) | |
| 55 | bones/36/scale = Vector3(0.999974, 0.992469, 1.00808) | |
| 56 | bones/37/rotation = Quaternion(-3.60379e-07, -0.0890528, -2.09748e-07, 0.996027) | |
| 57 | bones/38/rotation = Quaternion(-0.179731, -0.0898426, 0.262409, 0.943804) | |
| 58 | bones/38/scale = Vector3(0.997287, 1.00517, 0.99607) | |
| 59 | 59 | bones/40/rotation = Quaternion(0.152494, -0.0320192, 0.0648276, 0.985656) |
| 60 | 60 | bones/41/rotation = Quaternion(-0.00581815, -0.00169901, 0.00528053, 0.999968) |
| 61 | 61 | bones/42/rotation = Quaternion(0.00656406, 0.00667601, -0.0208095, 0.99974) |
| … | … | @@ -71,28 +71,28 @@ bones/53/rotation = Quaternion(0.000341446, 0.00913473, -0.0211586, 0.999734) |
| 71 | 71 | bones/55/rotation = Quaternion(0.119319, 0.0143618, -0.0193322, 0.992564) |
| 72 | 72 | bones/56/rotation = Quaternion(-0.0149347, -0.0107439, 0.0181572, 0.999666) |
| 73 | 73 | bones/57/rotation = Quaternion(0.0224819, 0.00492589, -0.00846129, 0.999699) |
| 74 | bones/58/position = Vector3(0.177163, -0.0838025, -0.0453228) | |
| 74 | bones/58/position = Vector3(0.177163, -0.0860369, -0.0441121) | |
| 75 | 75 | bones/58/rotation = Quaternion(-3.44743e-07, 0.696936, 0.717133, 3.13916e-07) |
| 76 | bones/59/position = Vector3(-0.177162, -0.0838027, -0.0453232) | |
| 76 | bones/59/position = Vector3(-0.177162, -0.0860369, -0.0441124) | |
| 77 | 77 | bones/59/rotation = Quaternion(-3.44744e-07, 0.696936, 0.717133, 3.13916e-07) |
| 78 | bones/60/position = Vector3(2.93092e-07, -0.131534, -0.2984) | |
| 78 | bones/60/position = Vector3(2.97545e-07, -0.133768, -0.297189) | |
| 79 | 79 | bones/60/rotation = Quaternion(0.014281, -4.94438e-07, 7.06192e-09, 0.999898) |
| 80 | bones/63/rotation = Quaternion(0.00165767, -0.476234, 0.879221, 0.0129778) | |
| 81 | bones/63/scale = Vector3(1.0134, 0.972529, 1.01341) | |
| 82 | bones/64/rotation = Quaternion(9.20876e-11, 1.02774e-05, 2.22219e-11, 1) | |
| 83 | bones/65/rotation = Quaternion(0.77436, 0.00181613, -0.00275689, 0.632737) | |
| 84 | bones/65/scale = Vector3(1.00117, 0.969058, 1.03082) | |
| 85 | bones/66/rotation = Quaternion(6.7734e-11, 1.95539e-05, -4.007e-10, 1) | |
| 86 | bones/67/rotation = Quaternion(0.0801868, 0.0047146, 0.0121173, 0.996695) | |
| 87 | bones/67/scale = Vector3(0.984979, 1.02477, 0.9911) | |
| 88 | bones/69/rotation = Quaternion(0.0175319, -0.676899, 0.72957, 0.0960612) | |
| 89 | bones/69/scale = Vector3(1.01054, 0.980018, 1.01054) | |
| 90 | bones/70/rotation = Quaternion(-2.78949e-08, 0.0269004, 4.27779e-09, 0.999638) | |
| 91 | bones/71/rotation = Quaternion(0.59989, 0.0262679, -0.0199426, 0.799402) | |
| 92 | bones/71/scale = Vector3(1.00085, 0.968931, 1.03119) | |
| 93 | bones/72/rotation = Quaternion(1.61887e-08, 0.00796514, -2.61327e-08, 0.999968) | |
| 94 | bones/73/rotation = Quaternion(-0.307288, 0.0074952, 0.142502, 0.940857) | |
| 95 | bones/73/scale = Vector3(0.990784, 1.00615, 1.00327) | |
| 80 | bones/63/rotation = Quaternion(-0.00523926, -0.784474, 0.619559, -0.0268252) | |
| 81 | bones/63/scale = Vector3(1.01117, 0.975321, 1.01117) | |
| 82 | bones/64/rotation = Quaternion(1.98474e-08, -0.00877625, 5.51736e-09, 0.999961) | |
| 83 | bones/65/rotation = Quaternion(0.728941, -0.0120004, 0.0124615, 0.684357) | |
| 84 | bones/65/scale = Vector3(1.0019, 0.964, 1.0356) | |
| 85 | bones/66/rotation = Quaternion(1.30329e-08, -0.0204358, -9.02991e-08, 0.999791) | |
| 86 | bones/67/rotation = Quaternion(0.0979542, -0.019729, -0.041884, 0.994113) | |
| 87 | bones/67/scale = Vector3(0.986079, 1.02709, 0.987631) | |
| 88 | bones/69/rotation = Quaternion(0.0160165, -0.459682, 0.883662, 0.0870521) | |
| 89 | bones/69/scale = Vector3(1.01261, 0.975021, 1.01261) | |
| 90 | bones/70/rotation = Quaternion(7.69128e-10, 0.018437, -1.78052e-09, 0.99983) | |
| 91 | bones/71/rotation = Quaternion(0.682171, 0.019828, -0.0190324, 0.730676) | |
| 92 | bones/71/scale = Vector3(1.00085, 0.965509, 1.03486) | |
| 93 | bones/72/rotation = Quaternion(1.54556e-08, 0.00625633, -2.0455e-08, 0.99998) | |
| 94 | bones/73/rotation = Quaternion(-0.623361, 0.00998981, 0.111784, 0.773838) | |
| 95 | bones/73/scale = Vector3(0.987693, 0.988215, 1.02489) | |
| 96 | 96 | |
| 97 | 97 | [node name="Sound_Jump" parent="Model" index="2"] |
| 98 | 98 | transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0) |
| … | … | @@ -117,6 +117,7 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.5, 1.5, 0) |
| 117 | 117 | |
| 118 | 118 | [node name="GrappleHookCast" type="RayCast3D" parent="CameraHead/CameraPivot" index="0"] |
| 119 | 119 | transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.740826, 0.0206239) |
| 120 | target_position = Vector3(0, 0, -400) | |
| 120 | 121 | collision_mask = 2 |
| 121 | 122 | debug_shape_custom_color = Color(1, 0, 0, 1) |
| 122 | 123 | debug_shape_thickness = 5 |
| … | … | @@ -0,0 +1,5 @@ |
| 1 | [gd_scene load_steps=2 format=3 uid="uid://cqgsa6ffgsmdm"] | |
| 2 | ||
| 3 | [ext_resource type="PackedScene" uid="uid://th4ivyj7adfg" path="res://game/player/player_core.tscn" id="1"] | |
| 4 | ||
| 5 | [node name="PlayerCoreRemote" instance=ExtResource( "1" )] |
| … | … | @@ -106,7 +106,8 @@ func setupGateway(): |
| 106 | 106 | print("Starting gateway from ",path, " with args ", args) |
| 107 | 107 | |
| 108 | 108 | # Start the hyper-gateway in a process |
| 109 | processPID = OS.execute(path, args) | |
| 109 | # processPID = OS.execute(path, args) | |
| 110 | processPID = OS.create_process(path, args) | |
| 110 | 111 | |
| 111 | 112 | # Sleep for a bit while the gateway loads |
| 112 | 113 | # TODO: Find a better indicator like polling the HTTP server socket |
| … | … | @@ -213,7 +214,7 @@ func downloadLatest(assets, version): |
| 213 | 214 | for asset in assets: |
| 214 | 215 | if asset.name != executibleName: continue |
| 215 | 216 | toDownload = asset |
| 216 | if !toDownload: | |
| 217 | if toDownload.size() < 1: | |
| 217 | 218 | printerr("Unable to find valid executible in latest release") |
| 218 | 219 | return |
| 219 | 220 |
| … | … | @@ -33,7 +33,7 @@ func _process(_delta): |
| 33 | 33 | func _perform_setup(): |
| 34 | 34 | hyperGossip.start_listening() |
| 35 | 35 | |
| 36 | func _on_HyperGateway_started_gateway(_pid : int): | |
| 36 | func _on_hyper_gateway_started_gateway(_pid : int): | |
| 37 | 37 | if !hyperGateway: |
| 38 | 38 | hyperGateway = get_tree().get_current_scene().get_node("HyperGodot").get_node("HyperGateway") |
| 39 | 39 | if !hyperGossip: |
| … | … | @@ -44,7 +44,7 @@ func _on_HyperGateway_started_gateway(_pid : int): |
| 44 | 44 | hyperDebugUI.updateGatewayStatus() |
| 45 | 45 | _perform_setup() |
| 46 | 46 | |
| 47 | func _on_HyperGateway_stopped_gateway(): | |
| 47 | func _on_hyper_gateway_stopped_gateway(): | |
| 48 | 48 | if(hyperDebugUI): |
| 49 | 49 | hyperDebugUI.updateGatewayStatus() |
| 50 | 50 | |
| … | … | @@ -61,12 +61,12 @@ func _on_LocalSnapshotTimer_timeout(): |
| 61 | 61 | |
| 62 | 62 | hyperGossip.broadcast_event(EVENT_PLAYER_SNAPSHOT, snapShotData) |
| 63 | 63 | |
| 64 | func _on_HyperGossip_listening(_extension_name): | |
| 64 | func _on_hyper_gossip_listening(_extension_name): | |
| 65 | 65 | var snapShotData : Dictionary = getPlayerLocalSnapshotData() |
| 66 | 66 | hyperGossip.broadcast_event(EVENT_PLAYER_SNAPSHOT, snapShotData) |
| 67 | 67 | |
| 68 | 68 | # TODO : Get these out of here and into player_core or player_core_remote |
| 69 | func _on_HyperGossip_event(type, data, from): | |
| 69 | func _on_hyper_gossip_event(type, data, from): | |
| 70 | 70 | if type == EVENT_PLAYER_SNAPSHOT: |
| 71 | 71 | updatePlayerWithSnapshot(data, from) |
| 72 | 72 | elif type == EVENT_PLAYER_WANTSTOJUMP: |
| … | … | @@ -158,17 +158,17 @@ func updatePlayer_direction(data, id): |
| 158 | 158 | remotePlayer.playerCoreNetworkDataUpdate(data) |
| 159 | 159 | |
| 160 | 160 | func getPlayerLocalSnapshotData() -> Dictionary: |
| 161 | var snapshotPlayer : KinematicBody = get_tree().get_current_scene().get_node("Players").get_node("PlayerLocal") | |
| 162 | var translation : Vector3 = snapshotPlayer.translation | |
| 161 | var snapshotPlayer : CharacterBody3D = get_tree().get_current_scene().get_node("Players").get_node("PlayerCoreLocal") | |
| 162 | var position : Vector3 = snapshotPlayer.position | |
| 163 | 163 | var meshDirection : Vector3 = Vector3(0, snapshotPlayer.meshNode.rotation.y, 0) |
| 164 | 164 | var lookingDirection : Vector3 = snapshotPlayer.currentDirection |
| 165 | 165 | |
| 166 | 166 | var data : Dictionary = { |
| 167 | 167 | #"profile": profile, |
| 168 | "translation": { | |
| 169 | "x": translation.x, | |
| 170 | "y": translation.y, | |
| 171 | "z": translation.z | |
| 168 | "position": { | |
| 169 | "x": position.x, | |
| 170 | "y": position.y, | |
| 171 | "z": position.z | |
| 172 | 172 | }, |
| 173 | 173 | "meshDirection": { |
| 174 | 174 | "x": meshDirection.x, |
| … | … | @@ -93,12 +93,12 @@ func broadcast_event(type: String, data): |
| 93 | 93 | if(hyperGateway != null): |
| 94 | 94 | if( hyperGateway.getIsGatewayRunning() ): |
| 95 | 95 | var reqURL = _get_extension_url() |
| 96 | var body = JSON.print(_generateEvent(type, data)) | |
| 96 | var body = jsonInstance.stringify(_generateEvent(type, data)) | |
| 97 | 97 | _enqueue_broadcast_request(reqURL, body) |
| 98 | 98 | |
| 99 | 99 | func send_to_peer(peer, type, data): |
| 100 | 100 | var reqURL = _get_extension_url_to_peer(peer) |
| 101 | var body = JSON.print(_generateEvent(type, data)) | |
| 101 | var body = jsonInstance.stringify(_generateEvent(type, data)) | |
| 102 | 102 | _enqueue_broadcast_request(reqURL, body) |
| 103 | 103 | |
| 104 | 104 | func load_peers(): |
| … | … | @@ -151,13 +151,16 @@ func _on_peer_list(_result, response_code, _headers, body): |
| 151 | 151 | printerr('Error listing peers ', response_code, " ", text) |
| 152 | 152 | return |
| 153 | 153 | |
| 154 | # var parsed = jsonInstance.parse(text) | |
| 155 | # json.parse now returns a generic Error, no longer JSONParseResult object. | |
| 154 | 156 | var parsed = jsonInstance.parse(text) |
| 155 | 157 | |
| 156 | if parsed.error != OK: | |
| 158 | # if parsed.error != OK: | |
| 159 | if parsed != OK: | |
| 157 | 160 | printerr("Unable to parse Peer List" + String(parsed.error_line)) |
| 158 | 161 | return |
| 159 | 162 | |
| 160 | var _peers = parsed.result | |
| 163 | var _peers = jsonInstance.get_data() | |
| 161 | 164 | |
| 162 | 165 | emit_signal("peers", _peers) |
| 163 | 166 |
| … | … | @@ -14,7 +14,7 @@ func has(value): |
| 14 | 14 | return value in values |
| 15 | 15 | |
| 16 | 16 | func track(value): |
| 17 | var time = OS.get_system_time_msecs() | |
| 17 | var time = Time.get_ticks_msec() | |
| 18 | 18 | |
| 19 | 19 | values[value] = time |
| 20 | 20 | |
| … | … | @@ -29,7 +29,7 @@ func clear_oldest(): |
| 29 | 29 | values.erase(oldest) |
| 30 | 30 | |
| 31 | 31 | func get_oldest(): |
| 32 | var oldestTime = OS.get_system_time_msecs() | |
| 32 | var oldestTime = Time.get_ticks_msec() | |
| 33 | 33 | var oldestValue = null |
| 34 | 34 | for value in values.keys(): |
| 35 | 35 | var valueTime = values[value] |
| … | … | @@ -1,8 +1,9 @@ |
| 1 | [gd_scene load_steps=6 format=3 uid="uid://bktxghmjd4nc"] | |
| 1 | [gd_scene load_steps=7 format=3 uid="uid://bktxghmjd4nc"] | |
| 2 | 2 | |
| 3 | 3 | [ext_resource type="PackedScene" uid="uid://njxw8k8p0stp" path="res://game/maps/map_test/map_test.tscn" id="1_0op02"] |
| 4 | 4 | [ext_resource type="PackedScene" uid="uid://ds36d5iqtsvuh" path="res://game/player/player_core_local.tscn" id="2_yvl7a"] |
| 5 | 5 | [ext_resource type="Script" path="res://hypergodot/hyper_gossip/hyper_gossip.gd" id="3_g8xkj"] |
| 6 | [ext_resource type="Script" path="res://hypergodot/hyper_godot_core.gd" id="3_hnq10"] | |
| 6 | 7 | [ext_resource type="Script" path="res://hypergodot/hyper_gateway/hyper_gateway.gd" id="4_djf6c"] |
| 7 | 8 | [ext_resource type="PackedScene" uid="uid://wlhlq38cvryl" path="res://hypergodot/hyper_debugui/hyper_debugui.tscn" id="5_7ejif"] |
| 8 | 9 | |
| … | … | @@ -18,6 +19,7 @@ |
| 18 | 19 | transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -6.22427, -3.67598, -8.14551) |
| 19 | 20 | |
| 20 | 21 | [node name="HyperGodot" type="Node" parent="."] |
| 22 | script = ExtResource( "3_hnq10" ) | |
| 21 | 23 | |
| 22 | 24 | [node name="HyperGateway" type="Node" parent="HyperGodot"] |
| 23 | 25 | script = ExtResource( "4_djf6c" ) |
| … | … | @@ -26,3 +28,8 @@ script = ExtResource( "4_djf6c" ) |
| 26 | 28 | script = ExtResource( "3_g8xkj" ) |
| 27 | 29 | |
| 28 | 30 | [node name="HyperDebugUI" parent="HyperGodot" instance=ExtResource( "5_7ejif" )] |
| 31 | ||
| 32 | [connection signal="started_gateway" from="HyperGodot/HyperGateway" to="HyperGodot" method="_on_hyper_gateway_started_gateway"] | |
| 33 | [connection signal="stopped_gateway" from="HyperGodot/HyperGateway" to="HyperGodot" method="_on_hyper_gateway_stopped_gateway"] | |
| 34 | [connection signal="event" from="HyperGodot/HyperGossip" to="HyperGodot" method="_on_hyper_gossip_event"] | |
| 35 | [connection signal="listening" from="HyperGodot/HyperGossip" to="HyperGodot" method="_on_hyper_gossip_listening"] |