Update for the latest ESS.

This commit is contained in:
Relintai 2020-01-02 23:02:45 +01:00
parent 8ff112bde6
commit 382749220c
37 changed files with 128 additions and 130 deletions

2
HEADS
View File

@ -1 +1 @@
{"engine": "27b74f42b4fd6b6e56b7a4924697d8881488bee1", "world_generator": "63da1cc4a2084d1c2eb9430e436be22711e964f2", "entity_spell_system": "4a166becf4d9179fe85931bef678c967d5141651", "ui_extensions": "8a81cc53100c5a138fbaf927080410025c64c88e", "voxelman": "9d48a0758df7ef8913ef98ed2e37f3b6dba424da", "texture_packer": "fbf5d0d634ab04db049099b814d2d58e2743f5b2", "fastnoise": "41b7ea05a1f7aa2b8ecddaa1fd739e64d6970f7e", "entity-spell-system-addons": "d60e746b158d3ebf9d2ea306af1dd24bcae49be5", "mesh_data_resource": "3fedb4c8534af36d89a1a1a34a6b5ed4d333927a", "ess_data": "3bd637fdd3304b64a18287a49a6b7387acf2f5de", "prop_tool": "df438053ebc900966f8f842fc65f0264f1271d49"} {"engine": "71d372a8ab1ee972326f8bd333f510330b7b7204", "world_generator": "63da1cc4a2084d1c2eb9430e436be22711e964f2", "entity_spell_system": "6aa2df4647a4a221ab7e1c1735c55ef22f7e98f5", "ui_extensions": "8a81cc53100c5a138fbaf927080410025c64c88e", "voxelman": "9d48a0758df7ef8913ef98ed2e37f3b6dba424da", "texture_packer": "fbf5d0d634ab04db049099b814d2d58e2743f5b2", "fastnoise": "41b7ea05a1f7aa2b8ecddaa1fd739e64d6970f7e", "entity-spell-system-addons": "d60e746b158d3ebf9d2ea306af1dd24bcae49be5", "mesh_data_resource": "3fedb4c8534af36d89a1a1a34a6b5ed4d333927a", "ess_data": "3bd637fdd3304b64a18287a49a6b7387acf2f5de", "prop_tool": "df438053ebc900966f8f842fc65f0264f1271d49"}

View File

@ -142,7 +142,7 @@ func load_player(file_name : String, position : Vector3, network_owner : int) ->
entity.from_dict(load_file(file_name)) entity.from_dict(load_file(file_name))
entity.translation = position entity.get_node(entity.get_body_path()).translation = position
# entity.initialize(createinfo) # entity.initialize(createinfo)
entity.set_network_master(network_owner) entity.set_network_master(network_owner)
@ -302,7 +302,7 @@ func spawn(createinfo : EntityCreateInfo, networked : bool, position : Vector3,
spawn_parent.add_child(entity_node) spawn_parent.add_child(entity_node)
entity_node.owner = spawn_parent entity_node.owner = spawn_parent
entity_node.translation = position entity_node.get_body().translation = position
entity_node.initialize(createinfo) entity_node.initialize(createinfo)

View File

@ -216,4 +216,4 @@ func set_terrarin_player():
var terrarin : VoxelWorld = get_node("/root/GameScene/VoxelWorld") var terrarin : VoxelWorld = get_node("/root/GameScene/VoxelWorld")
terrarin.set_player(local_player_master.player as Spatial) terrarin.set_player(local_player_master.player.get_body() as Spatial)

View File

@ -18,9 +18,8 @@ text_name = "Aspect of Scorpions"
text_description = "Range: 26m. text_description = "Range: 26m.
Casttime: {3}. Casttime: {3}.
Deals 340 to 380 damage every 3 sec, and increases damage taken by 10% for 30 sec." Deals 340 to 380 damage every 3 sec, and increases damage taken by 10% for 30 sec."
range = true
range_range = 26.0 range_range = 26.0
cast = true cast_enabled = true
cast_cast_time = 1.2 cast_cast_time = 1.2
training_required_spell = ExtResource( 5 ) training_required_spell = ExtResource( 5 )
script = ExtResource( 1 ) script = ExtResource( 1 )

View File

@ -16,7 +16,6 @@ text_name = "Aspect of Wasps"
text_description = "Range: 26m. text_description = "Range: 26m.
Instant. Instant.
Deals 230 to 270 damage every 3 sec, this damage increases over the duration, for 21 sec." Deals 230 to 270 damage every 3 sec, this damage increases over the duration, for 21 sec."
range = true
range_range = 26.0 range_range = 26.0
aoe_targetType = 541 aoe_targetType = 541
aoe_colliderType = 541 aoe_colliderType = 541

View File

@ -16,7 +16,6 @@ target_aura_applys = [ ExtResource( 3 ) ]
text_name = "Aspect of Wolves" text_name = "Aspect of Wolves"
text_description = "Range: 26m. text_description = "Range: 26m.
Deals 280 to 330 damage every 2 sec, and reduces melee and spell damage by 10% for 22 sec." Deals 280 to 330 damage every 2 sec, and reduces melee and spell damage by 10% for 22 sec."
range = true
range_range = 26.0 range_range = 26.0
aoe_targetType = 1129071960 aoe_targetType = 1129071960
aoe_colliderType = 1058050193 aoe_colliderType = 1058050193

View File

@ -19,7 +19,6 @@ Instant.
Cooldown: {2} Cooldown: {2}
Deals 460 to 540 damage every 3 sec, healing you for 80% of the damage." Deals 460 to 540 damage every 3 sec, healing you for 80% of the damage."
cooldown_cooldown = 21.0 cooldown_cooldown = 21.0
range = true
range_range = 26.0 range_range = 26.0
aoe_targetType = -1910718371 aoe_targetType = -1910718371
aoe_colliderType = -298046312 aoe_colliderType = -298046312

View File

@ -27,11 +27,8 @@ text_name = "Amplify Pain"
text_description = "Range: 26m. text_description = "Range: 26m.
Casttime: {3}. Casttime: {3}.
Causes your damage over time effects to tick." Causes your damage over time effects to tick."
range = true
range_range = 26.0 range_range = 26.0
cast = true
cast_cast_time = 1.5 cast_cast_time = 1.5
damage = true
damage_type = 16 damage_type = 16
damage_min = 130 damage_min = 130
damage_max = 150 damage_max = 150

View File

@ -17,7 +17,6 @@ text_name = "Close Wounds"
text_description = "Casttime: 2 sec. text_description = "Casttime: 2 sec.
Cooldown: {2} Cooldown: {2}
Heals you for 720 to 780 every 3 sec for 21 sec." Heals you for 720 to 780 every 3 sec for 21 sec."
cast = true
cast_cast_time = 1.3 cast_cast_time = 1.3
aoe_colliderType = -2147479552 aoe_colliderType = -2147479552
script = ExtResource( 1 ) script = ExtResource( 1 )

View File

@ -18,7 +18,6 @@ text_description = "Instant.
Cooldown: {2} Cooldown: {2}
Reduces damage taken by 70%. This spell is not on the global cooldown." Reduces damage taken by 70%. This spell is not on the global cooldown."
cooldown_cooldown = 60.0 cooldown_cooldown = 60.0
cooldown_global_cooldown = false
aoe_targetType = -1910718371 aoe_targetType = -1910718371
aoe_colliderType = -298046312 aoe_colliderType = -298046312
script = ExtResource( 1 ) script = ExtResource( 1 )

View File

@ -18,7 +18,6 @@ text_description = "Instant.
Cooldown: {2} Cooldown: {2}
Increases your movement speed by 60% for 6 sec. This spell is not on the global cooldown." Increases your movement speed by 60% for 6 sec. This spell is not on the global cooldown."
cooldown_cooldown = 20.0 cooldown_cooldown = 20.0
cooldown_global_cooldown = false
aoe_targetType = 520 aoe_targetType = 520
aoe_colliderType = 186459648 aoe_colliderType = 186459648
script = ExtResource( 3 ) script = ExtResource( 3 )

View File

@ -15,7 +15,6 @@ text_description = "Instant.
Cooldown: {2} Cooldown: {2}
Roots every enemy around you in a 15m radius for 8 sec. This spell doesn't have diminishing return." Roots every enemy around you in a 15m radius for 8 sec. This spell doesn't have diminishing return."
cooldown_cooldown = 24.0 cooldown_cooldown = 24.0
range = true
range_range = 15.0 range_range = 15.0
aoe = true aoe = true
aoe_targetType = -572653568 aoe_targetType = -572653568

View File

@ -11,7 +11,6 @@ rank = 1
icon = ExtResource( 2 ) icon = ExtResource( 2 )
needs_target = true needs_target = true
text_name = "adadadadadad" text_name = "adadadadadad"
damage = true
damage_min = 200 damage_min = 200
damage_max = 300 damage_max = 300
aoe_targetType = 1431112251 aoe_targetType = 1431112251

View File

@ -16,8 +16,6 @@ text_description = "Range: 26m.
Casttime: 1.5 sec. Casttime: 1.5 sec.
Cooldown: {2} Cooldown: {2}
Roots the target for 8 sec." Roots the target for 8 sec."
range = true
cast = true
cast_cast_time = 1.4 cast_cast_time = 1.4
aoe_targetType = 8 aoe_targetType = 8
aoe_colliderType = 537722880 aoe_colliderType = 537722880

View File

@ -17,7 +17,6 @@ text_description = "Instant.
Cooldown: {2} Cooldown: {2}
Heals you for 6700 to 7000." Heals you for 6700 to 7000."
cooldown_cooldown = 150.0 cooldown_cooldown = 150.0
heal = true
heal_min = 6700 heal_min = 6700
heal_max = 7000 heal_max = 7000
aoe_targetType = 5 aoe_targetType = 5

View File

@ -14,7 +14,6 @@ text_name = "Inner Will"
text_description = "Cooldown: 1.5 min. text_description = "Cooldown: 1.5 min.
Removes any movement impairing effects, stuns, and effects which makes you lose control of your character. This spell is not on the global cooldown." Removes any movement impairing effects, stuns, and effects which makes you lose control of your character. This spell is not on the global cooldown."
cooldown_cooldown = 90.0 cooldown_cooldown = 90.0
cooldown_global_cooldown = false
aoe_targetType = 7 aoe_targetType = 7
aoe_colliderType = 480 aoe_colliderType = 480
script = ExtResource( 1 ) script = ExtResource( 1 )

View File

@ -17,9 +17,8 @@ text_name = "Aspect of Scorpions"
text_description = "Range: 26m. text_description = "Range: 26m.
Casttime: {3}. Casttime: {3}.
Deals 340 to 380 damage every 3 sec, and increases damage taken by 10% for 30 sec." Deals 340 to 380 damage every 3 sec, and increases damage taken by 10% for 30 sec."
range = true
range_range = 26.0 range_range = 26.0
cast = true cast_enabled = true
cast_cast_time = 1.2 cast_cast_time = 1.2
spell_cooldown_mainpulation_data_count = -1 spell_cooldown_mainpulation_data_count = -1
script = ExtResource( 2 ) script = ExtResource( 2 )

View File

@ -15,7 +15,6 @@ text_name = "Aspect of Wasps"
text_description = "Range: 26m. text_description = "Range: 26m.
Instant. Instant.
Deals 230 to 270 damage every 3 sec, this damage increases over the duration, for 21 sec." Deals 230 to 270 damage every 3 sec, this damage increases over the duration, for 21 sec."
range = true
range_range = 26.0 range_range = 26.0
aoe_targetType = 541 aoe_targetType = 541
aoe_colliderType = 541 aoe_colliderType = 541

View File

@ -15,7 +15,6 @@ target_aura_applys = [ ExtResource( 2 ) ]
text_name = "Aspect of Wolves" text_name = "Aspect of Wolves"
text_description = "Range: 26m. text_description = "Range: 26m.
Deals 280 to 330 damage every 2 sec, and reduces melee and spell damage by 10% for 22 sec." Deals 280 to 330 damage every 2 sec, and reduces melee and spell damage by 10% for 22 sec."
range = true
range_range = 26.0 range_range = 26.0
aoe_targetType = 1129071960 aoe_targetType = 1129071960
aoe_colliderType = 1058050193 aoe_colliderType = 1058050193

View File

@ -19,7 +19,6 @@ Instant.
Cooldown: {2} Cooldown: {2}
Deals 460 to 540 damage every 3 sec, healing you for 80% of the damage." Deals 460 to 540 damage every 3 sec, healing you for 80% of the damage."
cooldown_cooldown = 21.0 cooldown_cooldown = 21.0
range = true
range_range = 26.0 range_range = 26.0
aoe_targetType = -1910718371 aoe_targetType = -1910718371
aoe_colliderType = -298046312 aoe_colliderType = -298046312

View File

@ -27,11 +27,8 @@ text_name = "Overload"
text_description = "Range: 26m. text_description = "Range: 26m.
Channeled. Free. Channeled. Free.
Causes your dots to deal 10% more damage." Causes your dots to deal 10% more damage."
range = true
range_range = 26.0 range_range = 26.0
cast = true
cast_cast_time = 1.5 cast_cast_time = 1.5
damage = true
damage_type = 16 damage_type = 16
damage_min = 130 damage_min = 130
damage_max = 150 damage_max = 150

View File

@ -37,7 +37,7 @@ func _ready() -> void:
camera.translation.z = target_camera_distance camera.translation.z = target_camera_distance
player = get_node("..") player = get_node("../..") as Entity
set_physics_process(true) set_physics_process(true)
@ -46,7 +46,7 @@ func _physics_process(delta):
var space_state = get_world().direct_space_state var space_state = get_world().direct_space_state
var result : Dictionary = space_state.intersect_ray(pos, to_global(Vector3(0, 0, target_camera_distance)), [player], player.collision_mask) var result : Dictionary = space_state.intersect_ray(pos, to_global(Vector3(0, 0, target_camera_distance)), [ player.get_body() ], player.get_body().collision_mask)
if result: if result:
camera_distance = (result.position - pos).length() - 0.2 camera_distance = (result.position - pos).length() - 0.2

View File

@ -171,13 +171,13 @@ func process_movement(delta : float) -> void:
hvel = hvel.linear_interpolate(target, accel * delta) as Vector3 hvel = hvel.linear_interpolate(target, accel * delta) as Vector3
vel.x = hvel.x vel.x = hvel.x
vel.z = hvel.z vel.z = hvel.z
vel = move_and_slide(vel, Vector3(0,1,0), false, 4, deg2rad(MAX_SLOPE_ANGLE)) vel = get_body().move_and_slide(vel, Vector3(0,1,0), false, 4, deg2rad(MAX_SLOPE_ANGLE))
if get_tree().network_peer: if get_tree().network_peer:
if get_tree().is_network_server(): if get_tree().is_network_server():
set_position(translation, rotation) set_position(get_body().translation, get_body().rotation)
else: else:
rpc("set_position", translation, rotation) rpc("set_position", get_body().translation, get_body().rotation)
func _input(event: InputEvent) -> void: func _input(event: InputEvent) -> void:
if not cursor_grabbed: if not cursor_grabbed:
@ -285,17 +285,16 @@ func rotate_delta(x_delta : float) -> void:
while y_rot < 0: while y_rot < 0:
y_rot += 360 y_rot += 360
rotation_degrees = Vector3(0.0, y_rot, 0.0) get_body().rotation_degrees = Vector3(0.0, y_rot, 0.0)
func target(position : Vector2): func target(position : Vector2):
var from = camera.project_ray_origin(position) var from = camera.project_ray_origin(position)
var to = from + camera.project_ray_normal(position) * ray_length var to = from + camera.project_ray_normal(position) * ray_length
var space_state = get_world().direct_space_state var space_state = get_body().get_world().direct_space_state
var result = space_state.intersect_ray(from, to, [], 2) var result = space_state.intersect_ray(from, to, [], 2)
if result: if result:
print(result)
if result.collider and result.collider is Entity: if result.collider and result.collider is Entity:
var ent : Entity = result.collider as Entity var ent : Entity = result.collider as Entity
@ -310,7 +309,7 @@ func cmouseover(event):
var from = camera.project_ray_origin(event.position) var from = camera.project_ray_origin(event.position)
var to = from + camera.project_ray_normal(event.position) * ray_length var to = from + camera.project_ray_normal(event.position) * ray_length
var space_state = get_world().direct_space_state var space_state = get_body().get_world().direct_space_state
var result = space_state.intersect_ray(from, to, [], 2) var result = space_state.intersect_ray(from, to, [], 2)
if result: if result:

View File

@ -1,30 +1,38 @@
[gd_scene load_steps=3 format=2] [gd_scene load_steps=4 format=2]
[ext_resource path="res://player/DisplayPlayer.gd" type="Script" id=1] [ext_resource path="res://player/DisplayPlayer.gd" type="Script" id=1]
[ext_resource path="res://data/models/armature_model_orig_v2.tscn" type="PackedScene" id=2] [ext_resource path="res://data/models/armature_model_orig_v2.tscn" type="PackedScene" id=2]
[ext_resource path="res://player/EntityModel.gd" type="Script" id=3]
[node name="DisplayPlayer" type="Entity" groups=[ [node name="DisplayPlayer" type="Entity" groups=[
"players", "players",
]] ]]
input_ray_pickable = false body_path = NodePath("DisplayPlayer")
collision_layer = 3 character_skeleton_path = NodePath("DisplayPlayer/Rotation_Helper/Model/character")
collision_mask = 3
character_skeleton_path = NodePath("Rotation_Helper/Model/character")
sseed = 9240987 sseed = 9240987
cseed = 9240987 cseed = 9240987
script = ExtResource( 1 ) script = ExtResource( 1 )
[node name="Rotation_Helper" type="Spatial" parent="."] [node name="DisplayPlayer" type="KinematicBody" parent="."]
script = ExtResource( 3 )
[node name="Rotation_Helper" type="Spatial" parent="DisplayPlayer"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.960532, 0 ) transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.960532, 0 )
__meta__ = { __meta__ = {
"_editor_description_": "" "_editor_description_": ""
} }
[node name="Model" type="Spatial" parent="Rotation_Helper"] [node name="Model" type="Spatial" parent="DisplayPlayer/Rotation_Helper"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.875205, 0 ) transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.875205, 0 )
__meta__ = { __meta__ = {
"_editor_description_": "" "_editor_description_": ""
} }
[node name="character" parent="Rotation_Helper/Model" instance=ExtResource( 2 )] [node name="character" parent="DisplayPlayer/Rotation_Helper/Model" instance=ExtResource( 2 )]
use_threads = false use_threads = false
mesh_instance_path = NodePath("../../../../DisplayPlayer/Rotation_Helper/Model/character/armature/Armature/Skeleton/MeshInstance")
skeleton_path = NodePath("../../../../DisplayPlayer/Rotation_Helper/Model/character/armature/Armature/Skeleton")
left_hand_attach_point_path = NodePath("../../../../DisplayPlayer/Rotation_Helper/Model/character/armature/Armature/Skeleton/LeftHandAttachment/LeftHandAP")
right_hand_attach_point_path = NodePath("../../../../DisplayPlayer/Rotation_Helper/Model/character/armature/Armature/Skeleton/RightHandAttachment/RightHandAP")
torso_attach_point_path = NodePath("../../../../DisplayPlayer/Rotation_Helper/Model/character/armature/Armature/Skeleton/NeckAttachment/TorsoAP")
root_attach_point_path = NodePath("../../../../DisplayPlayer/Rotation_Helper/Model/character/armature/Armature/Skeleton/RootAttachment/RootAP")

View File

@ -0,0 +1,13 @@
extends KinematicBody
func _enter_tree():
var spat : Node = get_parent()
while spat != null:
if spat is Spatial:
transform *= (spat as Spatial).transform
spat = spat.get_parent()

View File

@ -82,17 +82,17 @@ func _process(delta : float) -> void:
return return
var cam_pos : Vector3 = camera.global_transform.xform(Vector3()) var cam_pos : Vector3 = camera.global_transform.xform(Vector3())
var dstv : Vector3 = cam_pos - translation var dstv : Vector3 = cam_pos - get_body().translation
dstv.y = 0 dstv.y = 0
var dst : float = dstv.length_squared() var dst : float = dstv.length_squared()
if dst > max_visible_distance_squared: if dst > max_visible_distance_squared:
if visible: if get_body().visible:
hide() get_body().hide()
return return
else: else:
if not visible: if not get_body().visible:
show() get_body().show()
#TODO check later if this gives a performance boost #TODO check later if this gives a performance boost
# var cam_facing : Vector3 = -camera.global_transform.basis.z # var cam_facing : Vector3 = -camera.global_transform.basis.z
@ -121,7 +121,7 @@ func _physics_process(delta : float) -> void:
func process_movement(delta : float) -> void: func process_movement(delta : float) -> void:
if starget != null: if starget != null:
look_at(starget.translation, Vector3(0, 1, 0)) get_body().look_at(starget.get_body().translation, Vector3(0, 1, 0))
var state : int = getc_state() var state : int = getc_state()
@ -188,13 +188,13 @@ func process_movement(delta : float) -> void:
var facing : Vector3 = vel var facing : Vector3 = vel
facing.y = 0 facing.y = 0
vel = move_and_slide(vel, Vector3(0,1,0), false, 4, deg2rad(MAX_SLOPE_ANGLE)) vel = get_body().move_and_slide(vel, Vector3(0,1,0), false, 4, deg2rad(MAX_SLOPE_ANGLE))
sset_position(translation, rotation) sset_position(get_body().translation, get_body().rotation)
if vel.length_squared() < 0.12: if vel.length_squared() < 0.12:
sleep = true sleep = true
if translation.y < -50.0: if get_body().translation.y < -50.0:
print("killed mob with fall damage") print("killed mob with fall damage")
var sdi : SpellDamageInfo = SpellDamageInfo.new() var sdi : SpellDamageInfo = SpellDamageInfo.new()
sdi.damage_source_type = SpellDamageInfo.DAMAGE_SOURCE_UNKNOWN sdi.damage_source_type = SpellDamageInfo.DAMAGE_SOURCE_UNKNOWN
@ -209,7 +209,7 @@ func rotate_delta(x_delta : float) -> void:
if y_rot < 0: if y_rot < 0:
y_rot = 360 y_rot = 360
rotation_degrees = Vector3(0.0, y_rot, 0.0) get_body().rotation_degrees = Vector3(0.0, y_rot, 0.0)
func sstart_attack(entity : Entity) -> void: func sstart_attack(entity : Entity) -> void:
ai_state = EntityEnums.AI_STATE_ATTACK ai_state = EntityEnums.AI_STATE_ATTACK
@ -271,10 +271,10 @@ func _son_damage_dealt(data):
func _con_damage_dealt(info : SpellDamageInfo) -> void: func _con_damage_dealt(info : SpellDamageInfo) -> void:
# if info.dealer == # if info.dealer ==
WorldNumbers.damage(translation, 1.6, info.damage, info.crit) WorldNumbers.damage(get_body().translation, 1.6, info.damage, info.crit)
func _con_heal_dealt(info : SpellHealInfo) -> void: func _con_heal_dealt(info : SpellHealInfo) -> void:
WorldNumbers.heal(translation, 1.6, info.heal, info.crit) WorldNumbers.heal(get_body().translation, 1.6, info.heal, info.crit)
func _moved() -> void: func _moved() -> void:
if sis_casting(): if sis_casting():
@ -352,9 +352,9 @@ func _son_level_up(value: int) -> void:
func sset_position(position : Vector3, rotation : Vector3) -> void: func sset_position(position : Vector3, rotation : Vector3) -> void:
if multiplayer.network_peer and multiplayer.is_network_server(): if multiplayer.network_peer and multiplayer.is_network_server():
# cset_position(position, rotation) # cset_position(position, rotation)
vrpc("cset_position", translation, rotation) vrpc("cset_position", position, rotation)
remote func cset_position(position : Vector3, rotation : Vector3) -> void: remote func cset_position(position : Vector3, rotation : Vector3) -> void:
translation = position get_body().translation = position
rotation = rotation get_body().rotation = rotation

View File

@ -14,32 +14,25 @@ extents = Vector3( 0.216228, 0.0681041, 0.183397 )
[node name="Mob" type="Entity" groups=[ [node name="Mob" type="Entity" groups=[
"mobs", "mobs",
]] ]]
input_ray_pickable = false body_path = NodePath("Body")
collision_layer = 3 character_skeleton_path = NodePath("Body/Rotation_Helper/Model/character")
collision_mask = 3
character_skeleton_path = NodePath("Rotation_Helper/Model/character")
script = ExtResource( 2 ) script = ExtResource( 2 )
[node name="Body_CollisionShape" type="CollisionShape" parent="."] [node name="NamePlate" parent="." instance=ExtResource( 3 )]
[node name="Body" type="KinematicBody" parent="."]
[node name="Body_CollisionShape" type="CollisionShape" parent="Body"]
transform = Transform( 1, 0, 0, 0, -1.62921e-07, -1, 0, 1, -1.62921e-07, 0, 0.73, 0 ) transform = Transform( 1, 0, 0, 0, -1.62921e-07, -1, 0, 1, -1.62921e-07, 0, 0.73, 0 )
shape = SubResource( 1 ) shape = SubResource( 1 )
[node name="Feet_CollisionShape" type="CollisionShape" parent="."] [node name="Feet_CollisionShape" type="CollisionShape" parent="Body"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.1, 0 ) transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.1, 0 )
shape = SubResource( 2 ) shape = SubResource( 2 )
[node name="Rotation_Helper" type="Spatial" parent="."] [node name="Rotation_Helper" type="Spatial" parent="Body"]
transform = Transform( -1, 0, -3.25841e-07, 0, 1, 0, 3.25841e-07, 0, -1, 0, 0, 0 ) transform = Transform( -1, 0, -3.25841e-07, 0, 1, 0, 3.25841e-07, 0, -1, 0, 0, 0 )
[node name="Model" type="Spatial" parent="Rotation_Helper"] [node name="Model" type="Spatial" parent="Body/Rotation_Helper"]
[node name="character" parent="Rotation_Helper/Model" instance=ExtResource( 1 )] [node name="character" parent="Body/Rotation_Helper/Model" instance=ExtResource( 1 )]
[node name="OmniLight" type="OmniLight" parent="."]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0.185015, 1.74294, -0.107748 )
visible = false
light_color = Color( 0.592157, 0.631373, 0.607843, 1 )
omni_range = 8.0
omni_attenuation = 0.31864
[node name="NamePlate" parent="." instance=ExtResource( 3 )]

View File

@ -84,7 +84,7 @@ func _process(delta):
interpolating = false interpolating = false
var position : Vector3 = entity.translation var position : Vector3 = entity.get_body().translation
var camera : Camera = get_tree().get_root().get_camera() as Camera var camera : Camera = get_tree().get_root().get_camera() as Camera

View File

@ -100,7 +100,7 @@ func rotate_delta(x_delta : float) -> void:
if y_rot < 0: if y_rot < 0:
y_rot = 360 y_rot = 360
rotation_degrees = Vector3(0.0, y_rot, 0.0) get_body().rotation_degrees = Vector3(0.0, y_rot, 0.0)
#remote func set_position(position : Vector3, rot : Vector3) -> void: #remote func set_position(position : Vector3, rot : Vector3) -> void:
# translation = position # translation = position
@ -113,14 +113,14 @@ remote func sset_position(position : Vector3, rotation : Vector3) -> void:
if multiplayer.network_peer and multiplayer.is_network_server(): if multiplayer.network_peer and multiplayer.is_network_server():
cset_position(position, rotation) cset_position(position, rotation)
vrpc("cset_position", translation, rotation) vrpc("cset_position", position, rotation)
remote func cset_position(position : Vector3, rotation : Vector3) -> void: remote func cset_position(position : Vector3, rotation : Vector3) -> void:
# if get_network_master() != 1: # if get_network_master() != 1:
# print(str(get_network_master()) + "npcset") # print(str(get_network_master()) + "npcset")
translation = position get_body().translation = position
rotation = rotation get_body().rotation = rotation
func _moved() -> void: func _moved() -> void:
if sis_casting(): if sis_casting():

View File

@ -12,26 +12,29 @@ height = 0.927641
extents = Vector3( 0.216228, 0.0681041, 0.183397 ) extents = Vector3( 0.216228, 0.0681041, 0.183397 )
[node name="NetworkedPlayer" type="Entity"] [node name="NetworkedPlayer" type="Entity"]
input_ray_pickable = false body_path = NodePath("Body")
collision_layer = 3 character_skeleton_path = NodePath("Body/Rotation_Helper/Model/character")
collision_mask = 3
character_skeleton_path = NodePath("Rotation_Helper/Model/character")
script = ExtResource( 1 ) script = ExtResource( 1 )
[node name="Body_CollisionShape" type="CollisionShape" parent="."] [node name="Body" type="KinematicBody" parent="."]
[node name="Body_CollisionShape" type="CollisionShape" parent="Body"]
transform = Transform( 1, 0, 0, 0, -1.62921e-07, -1, 0, 1, -1.62921e-07, 0, 0.8, 0 ) transform = Transform( 1, 0, 0, 0, -1.62921e-07, -1, 0, 1, -1.62921e-07, 0, 0.8, 0 )
shape = SubResource( 1 ) shape = SubResource( 1 )
[node name="Feet_CollisionShape" type="CollisionShape" parent="."] [node name="Feet_CollisionShape" type="CollisionShape" parent="Body"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.194237, 0 ) transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.194237, 0 )
shape = SubResource( 2 ) shape = SubResource( 2 )
[node name="Rotation_Helper" type="Spatial" parent="."] [node name="Rotation_Helper" type="Spatial" parent="Body"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.960532, 0 ) transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.960532, 0 )
[node name="Model" type="Spatial" parent="Rotation_Helper"] [node name="Model" type="Spatial" parent="Body/Rotation_Helper"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.875205, 0 ) transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.875205, 0 )
[node name="character" parent="Rotation_Helper/Model" instance=ExtResource( 2 )] [node name="character" parent="Body/Rotation_Helper/Model" instance=ExtResource( 2 )]
[node name="NamePlate" parent="." instance=ExtResource( 3 )] [node name="NamePlate" parent="." instance=ExtResource( 3 )]
name_label_path = NodePath("../../NetworkedPlayerNode/NamePlate/Name")
health_bar_path = NodePath("../../NetworkedPlayerNode/NamePlate/MarginContainer/TextureProgress")
health_bar_label_path = NodePath("../../NetworkedPlayerNode/NamePlate/MarginContainer/CenterContainer/Label")

View File

@ -79,8 +79,8 @@ var world : VoxelWorld = null
var model_rotation_node : Spatial var model_rotation_node : Spatial
func _ready() -> void: func _ready() -> void:
camera = $CameraPivot/Camera as Camera camera = $Body/CameraPivot/Camera as Camera
camera_pivot = $CameraPivot as Spatial camera_pivot = $Body/CameraPivot as Spatial
model_rotation_node = get_node(model_path) model_rotation_node = get_node(model_path)
@ -190,13 +190,13 @@ func process_movement(delta : float) -> void:
hvel = hvel.linear_interpolate(target, accel * delta) as Vector3 hvel = hvel.linear_interpolate(target, accel * delta) as Vector3
vel.x = hvel.x vel.x = hvel.x
vel.z = hvel.z vel.z = hvel.z
vel = move_and_slide(vel, Vector3(0,1,0), false, 4, deg2rad(MAX_SLOPE_ANGLE)) vel = get_body().move_and_slide(vel, Vector3(0,1,0), false, 4, deg2rad(MAX_SLOPE_ANGLE))
if multiplayer.has_network_peer(): if multiplayer.has_network_peer():
if not multiplayer.is_network_server(): if not multiplayer.is_network_server():
rpc_id(1, "sset_position", translation, rotation) rpc_id(1, "sset_position", get_body().translation, get_body().rotation)
else: else:
sset_position(translation, rotation) sset_position(get_body().translation, get_body().rotation)
func _input(event: InputEvent) -> void: func _input(event: InputEvent) -> void:
@ -305,19 +305,18 @@ func rotate_delta(x_delta : float) -> void:
while y_rot < 0: while y_rot < 0:
y_rot += 360 y_rot += 360
rotation_degrees = Vector3(0.0, y_rot, 0.0) get_body().rotation_degrees = Vector3(0.0, y_rot, 0.0)
func target(position : Vector2): func target(position : Vector2):
var from = camera.project_ray_origin(position) var from = camera.project_ray_origin(position)
var to = from + camera.project_ray_normal(position) * ray_length var to = from + camera.project_ray_normal(position) * ray_length
var space_state = get_world().direct_space_state var space_state = get_body().get_world().direct_space_state
var result = space_state.intersect_ray(from, to, [], 2) var result = space_state.intersect_ray(from, to, [], get_body().collision_mask)
if result: if result:
print(result) if result.collider and result.collider.owner is Entity:
if result.collider and result.collider is Entity: var ent : Entity = result.collider.owner as Entity
var ent : Entity = result.collider as Entity
crequest_target_change(ent.get_path()) crequest_target_change(ent.get_path())
return return
@ -330,12 +329,15 @@ func cmouseover(event):
var from = camera.project_ray_origin(event.position) var from = camera.project_ray_origin(event.position)
var to = from + camera.project_ray_normal(event.position) * ray_length var to = from + camera.project_ray_normal(event.position) * ray_length
var space_state = get_world().direct_space_state var space_state = get_body().get_world().direct_space_state
var result = space_state.intersect_ray(from, to, [], 2) var result = space_state.intersect_ray(from, to, [], get_body().collision_mask)
if result: if result:
if result.collider and result.collider is Entity: if result.collider:# and result.collider.owner is Entity:
var mo : Entity = result.collider as Entity var mo : Entity = result.collider.owner as Entity
if mo == null:
return
if last_mouse_over != null and last_mouse_over != mo: if last_mouse_over != null and last_mouse_over != mo:
if is_instance_valid(last_mouse_over): if is_instance_valid(last_mouse_over):
@ -369,14 +371,14 @@ remote func sset_position(position : Vector3, rotation : Vector3) -> void:
print(str(get_network_master()) + "psset") print(str(get_network_master()) + "psset")
if multiplayer.network_peer and multiplayer.is_network_server(): if multiplayer.network_peer and multiplayer.is_network_server():
vrpc("cset_position", translation, rotation) vrpc("cset_position", position, rotation)
cset_position(position, rotation) cset_position(position, rotation)
remote func cset_position(position : Vector3, rotation : Vector3) -> void: remote func cset_position(position : Vector3, rotation : Vector3) -> void:
if get_network_master() != 1: if get_network_master() != 1:
print(str(get_network_master()) + " pcset") print(str(get_network_master()) + " pcset")
translation = position get_body().translation = position
rotation = rotation get_body().rotation = rotation
func _moved() -> void: func _moved() -> void:
if sis_casting(): if sis_casting():

View File

@ -15,37 +15,38 @@ extents = Vector3( 0.216228, 0.0681041, 0.183397 )
[node name="Player" type="Entity" groups=[ [node name="Player" type="Entity" groups=[
"players", "players",
]] ]]
input_ray_pickable = false body_path = NodePath("Body")
collision_layer = 3 character_skeleton_path = NodePath("Body/Rotation_Helper/Model/character")
collision_mask = 3
character_skeleton_path = NodePath("Rotation_Helper/Model/character")
script = ExtResource( 2 ) script = ExtResource( 2 )
model_path = NodePath("Body/Rotation_Helper/Model")
[node name="Body_CollisionShape" type="CollisionShape" parent="."] [node name="Body" type="KinematicBody" parent="."]
[node name="Body_CollisionShape" type="CollisionShape" parent="Body"]
transform = Transform( 1, 0, 0, 0, -1.62921e-07, -1, 0, 1, -1.62921e-07, 0, 0.73, 0 ) transform = Transform( 1, 0, 0, 0, -1.62921e-07, -1, 0, 1, -1.62921e-07, 0, 0.73, 0 )
shape = SubResource( 1 ) shape = SubResource( 1 )
[node name="Feet_CollisionShape" type="CollisionShape" parent="."] [node name="Feet_CollisionShape" type="CollisionShape" parent="Body"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.1, 0 ) transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.1, 0 )
shape = SubResource( 2 ) shape = SubResource( 2 )
[node name="CameraPivot" type="Spatial" parent="."] [node name="CameraPivot" type="Spatial" parent="Body"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.44092, 0 ) transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.44092, 0 )
script = ExtResource( 4 ) script = ExtResource( 4 )
[node name="Camera" type="Camera" parent="CameraPivot"] [node name="Camera" type="Camera" parent="Body/CameraPivot"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 6.822 ) transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 6.822 )
current = true current = true
fov = 60.0 fov = 60.0
size = 28.0 size = 28.0
far = 1000.0 far = 1000.0
[node name="Rotation_Helper" type="Spatial" parent="."] [node name="Rotation_Helper" type="Spatial" parent="Body"]
transform = Transform( -1, 0, -3.25841e-07, 0, 1, 0, 3.25841e-07, 0, -1, 0, 0, 0 ) transform = Transform( -1, 0, -3.25841e-07, 0, 1, 0, 3.25841e-07, 0, -1, 0, 0, 0 )
[node name="Model" type="Spatial" parent="Rotation_Helper"] [node name="Model" type="Spatial" parent="Body/Rotation_Helper"]
[node name="character" parent="Rotation_Helper/Model" instance=ExtResource( 1 )] [node name="character" parent="Body/Rotation_Helper/Model" instance=ExtResource( 1 )]
[node name="GUILayer" parent="." instance=ExtResource( 3 )] [node name="GUILayer" parent="." instance=ExtResource( 3 )]
[connection signal="onc_open_loot_winow_request" from="." to="GUILayer" method="_on_Player_onc_open_loot_winow_request"] [connection signal="onc_open_loot_winow_request" from="." to="GUILayer" method="_on_Player_onc_open_loot_winow_request"]

View File

@ -50,8 +50,8 @@ func _physics_process(delta):
update_visibility() update_visibility()
func update_visibility() -> void: func update_visibility() -> void:
_query.transform = Transform(Basis(), translation) _query.transform = Transform(Basis(), get_body().translation)
var res : Array = get_world().direct_space_state.intersect_shape(_query) var res : Array = get_body().get_world().direct_space_state.intersect_shape(_query)
#warning-ignore:unassigned_variable #warning-ignore:unassigned_variable
var currenty_sees : Array = Array() var currenty_sees : Array = Array()

View File

@ -570,6 +570,8 @@ level_generator = SubResource( 1 )
voxel_scale = 6.0 voxel_scale = 6.0
chunk_spawn_range = 1 chunk_spawn_range = 1
script = ExtResource( 16 ) script = ExtResource( 16 )
meshes = [ ]
editor_generate = false
show_loading_screen = false show_loading_screen = false
generate_on_ready = true generate_on_ready = true

View File

@ -117,7 +117,7 @@ func attack(delta):
owner.target_movement_direction = Vector2() owner.target_movement_direction = Vector2()
return return
var dir : Vector3 = target.translation - owner.translation var dir : Vector3 = target.get_body().translation - owner.get_body().translation
owner.target_movement_direction = Vector2(dir.x, dir.z) owner.target_movement_direction = Vector2(dir.x, dir.z)

View File

@ -38,7 +38,7 @@ func launch(info : SpellCastInfo, effect : PackedScene, speed : float) -> void:
_speed = speed _speed = speed
# translation = info.caster.translation # translation = info.caster.translation
translation = info.caster.get_character_skeleton().right_hand_attach_point.global_transform.origin get_body().translation = info.caster.get_character_skeleton().right_hand_attach_point.global_transform.origin
var eff : Node = effect.instance() var eff : Node = effect.instance()
@ -53,7 +53,7 @@ func _process(delta : float) -> void:
queue_free() queue_free()
return return
var l : Vector3 = _target.global_transform.origin - translation var l : Vector3 = _target.global_transform.origin - get_body().translation
if l.length() < 1: if l.length() < 1:
_info.spell.son_spell_hit(_info) _info.spell.son_spell_hit(_info)
@ -62,6 +62,6 @@ func _process(delta : float) -> void:
var dir : Vector3 = l.normalized() var dir : Vector3 = l.normalized()
global_transform.origin += dir * _speed * delta get_body().global_transform.origin += dir * _speed * delta
global_transform = transform.looking_at(_target.global_transform.origin, Vector3(0, 1, 0)) get_body().global_transform = get_body().transform.looking_at(_target.global_transform.origin, Vector3(0, 1, 0))

View File

@ -25,7 +25,7 @@ func _sstart_casting(info : SpellCastInfo) -> void:
if info.caster.sis_casting(): if info.caster.sis_casting():
return return
if info.spell.cooldown_global_cooldown and info.caster.gets_has_global_cooldown() or info.caster.hass_category_cooldown(spell_type) or info.caster.hass_cooldown(id): if info.spell.cooldown_global_cooldown_enabled and info.caster.gets_has_global_cooldown() or info.caster.hass_category_cooldown(spell_type) or info.caster.hass_cooldown(id):
return return
if !info.caster.hass_spell(self): if !info.caster.hass_spell(self):