Compare commits

..

16 Commits

Author SHA1 Message Date
Segey Lapin
30ac134af9 Now support modular AI 2022-01-14 22:22:25 +03:00
Segey Lapin
dfbd2f34a5 GUI/AI improvements... 2022-01-09 02:40:04 +03:00
Segey Lapin
fedb6a38e1 AI can 'die' now; blackboard work 2022-01-04 06:45:16 +03:00
Segey Lapin
2573492f59 Implemented combat; disabled palace for now 2021-12-29 01:43:12 +03:00
Segey Lapin
f62e7fa720 Update 2021-12-24 23:56:10 +03:00
Segey Lapin
d401cf1090 Preload more assets 2021-12-09 00:15:02 +03:00
Segey Lapin
18afb81b1f object asset update 2021-12-02 20:31:17 +03:00
Segey Lapin
79247e8e81 Project update 2021-12-02 20:30:18 +03:00
Segey Lapin
1a32732216 Removed town limits 2021-12-02 20:29:34 +03:00
Segey Lapin
48889c5044 Converted to grammar-based approach 2021-12-02 20:28:04 +03:00
Segey Lapin
6e8029c29c Asset improvements 2021-11-23 09:22:18 +03:00
Segey Lapin
8a3b4987e8 Update (nature, engine changes) 2021-11-22 01:09:02 +03:00
Segey Lapin
8bb1c26ecd Startup fixes 2021-11-13 16:54:25 +03:00
Segey Lapin
a96673ceb6 Spawn operation for buildings at block level 2021-11-13 16:53:14 +03:00
Segey Lapin
4ba2898ec2 Added water shader 2021-11-13 16:51:24 +03:00
Segey Lapin
ee1250d5d2 Improved traffic system 2021-11-07 06:24:30 +03:00
225 changed files with 278900 additions and 422744 deletions

View File

@@ -1,38 +1,34 @@
extends Characters_ extends Characters_
# Declare member variables here. Examples:
# var a = 2
# var b = "text"
# Called when the node enters the scene tree for the first time.
# Called every frame. 'delta' is the elapsed time since the previous frame.
#func _process(delta):
onready var female = preload("res://characters/vroid1-female.tscn") onready var female = preload("res://characters/vroid1-female.tscn")
onready var male = preload("res://characters/vroid1-man.tscn") onready var male = preload("res://characters/vroid1-man.tscn")
onready var face_ctrl = preload("res://scenes/face/head_comtrol.tscn") onready var face_ctrl = preload("res://scenes/face/head_comtrol.tscn")
onready var modules = { onready var modules = {
# "physics": load("res://scripts/modules/character_physics.gd"), # "physics": load("res://scripts/modules/character_physics.gd"),
"cmdq": load("res://scripts/modules/cmdq.gd"), "cmdq": preload("res://scripts/modules/cmdq.gd"),
"marker": load("res://scripts/modules/npc_marker.gd"), "marker": preload("res://scripts/modules/npc_marker.gd"),
"sacrifice": load("res://scripts/modules/npc_sacrifice.gd"), "sacrifice": preload("res://scripts/modules/npc_sacrifice.gd"),
"nun": load("res://scripts/modules/npc_nun.gd"), "nun": preload("res://scripts/modules/npc_nun.gd"),
"player": load("res://scripts/modules/player_controls.gd"), "mystress": preload("res://scripts/modules/npc_mystress.gd"),
"player_clothes": load("res://scripts/modules/player_clothes.gd"), "player": preload("res://scripts/modules/player_controls.gd"),
"hurtboxes": load("res://scripts/modules/character_hurtboxes.gd"), "player_clothes": preload("res://scripts/modules/player_clothes.gd"),
"student": load("res://scripts/modules/npc_student.gd") "hurtboxes": preload("res://scripts/modules/character_hurtboxes.gd"),
"student": preload("res://scripts/modules/npc_student.gd"),
"bandit": preload("res://scripts/modules/npc_bandit.gd")
} }
var face_data_path = "res://scenes/face/" var face_data_path = "res://scenes/face/"
var hair_data_path = "res://scenes/hair/" var hair_data_path = "res://scenes/hair/"
var female_faces = [] var female_faces = []
var mesh_female_faces = {}
var male_faces = [] var male_faces = []
var mesh_male_faces = {}
var female_hairs = [] var female_hairs = []
var mesh_female_hairs = {}
var male_hairs = [] var male_hairs = []
var mesh_male_hairs = {}
var hair_materials = [] var hair_materials = []
var data_hair_materials = {}
var name_data = {} var name_data = {}
var rnd var rnd
@@ -42,6 +38,21 @@ var roommates = {}
#var _crowd: DetourCrowdManager #var _crowd: DetourCrowdManager
func _ready(): func _ready():
var capsule_male = CapsuleShape.new()
capsule_male.radius = 0.4
capsule_male.height = 1.12
capsule_male.margin = 0.08
var capsule_female = CapsuleShape.new()
capsule_female.radius = 0.35
capsule_female.height = 0.9
capsule_female.margin = 0.08
CharacterSystemWorld.add_character_scene(female, {}, "female")
CharacterSystemWorld.add_character_scene(male, {}, "male")
for k in modules.keys():
CharacterSystemWorld.add_module(k, modules[k])
CharacterSystemWorld.set_face_ctrl_scene(face_ctrl)
CharacterSystemWorld.add_character_shape(capsule_female, Transform(Basis().rotated(Vector3(1, 0, 0), -PI/2.0), Vector3(0, 0.805, 0)), "female")
CharacterSystemWorld.add_character_shape(capsule_male, Transform(Basis().rotated(Vector3(1, 0, 0), -PI/2.0), Vector3(0, 0.965, 0)), "male")
set_root_motion_mod(Transform()) set_root_motion_mod(Transform())
var fd = File.new() var fd = File.new()
fd.open("res://data/names.json", File.READ) fd.open("res://data/names.json", File.READ)
@@ -56,8 +67,13 @@ func _ready():
match g: match g:
"female": "female":
female_faces.push_back(fp) female_faces.push_back(fp)
mesh_female_faces[fp] = load(fp)
CharacterSystemWorld.add_face_scene(mesh_female_faces[fp], "female")
"male": "male":
male_faces.push_back(fp) male_faces.push_back(fp)
mesh_male_faces[fp] = load(fp)
CharacterSystemWorld.add_face_scene(mesh_male_faces[fp], "male")
for id in range(10000): for id in range(10000):
var fp_m = face_data_path + "male-face" + str(id) + ".tscn" var fp_m = face_data_path + "male-face" + str(id) + ".tscn"
var fp_f = face_data_path + "female-face" + str(id) + ".tscn" var fp_f = face_data_path + "female-face" + str(id) + ".tscn"
@@ -66,14 +82,26 @@ func _ready():
var mat = hair_data_path + "hair" + str(id) + ".tres" var mat = hair_data_path + "hair" + str(id) + ".tres"
if data_fd.file_exists(fp_m): if data_fd.file_exists(fp_m):
male_faces.push_back(fp_m) male_faces.push_back(fp_m)
mesh_male_faces[fp_m] = load(fp_m)
CharacterSystemWorld.add_face_scene(mesh_male_faces[fp_m], "male")
if data_fd.file_exists(fp_f): if data_fd.file_exists(fp_f):
female_faces.push_back(fp_f) female_faces.push_back(fp_f)
mesh_female_faces[fp_f] = load(fp_f)
CharacterSystemWorld.add_face_scene(mesh_female_faces[fp_f], "female")
if data_fd.file_exists(hp_m): if data_fd.file_exists(hp_m):
male_hairs.push_back(hp_m) male_hairs.push_back(hp_m)
mesh_male_hairs[hp_m] = load(hp_m)
CharacterSystemWorld.add_hair_scene(mesh_male_hairs[hp_m], "male")
if data_fd.file_exists(hp_f): if data_fd.file_exists(hp_f):
female_hairs.push_back(hp_f) female_hairs.push_back(hp_f)
mesh_female_hairs[hp_f] = load(hp_f)
CharacterSystemWorld.add_hair_scene(mesh_female_hairs[hp_f], "female")
if data_fd.file_exists(mat): if data_fd.file_exists(mat):
hair_materials.push_back(mat) hair_materials.push_back(mat)
data_hair_materials[mat] = load(mat)
CharacterSystemWorld.add_hair_material(data_hair_materials[mat], "male")
CharacterSystemWorld.add_hair_material(data_hair_materials[mat], "female")
CharacterSystemWorld.create_character_pool(1024)
assert(male_faces.size() > 0) assert(male_faces.size() > 0)
assert(female_faces.size() > 0) assert(female_faces.size() > 0)
assert(male_hairs.size() > 0) assert(male_hairs.size() > 0)
@@ -132,123 +160,36 @@ func get_hair_node(sc: Node) -> Node:
return sc.get_node(e) return sc.get_node(e)
assert(0) assert(0)
return null return null
func compose_kinematic_character(g, enable_modules = [], face = -1, hair = -1, hair_mat = -1): #func compose_kinematic_character(g, enable_modules = [], face = -1, hair = -1, hair_mat = -1):
var body = KinematicBody.new() # var id = create_character_in_pool(
var cshape = CollisionShape.new() # return CharacterSystemWorld.create_character(g, enable_modules, face, hair, hair_mat)
body.add_child(cshape)
var capsule = CapsuleShape.new()
var character_data = {
"sex": g,
"modules": enable_modules
}
var face_scene: PackedScene
var hair_scene: PackedScene
var face_i: Node
var hair_i: Node
var face_node: Node
var hair_node: Node
match g:
"female":
if face == -1:
face = rnd.randi() % female_faces.size()
if hair == -1:
hair = rnd.randi() % female_hairs.size()
face_scene = load(female_faces[face])
hair_scene = load(female_hairs[hair])
capsule.radius = 0.2
capsule.height = 1.1
capsule.margin = 0.05
cshape.translation.x = 0
cshape.translation.y = 0.751
cshape.translation.z = 0
cshape.rotation = Vector3(-PI/2.0, 0, 0)
var i = female.instance()
body.add_child(i)
i.transform = Transform()
face_node = get_face_node(i)
hair_node = get_hair_node(i)
"male":
if face == -1:
face = rnd.randi() % male_faces.size()
if hair == -1:
hair = rnd.randi() % male_hairs.size()
face_scene = load(male_faces[face])
hair_scene = load(male_hairs[hair])
capsule.radius = 0.3
capsule.height = 1.2
capsule.margin = 0.05
cshape.translation.x = 0
cshape.translation.y = 0.899
cshape.translation.z = 0
cshape.rotation = Vector3(-PI/2.0, 0, 0)
var i = male.instance()
body.add_child(i)
i.transform = Transform()
face_node = get_face_node(i)
hair_node = get_hair_node(i)
assert(face_node)
face_i = face_scene.instance()
face_i.add_to_group("face")
prepare_extra_skeleton(face_i, "face")
hair_i = hair_scene.instance()
hair_i.add_to_group("hair")
prepare_extra_skeleton(hair_i, "hair")
if hair_mat == -1:
hair_mat = rnd.randi() % hair_materials.size()
var hmat = load(hair_materials[hair_mat])
assert(hmat)
set_hair_material(hair_i, hmat)
for e in face_node.get_children():
e.queue_free()
for e in hair_node.get_children():
e.queue_free()
face_node.add_child(face_i)
hair_node.add_child(hair_i)
var face_ctrl_i = face_ctrl.instance()
face_ctrl_i.active = true
face_i.add_child(face_ctrl_i)
face_i.set_meta("body", body)
body.set_meta("face_control", face_ctrl_i)
body.set_meta("face_playback", "parameters/state/playback")
face_ctrl_i.add_to_group("face")
face_i.transform = Transform()
character_data.face = face
character_data.hair = hair
character_data.hair_mat = hair_mat
cshape.shape = capsule
body.set_meta("character_data", character_data)
for e in enable_modules:
assert(modules.has(e))
if modules.has(e):
assert(modules[e])
var obj = modules[e].new()
body.add_child(obj)
setup_character_physics(body)
body.add_to_group("character")
return body
func replace_character(obj, g, enable_modules = [], face = -1, hair = -1, hair_mat = -1): func replace_player_character(obj, g, enable_modules = [], face = -1, hair = -1, hair_mat = -1):
assert(obj) assert(obj)
var xform = obj.global_transform var xform = obj.global_transform
var p = obj.get_parent() var p = obj.get_parent()
obj.queue_free() obj.queue_free()
var body = compose_kinematic_character(g, enable_modules, face, hair, hair_mat) CharacterSystemWorld.create_player_character_in_pool(enable_modules, xform)
p.add_child(body) var body = CharacterSystemWorld.create_character_visual(0)
body.global_transform = xform
var orientation = Transform() # var body = compose_kinematic_character(g, enable_modules, face, hair, hair_mat)
orientation.basis = xform.basis # var body = CharacterSystemWorld.create_character(g, enable_modules, face, hair, hair_mat)
body.set_meta("orientation", orientation) # p.add_child(body)
# body.global_transform = xform
# var orientation = Transform()
# orientation.basis = xform.basis
# body.set_meta("orientation", orientation)
return body return body
const basedir = "res://scenes/clothes/" const basedir = "res://scenes/clothes/"
func prepare_extra_skeleton(obj, g): #func prepare_extra_skeleton(obj, g):
var queue = [obj] # var queue = [obj]
while queue.size() > 0: # while queue.size() > 0:
var item = queue.pop_front() # var item = queue.pop_front()
if item is Skeleton: # if item is Skeleton:
item.add_to_group(g) # item.add_to_group(g)
break # break
for g in item.get_children(): # for g in item.get_children():
queue.push_back(g) # queue.push_back(g)
func set_hair_material(hair, mat: Material): func set_hair_material(hair, mat: Material):
assert(mat) assert(mat)
var queue = [hair] var queue = [hair]
@@ -261,7 +202,9 @@ func set_hair_material(hair, mat: Material):
queue.push_back(g) queue.push_back(g)
func setup_garments(obj, garments, garments_head, material): func setup_garments(obj, garments, garments_head, material):
var skel = obj.get_meta("skeleton") var skel = obj.get_meta("skeleton")
assert(skel)
var hair_skel = obj.get_meta("hair_skeleton") var hair_skel = obj.get_meta("hair_skeleton")
assert(hair_skel)
if obj.has_meta("garments"): if obj.has_meta("garments"):
print("Can remove garments") print("Can remove garments")
@@ -597,8 +540,6 @@ func _physics_process(delta):
var player = get_player() var player = get_player()
if !player: if !player:
return return
if player.has_meta("animation_tree") && !player.has_meta("vehicle"): # if player.has_meta("animation_tree") && !player.has_meta("vehicle"):
character_physics(player) # if streaming.can_spawn:
# for e in get_tree().get_nodes_in_group("character") + [player]: # character_physics(player)
# if e && e.has_meta("animation_tree"):
# character_physics(e)

6
autoload/combat.gd Normal file
View File

@@ -0,0 +1,6 @@
extends Node
signal event(ev_name, ev_data)
func _ready():
pass # Replace with function body.

View File

@@ -20,9 +20,9 @@ func _ready():
focus_cam = Camera.new() focus_cam = Camera.new()
add_child(focus_cam) add_child(focus_cam)
focus_cam.set_as_toplevel(true) focus_cam.set_as_toplevel(true)
# var escape_menu = preload("res://ui/save_game.tscn") var escape_menu = preload("res://ui/save_game.tscn")
# menu = escape_menu.instance() menu = escape_menu.instance()
# add_child(menu) add_child(menu)
func is_fps_mode(): func is_fps_mode():
return fps_mode || tmp_fps_mode return fps_mode || tmp_fps_mode

View File

@@ -97,6 +97,7 @@ func freeze_all() -> bool:
assert(ok) assert(ok)
return ok return ok
func _process(delta): func _process(delta):
return
var cam = get_viewport().get_camera() var cam = get_viewport().get_camera()
var player = get_player() var player = get_player()
if !player: if !player:

View File

@@ -29,6 +29,7 @@ func equip(obj, item_name):
return return
print("EQUIP ", item_name) print("EQUIP ", item_name)
assert(obj) assert(obj)
assert(obj.has_meta("owner"))
assert(item_scenes.has(item_name)) assert(item_scenes.has(item_name))
var r = item_scenes[item_name].instance() var r = item_scenes[item_name].instance()
var c = item_collision_scenes[item_name].instance() var c = item_collision_scenes[item_name].instance()
@@ -38,6 +39,8 @@ func equip(obj, item_name):
c.transform = Transform() c.transform = Transform()
print("EQUIP ", item_name, " OK", obj, r) print("EQUIP ", item_name, " OK", obj, r)
obj.set_meta("equipped", item_name) obj.set_meta("equipped", item_name)
c.set_meta("owner", obj.get_meta("owner"))
c.set_meta("item_name", item_name)
func register_pick_up(m, obj, item_name): func register_pick_up(m, obj, item_name):
var mdata = { var mdata = {
"method": "pick_up", "method": "pick_up",

View File

@@ -1,52 +0,0 @@
tool
extends Node
export var noise: OpenSimplexNoise
export var curve: Curve
#
#var points = []
##var rg: RoadGrid
#var setup = false
#
#func _ready():
# if curve:
# curve.bake()
# else:
# curve = Curve.new()
# curve.min_value = -300
# curve.max_value = 300
# curve.add_point(Vector2(0, -300))
# curve.add_point(Vector2(1, 300))
# curve.bake()
# rg.build(curve, noise)
# setup = true
#
#func _init():
# rg = Roads.get_road_grid()
# var center = Vector2(0, 0)
# points.push_back(center)
# randomize()
# var npatches = 8
# var sa = randf() * 2.0 * PI
# var center_count = 15 + randi() % 5
# var center_step = 500
# var centers = []
# while centers.size() < center_count:
# var center_x = clamp(center_step * ((randi() % 100) - 50), -10000, 10000)
# var center_y = clamp(center_step * ((randi() % 100) - 50), -10000, 10000)
# var c = Vector2(center_x, center_y)
# if !c in centers:
# centers.push_back(c)
# for cx in centers:
# for e in range(npatches * 8):
# var a = sa + sqrt(e) * 8.0
# var r = 0 if e == 0 else 100 + e * 100.0 + 50 * randf()
# var x = cos(a) * r + cx.x
# var y = sin(a) * r + cx.y
# var d = Vector2(x, y)
# points.push_back(d)
# print("voronoi start")
# var diagram = Voronoi.generate_diagram(points, 11)
# print("voronoi end, processing")
# rg.process_diagram(diagram)
# print("processing done")

View File

@@ -1,16 +0,0 @@
[gd_scene load_steps=4 format=2]
[ext_resource path="res://autoload/map.gd" type="Script" id=1]
[sub_resource type="OpenSimplexNoise" id=2]
[sub_resource type="Curve" id=1]
min_value = -300.0
max_value = 300.0
bake_resolution = 200
_data = [ Vector2( 0, -259.615 ), 0.0, 0.0, 0, 0, Vector2( 0.975, 300 ), 0.0, 0.0, 0, 0 ]
[node name="Map" type="Node"]
script = ExtResource( 1 )
noise = SubResource( 2 )
curve = SubResource( 1 )

197
autoload/orchestration.gd Normal file
View File

@@ -0,0 +1,197 @@
extends Node
export var grab_ik_curve: Curve
export var grab_ik_curve_multiplier: float = 0.14
export var cinematic_cam: PackedScene
# Declare member variables here. Examples:
# var a = 2
# var b = "text"
# Called when the node enters the scene tree for the first time.
var cinematic_camera
func _ready():
pass # Replace with function body.
var active_states = []
var locked_actors = {}
class Grabbing:
signal enable_cinematic_camera(where, look)
signal update_cinematic_camera(where, look)
signal disable_cinematic_camera
signal end_stage
var actor_master: KinematicBody
var actor_slave: KinematicBody
var slave_space: RID
var master_space: RID
var finished = false
var follow_node
var follow_node_full
var state = 0
var ik: SkeletonIK
var ik_curve_pos = 0.0
var grab_ik_curve: Curve
var curve_delta_mul: float = 0.16
func start(act_master: KinematicBody, act_slave: KinematicBody, curve: Curve, delta_mul: float):
actor_master = act_master
actor_slave = act_slave
grab_ik_curve = curve
curve_delta_mul = delta_mul
var skel_master = actor_master.get_meta("skeleton")
assert(skel_master is Skeleton)
ik = SkeletonIK.new()
ik.root_bone = "J_Bip_R_UpperArm"
ik.tip_bone = "J_Bip_R_Hand"
skel_master.add_child(ik)
# actor_master.set_meta("orchestrated", true)
# actor_slave.set_meta("orchestrated", true)
# characters.animation_node_travel(actor_master, "grab")
# characters.animation_node_travel(actor_slave, "grabbed")
reset_character(actor_master)
reset_character(actor_slave)
var mx = actor_master.global_transform
var sx = actor_slave.global_transform
var m = mx.interpolate_with(sx, 0.5)
var cam_where = m.origin + actor_master.global_transform.basis[0] * 1.1
cam_where += Vector3.UP * 2.0
var cam_to = m.origin + Vector3.UP * 1.4
emit_signal("enable_cinematic_camera", cam_where, cam_to)
func reset_character(b):
assert(b)
b.remove_meta("cmdqueue")
b.remove_meta("cmdq_walk")
b.remove_meta("climb")
characters.animation_node_travel(b, "locomotion")
characters.set_walk_speed(b, 0.0, 0)
func update(delta):
var mx = actor_master.global_transform
var sx = actor_slave.global_transform
var m = mx.interpolate_with(sx, 0.5)
var cam_where = m.origin + actor_master.global_transform.basis[0] * 1.1
cam_where += Vector3.UP * 2.0
var cam_to = m.origin + Vector3.UP * 1.4
emit_signal("update_cinematic_camera", cam_where, cam_to)
func physics_update(delta):
var offt = actor_slave.global_transform.origin - actor_slave.global_transform.basis[2] * 0.45
match state:
0:
reset_character(actor_master)
reset_character(actor_slave)
actor_master.set_meta("orchestrated", true)
actor_slave.set_meta("orchestrated", true)
actor_master.add_collision_exception_with(actor_slave)
actor_slave.add_collision_exception_with(actor_master)
slave_space = PhysicsServer.body_get_space(actor_slave.get_rid())
PhysicsServer.body_set_space(actor_slave.get_rid(), RID())
master_space = PhysicsServer.body_get_space(actor_master.get_rid())
PhysicsServer.body_set_space(actor_master.get_rid(), RID())
state = 1
1:
# actor_slave.get_parent().remove_child(actor_slave)
# actor_master.add_child(actor_slave)
var skel_master = actor_master.get_meta("skeleton")
assert(skel_master is Skeleton)
var skel_slave = actor_slave.get_meta("skeleton")
assert(skel_slave is Skeleton)
follow_node_full = skel_slave.get_node("neck/marker_neck_grab")
follow_node = Position3D.new()
skel_master.add_child(follow_node)
follow_node.global_transform = follow_node_full.global_transform
ik.target_node = ik.get_path_to(follow_node)
ik.override_tip_basis = true
ik.interpolation = 0.0
ik_curve_pos = 0.0
actor_master.global_transform = Transform(actor_slave.global_transform.basis.rotated(Vector3.UP, PI), offt)
var master_xform = actor_master.global_transform.looking_at(actor_slave.global_transform.origin, Vector3.UP)
var slave_xform = actor_slave.global_transform.looking_at(actor_master.global_transform.origin, Vector3.UP)
var orientation = Transform(actor_slave.global_transform.basis, Vector3())
actor_slave.set_meta("orientation", orientation)
var master_orientation = Transform(actor_master.global_transform.basis, Vector3())
actor_master.set_meta("orientation", master_orientation)
characters.animation_node_travel(actor_master, "grab")
characters.animation_node_travel(actor_slave, "grabbed")
ik.start(true)
state = 3
3:
ik.interpolation = grab_ik_curve.interpolate_baked(ik_curve_pos)
ik_curve_pos += delta * curve_delta_mul
follow_node.global_transform = follow_node_full.global_transform
ik.start(true)
if ik.interpolation >= 1.0:
state = 4
4:
var m_anim: AnimationTree = actor_master.get_meta("animation_tree")
var m_state: AnimationNodeStateMachinePlayback = m_anim["parameters/state/playback"]
var m_l = m_state.get_current_length()
var m_p = m_state.get_current_play_position()
var s_anim: AnimationTree = actor_slave.get_meta("animation_tree")
var s_state: AnimationNodeStateMachinePlayback = s_anim["parameters/state/playback"]
var s_l = m_state.get_current_length()
var s_p = m_state.get_current_play_position()
if m_p >= m_l && s_p >= s_l:
state = 5
# 2:
# actor_slave.global_transform = Transform(actor_master.global_transform.basis.rotated(Vector3.UP, PI), offt)
# var orientation = Transform(actor_slave.global_transform.basis, Vector3())
# actor_slave.set_meta("orientation", orientation)
# state = 3
# 3:
# actor_slave.global_transform = Transform(actor_master.global_transform.basis.rotated(Vector3.UP, PI), offt)
# var orientation = Transform(actor_slave.global_transform.basis, Vector3())
# actor_slave.set_meta("orientation", orientation)
# state = 4
func finish():
pass
func enable_camera(where, to):
var current_cam = get_viewport().get_camera()
var player = current_cam.get_meta("player")
if !cinematic_camera:
cinematic_camera = cinematic_cam.instance()
var cam: Camera = cinematic_camera.get_node("rot_y/rot_x/SpringArm/camera_offset/Camera")
var cam_offset = cinematic_camera.get_node("rot_y/rot_x/SpringArm/camera_offset")
cam.set_meta("player", player)
cam.set_meta("current_cam", current_cam)
cinematic_camera.set_meta("cam", cam)
cinematic_camera.set_meta("offset", cam_offset)
get_viewport().add_child(cinematic_camera)
cinematic_camera.global_transform.origin = where
# cam_offset.global_transform.origin = where
cam.current = true
cam.look_at(to, Vector3.UP)
func update_camera(where, to):
var cam = cinematic_camera.get_meta("cam")
var cam_offset = cinematic_camera.get_meta("offset")
cam_offset.global_transform.origin = where
cam.look_at(to, Vector3.UP)
func grab(actor_master, actor_slave):
var gr = Grabbing.new()
gr.connect("enable_cinematic_camera", self, "enable_camera")
gr.connect("update_cinematic_camera", self, "update_camera")
gr.start(actor_master, actor_slave, grab_ik_curve, grab_ik_curve_multiplier)
active_states.push_back(gr)
func _physics_process(delta):
var completed = []
for e in active_states:
e.physics_update(delta)
if e.finished:
completed.push_back(e)
for d in completed:
active_states.erase(d)
func _process(delta):
var completed = []
for e in active_states:
e.update(delta)
if e.finished:
completed.push_back(e)
for d in completed:
active_states.erase(d)

View File

@@ -0,0 +1,13 @@
[gd_scene load_steps=4 format=2]
[ext_resource path="res://autoload/orchestration.gd" type="Script" id=1]
[ext_resource path="res://camera/cinematic_cam.tscn" type="PackedScene" id=2]
[sub_resource type="Curve" id=1]
_data = [ Vector2( 0, 0 ), 0.0, 0.0, 0, 0, Vector2( 0.675, 0 ), 0.0, 0.0, 0, 0, Vector2( 0.89079, 0.881818 ), 4.07459, 4.07459, 0, 0, Vector2( 0.988158, 1 ), 6.47137e-07, 0.0, 0, 0 ]
[node name="orchestration" type="Node"]
script = ExtResource( 1 )
grab_ik_curve = SubResource( 1 )
grab_ik_curve_multiplier = 0.25
cinematic_cam = ExtResource( 2 )

View File

@@ -1,4 +1,5 @@
extends Node extends Node
signal spawn_player(xform)
# Declare member variables here. Examples: # Declare member variables here. Examples:
@@ -11,7 +12,61 @@ func _ready():
pass # Replace with function body. pass # Replace with function body.
var save_data = {} var save_data = {}
var camp: Node
var camp_site: int = -1
var camp_level: int = 0
var bandits_count: int = 0
var camp_dwellings = {}
func prepare_save_data():
var cam = get_tree().root.get_camera()
var player = cam.get_meta("player")
if player:
save_data.player_xform = var2str(player.global_transform)
save_data.player_stats = player.get_meta("stats")
save_data.world = RoadsData.save_data()
# save_data.dialogue = Dialogic.export()
# save_data.scenery = scenery
# state_list.save()
# if save_data.dormitory.has("quests"):
# print(save_data.dormitory.quests.running)
# save_data.prologue = prologue_state.save()
save_data.inventory = inventory.items
# save_data.dormitory = dormitory_state.save()
# save_data.roommates = characters.roommates
# save_data.player_room_id = player.get_meta("room_id")
# save_data.quests = questman.save()
save_data.traffic_state = streaming.traffic_rnd.state
var b = freezer.prepare_save_data()
while b == false:
yield(get_tree(), "idle_frame")
b = freezer.prepare_save_data()
save_data.camp_level = camp_level
save_data.bandits_count = bandits_count
save_data.camp_dwellings = var2str(camp_dwellings)
# Called every frame. 'delta' is the elapsed time since the previous frame. # Called every frame. 'delta' is the elapsed time since the previous frame.
#func _process(delta): #func _process(delta):
# pass # pass
func restart_scene():
var cam = get_viewport().get_camera()
if cam && cam.has_meta("player"):
var player = cam.get_meta("player")
if player:
player.remove_meta("cam")
player.remove_meta("fps_cam")
player = null
get_viewport().get_camera().remove_meta("player")
if save_data.has("inventory"):
inventory.items = save_data.inventory
var new_scene = load("res://world.tscn")
streaming.done = false
if save_data.has("camp_level"):
camp_level = save_data.camp_level
if save_data.has("bandits_count"):
bandits_count = save_data.bandits_count
if save_data.has("camp_dwellings"):
camp_dwellings = str2var(save_data.camp_dwellings)
get_tree().change_scene_to(new_scene)
var player_spawned = false
var castle1_captured = false

View File

@@ -1,12 +1,14 @@
extends Node extends Node
signal character_ready
export var trailer_house: PackedScene export var trailer_house: PackedScene
export var palace: PackedScene export var palace: PackedScene
export var car: PackedScene export var car: PackedScene
onready var obj_names = { onready var obj_names = {
"palace": palace, "palace": palace,
"trailer_house": trailer_house "trailer_house": trailer_house,
} }
var done = false var done = false
@@ -34,6 +36,9 @@ var gate_top_tile: PackedScene = preload("res://objects/gate-top.scn")
var entry_tile: PackedScene = preload("res://objects/block-room-entry.scn") var entry_tile: PackedScene = preload("res://objects/block-room-entry.scn")
var roof_tile: PackedScene = preload("res://objects/roof.scn") var roof_tile: PackedScene = preload("res://objects/roof.scn")
var tower_roof_tile: PackedScene = preload("res://objects/tower-roof.scn") var tower_roof_tile: PackedScene = preload("res://objects/tower-roof.scn")
var courtroom: PackedScene = preload("res://objects/courtroom.tscn")
var bandit_camp: PackedScene = preload("res://bandit_camp.tscn")
var hostile_dwelling: PackedScene = preload("res://hostile_dwelling.tscn")
onready var palace_map_data = { onready var palace_map_data = {
"courtyard_tile": courtyard_tile, "courtyard_tile": courtyard_tile,
@@ -46,108 +51,21 @@ onready var palace_map_data = {
"gate_top_tile": gate_top_tile, "gate_top_tile": gate_top_tile,
"entry_tile": entry_tile, "entry_tile": entry_tile,
"roof_tile": roof_tile, "roof_tile": roof_tile,
"tower_roof_tile": tower_roof_tile "tower_roof_tile": tower_roof_tile,
"courtroom": courtroom,
} }
onready var buildings = {
"trailer_house": preload("res://buildings/trailer-house.gd").new(),
}
#class radial_grid: func spawn_building(bname: String, xform: Transform) -> void:
# var radial_points = [] if !buildings.has(bname):
# var max_r = 0.0 return
# var grid = [] var objects = buildings[bname].build_house(xform)
# var width: int = 0 spawn_house_objects(xform, objects)
# var height: int = 0
# var nodes = []
# func build(poly, center):
# var height = center.y
# max_r = 0.0
# for p in range(poly.size()):
# var ep1 = poly[p]
# ep1.y = height
# var ep2 = poly[(p + 1) % poly.size()]
# ep2.y = height
# var d = (ep2 - ep1).normalized()
# radial_points.push_back(ep1)
# var dst = ep1.distance_to(ep2)
# while dst > 32:
# ep1 += d * 32
# radial_points.push_back(ep1)
# dst -= 32
# for p in range(radial_points.size()):
# var ep = radial_points[p]
# var dst = ep.distance_to(center)
# if max_r < dst:
# max_r = dst
# width = radial_points.size()
# height = int(max_r / 32)
# grid.resize(width * height)
# for p in range(width):
# var start = radial_points[p]
# var end = center
# var step = (end - start).normalized() * (end - start).length() / float(height + 1)
# var val = start
# for q in range(height):
# grid[p * height + q] = {"position": val, "node": null}
# func get_grid_node(x, y):
# return grid[x * height + y].node
# func set_grid_node(x, y, node):
# if !node in nodes:
# nodes.push_back(node)
# grid[x * height + y].node = node
# func place_grid(aabb: AABB, node) -> void:
# for u in range(width):
# for v in range(height):
# if aabb.has_point(grid[u * height + v].position):
# set_grid_node(u, v, node)
# func get_pos(x, y):
# return grid[x * height + y].position
# onready var grid = radial_grid.new()
#func debug_poly(poly):
# for k in range(poly.size()):
# var p1 = poly[k]
# var p2 = poly[(k + 1) % poly.size()]
# var l = p1.distance_to(p2)
# var d = (p2 - p1).normalized()
# var pt = p1
# while l > 0.0:
# for e in range(0, 30, 2):
# var mi = MeshInstance.new()
# mi.mesh = CubeMesh.new()
# get_tree().root.add_child(mi)
# mi.global_transform.origin = pt + Vector3(0, e, 0)
# pt += d * 5.0
# l -= 5.0
#
#func calc_border(poly, offt):
# var height = RoadsData.get_site_avg_height(0)
# var border = []
# border.resize(poly.size())
# for k in range(poly.size()):
# var i = k - 1
# if i < 0:
# i += poly.size()
# var p1 = poly[i]
# var p2 = poly[k]
# var p3 = poly[(k + 1) % poly.size()]
# var p1x = Vector2(p1.x, p1.z)
# var p2x = Vector2(p2.x, p2.z)
# var p3x = Vector2(p2.x, p2.z)
# var p4x = Vector2(p3.x, p3.z)
# var n1 = (p2x - p1x).tangent().normalized()
# var n2 = (p4x - p3x).tangent().normalized()
# p1x -= n1 * offt
# p2x -= n1 * offt
# p3x -= n2 * offt
# p4x -= n2 * offt
#
# var xp = Geometry.segment_intersects_segment_2d(p1x, p2x, p3x, p4x)
# if !xp:
# xp = p2x.linear_interpolate(p3x, 0.5) - (n1 + n2).normalized() * offt
# var tp = Vector3(xp.x, height, xp.y)
# border[k] = tp
# return border
#
var traffic_rnd: RandomNumberGenerator var traffic_rnd: RandomNumberGenerator
var traffic_astar: AStar var traffic_astar: AStar
var towns = 0 var towns = 0
@@ -168,7 +86,8 @@ func setup_town(site):
center += p center += p
center /= poly.size() center /= poly.size()
center.y = height center.y = height
# grid.build(border2, center) var infl = RoadsData.get_influence_cached(center.x, center.y, 256)
center.y = infl.y
var radial_points = RoadsData.get_site_radial_points(site, 32.0, 64.0) var radial_points = RoadsData.get_site_radial_points(site, 32.0, 64.0)
var max_r = 0.0 var max_r = 0.0
for p in range(radial_points.size()): for p in range(radial_points.size()):
@@ -178,24 +97,33 @@ func setup_town(site):
max_r = dst max_r = dst
for p in range(radial_points.size()): for p in range(radial_points.size()):
var ep = radial_points[p] var ep = radial_points[p]
var miff = RoadsData.get_influence_cached(ep.x, ep.z, 256.0)
ep.y = center.y
var d = (center - ep).normalized() var d = (center - ep).normalized()
assert(d.length_squared() > 0)
var dst = ep.distance_to(center) var dst = ep.distance_to(center)
print(dst) print(dst)
if dst < 64.0 + 12 + 8 + 4: if dst < 64.0 + 12 + 8 + 4:
continue continue
var step = 16.0 var step = 32.0
var pstart = ep var pstart = ep + d * 32.0
dst -= 32.0
while dst > 0.0: while dst > 0.0:
var ok = true var ok = true
if !Geometry.is_point_in_polygon(Vector2(pstart.x, pstart.z), poly2): miff = RoadsData.get_influence_cached(pstart.x, pstart.z, 256.0)
if miff.x > 0.0:
ok = false ok = false
if ok:
pstart.y = miff.y
if !Geometry.is_point_in_polygon(Vector2(pstart.x, pstart.z), poly2):
ok = false
if ok: if ok:
for b in aabbs: for b in aabbs:
if b.has_point(pstart): if b.has_point(pstart):
ok = false ok = false
if ok: if ok:
var xform = Transform(Basis(), pstart).looking_at(pstart + d, Vector3.UP) var xform = Transform(Basis(), pstart).looking_at(pstart + d, Vector3.UP)
stream_obj("trailer_house", xform) spawn_building("trailer_house", xform)
var aabb = AABB(pstart, Vector3()) var aabb = AABB(pstart, Vector3())
aabb = aabb.grow(32) aabb = aabb.grow(32)
aabbs.push_back(aabb) aabbs.push_back(aabb)
@@ -204,13 +132,13 @@ func setup_town(site):
dst -= step dst -= step
towns += 1 towns += 1
func setup_first_town(): func setup_first_town(site):
assert(!done) assert(!done)
var poly = RoadsData.get_site_polygon_3d(0) var poly = RoadsData.get_site_polygon_3d(site)
var height = RoadsData.get_site_avg_height(0) var height = RoadsData.get_site_avg_height(site)
var border = RoadsData.get_site_border(0, 32) var border = RoadsData.get_site_border(site, 32)
var border1a = RoadsData.get_site_border(0, 42) var border1a = RoadsData.get_site_border(site, 42)
var border2 = RoadsData.get_site_border(0, 60) var border2 = RoadsData.get_site_border(site, 60)
var poly2 = [] var poly2 = []
poly2.resize(border2.size()) poly2.resize(border2.size())
@@ -221,8 +149,10 @@ func setup_first_town():
center += p center += p
center /= poly.size() center /= poly.size()
center.y = height center.y = height
# grid.build(border2, center) var infl = RoadsData.get_influence_cached(center.x, center.z, 256)
var radial_points = RoadsData.get_site_radial_points(0, 32.0, 64.0) center.y = infl.y
print("first town center: ", center)
var radial_points = RoadsData.get_site_radial_points(site, 32.0, 64.0)
var max_r = 0.0 var max_r = 0.0
for p in range(radial_points.size()): for p in range(radial_points.size()):
var ep = radial_points[p] var ep = radial_points[p]
@@ -245,28 +175,38 @@ func setup_first_town():
palace_aabb = palace_aabb.grow(48) palace_aabb = palace_aabb.grow(48)
print(palace_aabb) print(palace_aabb)
aabbs.push_back(palace_aabb) aabbs.push_back(palace_aabb)
stream_obj("palace", Transform(Basis(), center)) # stream_obj("palace", Transform(Basis(), center))
for p in range(radial_points.size()): for p in range(radial_points.size()):
var ep = radial_points[p] var ep = radial_points[p]
var miff = RoadsData.get_influence_cached(ep.x, ep.z, 256.0)
ep.y = center.y
var d = (center - ep).normalized() var d = (center - ep).normalized()
assert(d.length_squared() > 0)
var dst = ep.distance_to(center) var dst = ep.distance_to(center)
print(dst) print(dst)
if dst < 64.0 + 12 + 8 + 4: if dst < 64.0 + 12 + 8 + 4:
continue continue
var step = 16.0 var step = 32.0
var pstart = ep var pstart = ep + d * 32.0
dst -= 32.0
while dst > 0.0: while dst > 0.0:
var ok = true var ok = true
if !Geometry.is_point_in_polygon(Vector2(pstart.x, pstart.z), poly2): miff = RoadsData.get_influence_cached(pstart.x, pstart.z, 256.0)
if miff.x > 0.0:
ok = false ok = false
if ok:
pstart.y = miff.y
if !Geometry.is_point_in_polygon(Vector2(pstart.x, pstart.z), poly2):
ok = false
if ok: if ok:
for b in aabbs: for b in aabbs:
if b.has_point(pstart): if b.has_point(pstart):
ok = false ok = false
if ok: if ok:
var xform = Transform(Basis(), pstart).looking_at(pstart + d, Vector3.UP) var xform = Transform(Basis(), pstart).looking_at(pstart + d, Vector3.UP)
stream_obj("trailer_house", xform) # stream_obj("trailer_house", xform)
spawn_building("trailer_house", xform)
var aabb = AABB(pstart, Vector3()) var aabb = AABB(pstart, Vector3())
aabb = aabb.grow(32) aabb = aabb.grow(32)
aabbs.push_back(aabb) aabbs.push_back(aabb)
@@ -285,12 +225,14 @@ func setup_traffic(site):
var n = (p2 - p1).cross(Vector3.UP).normalized() var n = (p2 - p1).cross(Vector3.UP).normalized()
var t = (p2 - p1).normalized() var t = (p2 - p1).normalized()
var l = p1.distance_to(p2) var l = p1.distance_to(p2)
assert(l > 0)
assert(t.length_squared() > 0)
var xpos = p1 + t * 8.0 var xpos = p1 + t * 8.0
var xe = 128.0 var xe = 128.0
if l < xe + 16.0: if l < xe + 16.0:
xpos = p1.linear_interpolate(p2, 0.5) xpos = p1.linear_interpolate(p2, 0.5)
var x = xpos + n * 1.5 + Vector3.UP * 0.5 var x = xpos
var xform = Transform(Basis(), x).looking_at(x + t * 3.0, Vector3.UP) var xform = Transform(Basis(), x).looking_at(x - t * 3.0, Vector3.UP)
var c = Spatial.new() var c = Spatial.new()
lp.add_child(c) lp.add_child(c)
c.transform = xform c.transform = xform
@@ -299,8 +241,8 @@ func setup_traffic(site):
c.add_to_group("traffic_spawn") c.add_to_group("traffic_spawn")
else: else:
while l > xe + 16.0: while l > xe + 16.0:
var x = xpos + n * 4.0 + Vector3.UP * 0.5 var x = xpos
var xform = Transform(Basis(), x).looking_at(x + t * 3.0, Vector3.UP) var xform = Transform(Basis(), x).looking_at(x - t * 3.0, Vector3.UP)
var c = Spatial.new() var c = Spatial.new()
lp.add_child(c) lp.add_child(c)
c.transform = xform c.transform = xform
@@ -309,7 +251,6 @@ func setup_traffic(site):
c.add_to_group("traffic_spawn") c.add_to_group("traffic_spawn")
xpos += t * xe xpos += t * xe
l -= xe l -= xe
func _ready(): func _ready():
traffic_rnd = RandomNumberGenerator.new() traffic_rnd = RandomNumberGenerator.new()
traffic_rnd.randomize() traffic_rnd.randomize()
@@ -333,9 +274,17 @@ func _ready():
} }
for k in parts.keys(): for k in parts.keys():
Spawner.add_scene(k, parts[k]) Spawner.add_scene(k, parts[k])
# Traffic.set_min_spawn_distance(50.0)
# Traffic.set_deny_physics()
# Traffic.set_physics_distance(Vector3(30, -10, 40))
# Traffic.set_debug(true)
Traffic.set_spawn_cooldown(10, 15)
Traffic.set_default_speed(8.5)
Traffic.add_traffic_vehicle(car) Traffic.add_traffic_vehicle(car)
var water_mat = load("res://water/Water.material")
Water.set_material(water_mat)
connect("character_ready", self, "char_ready")
# Called every frame. 'delta' is the elapsed time since the previous frame.
var delay = 3.0 var delay = 3.0
var state = 0 var state = 0
func _process(delta): func _process(delta):
@@ -345,7 +294,7 @@ func _process(delta):
if delay < 0: if delay < 0:
state = 1 state = 1
1: 1:
Spawner.update_view(self, 200) # Spawner.update_view(self, 200)
var sc = get_tree().root var sc = get_tree().root
var viewport: = get_viewport() var viewport: = get_viewport()
if !viewport: if !viewport:
@@ -355,262 +304,74 @@ func _process(delta):
return return
var cam_xform: = cam.global_transform var cam_xform: = cam.global_transform
# building parts # building parts
call_deferred("real_spawn_child") # call_deferred("real_spawn_child")
func stream_obj(obj: String, xform: Transform): func stream_obj(obj: String, xform: Transform):
Spawner.place_scene(obj, xform) Spawner.place_scene(obj, xform)
func switch_to_distant_vehicle(n): var can_spawn = false
var sp = PhysicsServer.body_get_space(n.get_rid()) func char_ready():
var l = n.get_linear_velocity() can_spawn = true
n.set_meta("velocity", l)
n.set_meta("space", sp)
PhysicsServer.body_set_space(n.get_rid(), RID())
func switch_to_close_vehicle(n):
var sp = n.get_meta("space")
PhysicsServer.body_set_space(n.get_rid(), sp)
n.remove_meta("space")
if n.has_meta("velocity"):
n.set_linear_velocity(n.get_meta("velocity"))
n.remove_meta("velocity")
func _physics_process(delta): func _physics_process(delta):
var cam = get_viewport().get_camera() var cam = get_viewport().get_camera()
if !cam: if !cam:
return return
match state: match state:
1: 1:
# convert to distant traffic here
for n in get_tree().get_nodes_in_group("traffic_vehicle"):
var p1 = cam.global_transform.origin
var p2 = n.global_transform.origin
var check_coords = cam.global_transform.xform_inv(p2)
var steer = 0.0
var x_target = Vector3()
var next_target = Vector3()
var orientation = n.global_transform
orientation.origin = Vector3()
var direction = orientation.xform(Vector3(0, 0, -1))
var good_path = false
var engine_force = n.engine_force
if !n.has_meta("curve"):
create_path(n, p2, direction * 10.0)
if n.has_meta("curve"):
var curve = n.get_meta("curve")
if curve.get_point_count() > 0:
var plength = n.get_meta("curve_length")
var offt = curve.get_closest_offset(p2)
var offt_ext = 8.0
if n.has_meta("velocity"):
offt_ext = n.get_meta("velocity").length()
offt = clamp(offt + offt_ext, 0, plength)
var p0 = curve.interpolate_baked(offt, false)
next_target = p0
if false: # p0.distance_squared_to(p2) > 16.0:
n.remove_meta("curve")
steer = 0.0
x_target = Vector3()
next_target = p2 + direction * 4.0
else:
var xt0 = n.global_transform.xform_inv(p0)
x_target = xt0
if xt0.z < 0.0:
steer = xt0.x
if steer == 0.0:
steer = -1
else:
steer = x_target.x
steer = sign(steer)
# if abs(steer) < 0.005:
# steer = 0.0
n.set_meta("x_target", x_target)
print("position: ", p2, " direction: ", direction, " next_target: ", next_target, " x_target: ", x_target, " steer: ", steer, " ! ", (next_target - p2).normalized())
else:
assert(false)
# if check_coords.z > 160 || check_coords.z < -120 || abs(check_coords.x) > 100:
# n.queue_free()
if false: # check_coords.z > 40.0 || check_coords.z < -25.0 || abs(check_coords.x) > 20.0:
if !n.has_meta("space"):
switch_to_distant_vehicle(n)
var xvel = (next_target - p2).normalized() * 6.0
n.set_meta("velocity", xvel)
var pos = n.global_transform.origin
var vel = (next_target - p2).normalized() * 6.0
if n.has_meta("velocity"):
vel = n.get_meta("velocity")
var speed = vel.length()
var stf = (next_target - pos).normalized() * speed
# stf.y = vel.y
vel = vel.linear_interpolate(stf, delta)
var target_pos = pos + vel
# vel.y = vel.y * delta
var newpos = pos.linear_interpolate(target_pos, delta)
n.set_meta("velocity", vel)
# why?
var xform = Transform(Basis(), newpos).looking_at(newpos - vel * 4.0, Vector3.UP)
n.global_transform = xform
else:
if n.has_meta("space"):
switch_to_close_vehicle(n)
var v = n.get_linear_velocity()
n.set_meta("velocity", v)
var l = v.length()
# if abs(steer) > 3.0 || !good_path:
# # vehicle totally lost
# n.brake = 60000
# n.engine_force = 0
# elif abs(steer) > 2.0:
# # vehicle lost
# n.engine_force = 0
if next_target.length_squared() == 0:
engine_force = 0.0
steer = 0.0
else:
if abs(steer) > 3.0:
engine_force *= 0.9
engine_force = clamp(engine_force, 2500.0, max(2500, engine_force))
else:
if abs(steer) > 4.0 && l > 5.0:
engine_force = engine_force * 0.9996
if l > 7.0:
engine_force = engine_force * 0.9996
elif l < 1.1:
engine_force = clamp(engine_force * 1.004, 6000, 8000)
elif l < 2.5:
engine_force = clamp(engine_force * 1.002, 5000, 7000)
elif l < 5.0:
engine_force = clamp(engine_force * 1.001, 4000, 6000)
elif l < 6.0:
engine_force = clamp(engine_force * 1.001, 3000, 5000)
# engine_force = 0.0
engine_force = clamp(engine_force, 0, 8500)
print("engine_force: ", engine_force)
n.engine_force = engine_force
n.brake = 0
# n.steering = clamp(steer, -1, 1)
var base_steering = n.steering
var main_steering = base_steering * 0.95 + steer * 0.05
n.steering = clamp(main_steering, -1, 1)
n.set_meta("steering", n.steering)
var space_state = get_viewport().get_world().direct_space_state var space_state = get_viewport().get_world().direct_space_state
# probaly should not be here # probaly should not be here
for n in get_tree().get_nodes_in_group("spawn"): if can_spawn:
var ok = false for n in get_tree().get_nodes_in_group("spawn"):
if !n.is_in_group("keep"): var ok = false
var where = n.get_global_transform().origin # if !n.is_in_group("keep"):
var from = where # var where = n.get_global_transform().origin
var to = where # var from = where
from.y -= 8.0 # var to = where
to.y += 8.0 # from.y -= 8.0
var result = space_state.intersect_ray(from, to) # to.y += 8.0
if result.empty() || !result.has("collider"): # var result = space_state.intersect_ray(from, to)
continue # if result.empty() || !result.has("collider"):
if result.collider: # continue
n.global_transform.origin = result.position # if result.collider:
ok = true # n.global_transform.origin = result.position
if ok || n.is_in_group("keep"): # ok = true
if n.is_in_group("male"): ok = true
characters.replace_character(n, "male", ["cmdq", "marker", "hurtboxes", "student"]) if ok || n.is_in_group("keep"):
elif n.is_in_group("female"): var base = ["cmdq", "marker", "hurtboxes"]
characters.replace_character(n, "female", ["cmdq", "marker", "hurtboxes", "student"]) var g = ""
elif n.is_in_group("car"): if n.is_in_group("male"):
var p1 = cam.global_transform.origin g = "male"
var p2 = n.global_transform.origin elif n.is_in_group("female"):
if p1.distance_squared_to(p2) < 5000.0: g = "female"
var c = car.instance() if n.is_in_group("mystress"):
c.add_to_group("saved_vehicle") base.push_back("mystress")
var p = get_tree().root if n.is_in_group("student"):
p.add_child(c) base.push_back("student")
c.global_transform = n.global_transform elif n.is_in_group("bandit"):
base.push_back("bandit")
if g.length() > 0:
print(g, " ", base)
CharacterSystemWorld.create_character_in_pool(g, base, n.global_transform)
n.queue_free() n.queue_free()
# elif n.is_in_group("traffic_spawn"): elif n.is_in_group("car"):
# var p1 = cam.global_transform.origin var p1 = cam.global_transform.origin
# var p2 = n.global_transform.origin var p2 = n.global_transform.origin
# if !n.has_meta("cooldown") && p1.distance_squared_to(p2) < 10000.0: if p1.distance_squared_to(p2) < 5000.0:
# var c = car.instance() var c = car.instance()
# c.add_to_group("traffic_vehicle") c.add_to_group("saved_vehicle")
# var p = get_tree().root var p = get_tree().root
# p.add_child(c) p.add_child(c)
# c.global_transform = n.global_transform c.global_transform = n.global_transform
# c.parked = false n.queue_free()
# c.mode = c.MODE_RIGID
# c.engine_force = 2500
# c.steering = 0
# var xf = c.global_transform
# xf.origin = Vector3()
# var vel = xf.xform(Vector3(0, 0, -10))
# c.set_linear_velocity(vel)
# var sp = PhysicsServer.body_get_space(c.get_rid())
# c.set_meta("space", sp)
# PhysicsServer.body_set_space(c.get_rid(), RID())
# n.set_meta("cooldown", 2.0 + randi() % 8)
# # create_path(c, p2, vel)
# elif n.has_meta("cooldown"):
# var cd = n.get_meta("cooldown")
# cd -= delta
# if cd < 0:
# n.remove_meta("cooldown")
func get_curve_closest(curve, p2):
var test_offt = curve.get_closest_offset(p2)
var testp = curve.interpolate_baked(test_offt, false)
return testp
func test_curve(curve, p2):
var testp = get_curve_closest(curve, p2)
return testp.distance_squared_to(p2) < 16.0
func create_path(c, p2, vel):
c.set_meta("velocity", vel)
print("create_path: velocity: ", vel)
var rangle = traffic_rnd.randf() * PI * 2.0
var randa = 500.0 + traffic_rnd.randf() * 500.0
var xt = cos(rangle) * randa
var yt = cos(rangle) * randa
var rv = Vector3(xt, 0, yt)
var target = RoadsData.get_closest_point(p2 + rv, false)
var cur = RoadsData.get_closest_point(p2, false)
while cur == target:
rangle = traffic_rnd.randf() * PI * 2.0
randa = 500.0 + traffic_rnd.randf() * 500.0
xt = cos(rangle) * randa
yt = sin(rangle) * randa
rv = Vector3(xt, 0, yt)
target = RoadsData.get_closest_point(p2 + rv, false)
c.set_meta("target", target)
var path = RoadsData.get_point_path(cur, target);
assert(cur != target)
assert(path.size() > 0)
var curve = Curve3D.new()
for e in range(path.size() - 1):
var pt1 = path[e]
var pt2 = path[e + 1]
var nt = (pt2 - pt1).cross(Vector3.UP).normalized()
var d = (pt2 - pt1).normalized()
var l = pt1.distance_to(pt2)
while l > 16.0:
pt1 += d * 8.0
curve.add_point(pt1 + nt * 3.0 + Vector3.UP * 0.5)
l -= 8.0
if (!test_curve(curve, p2)):
var testp = get_curve_closest(curve, p2)
var e = p2 + (testp - p2).normalized() * 2.0
var nt = (testp - p2).cross(Vector3.UP).normalized()
curve.add_point(e + nt * 3.0 + Vector3.UP * 0.5, Vector3(), Vector3(), 0)
assert(test_curve(curve, p2))
c.set_meta("curve", curve)
c.set_meta("curve_length", curve.get_baked_length())
# buildings # buildings
var spawn = [] #var spawn = []
onready var spawn_lock: Mutex = Mutex.new()
func spawn_child(n: String, xform: Transform) -> void: func spawn_child(n: String, xform: Transform) -> void:
var sp = {"node": n, "xform": xform} spawn_lock.lock()
spawn.push_back(sp) Spawner.queue_place_scene(n, xform)
func real_spawn_child(): spawn_lock.unlock()
var count = 0
while spawn.size() > 0:
var e = spawn.pop_front()
Spawner.place_scene(e.node, e.xform)
count += 1
func update_node_position(n): func update_node_position(n):
var space_state = get_viewport().get_world().direct_space_state var space_state = get_viewport().get_world().direct_space_state
@@ -624,3 +385,47 @@ func update_node_position(n):
return return
else: else:
n.global_transform.origin = result.position n.global_transform.origin = result.position
func spawn_house_objects(place: Transform, objects) -> void:
for obj in objects:
var x = obj.xform
for w in obj.data:
if w.ends_with("_rotated"):
x.basis = x.basis.rotated(Vector3(0, 1, 0), PI)
var n = w.replace("_rotated", "")
spawn_child(n, place * x)
else:
spawn_child(w, place * x)
static func get_place_rnd(xform: Transform):
var rnd = RandomNumberGenerator.new()
var s = int(xform.origin.x + 100 * xform.origin.z * 2) % 0x1ffffff
rnd.seed = s
return rnd
func setup_bandit_camp(site):
var poly = RoadsData.get_site_polygon_3d(site)
var height = RoadsData.get_site_avg_height(site)
var center = Vector3()
for p in poly:
center += p
center /= poly.size()
center.y = height
var xform = Transform(Basis(), center)
var camp = bandit_camp.instance()
get_tree().root.add_child(camp)
camp.global_transform = xform
return camp
func setup_bandit_camp_outskirts(site):
var b = RoadsData.get_site_border(site, 96.0)
for e in range(min(4, b.size())):
if scenario.camp_dwellings.has(e):
if scenario.camp_dwellings[e].health <= 0:
continue
var h_xform = Transform(Basis(), b[e])
var dwg = hostile_dwelling.instance()
get_tree().root.add_child(dwg)
dwg.global_transform = h_xform
if !scenario.camp_dwellings.has(e):
scenario.camp_dwellings[e] = {}
scenario.camp_dwellings[e].health = 100.0

102
bandit_camp.gd Normal file
View File

@@ -0,0 +1,102 @@
extends Spatial
export var bonfire: PackedScene
export var fence: PackedScene
export var gate: PackedScene
export var bed: PackedScene
export var pillory: PackedScene
export var gibbet: PackedScene
export var tent: PackedScene
func _ready():
call_deferred("update_camp")
func update_camp():
for c in get_children():
c.queue_free()
var camp_level = scenario.camp_level
var prisoners = []
var beds = 1
var tents = 0
if scenario.camp_level < 50:
beds = max(1, scenario.camp_level)
else:
beds = 50
var bandits = scenario.bandits_count
var circ = 32.0 + 2.0 * scenario.camp_level
var r = circ / (2.0 * PI)
var angle = 2.0 * PI / (circ / 2.0)
var angle_bed = 2.0 * PI / (circ / 4.0)
var a = 0.0
var bf = bonfire.instance()
add_child(bf)
bf.transform = Transform(Basis(), Vector3(0, 0.08, 0))
var beds_r = 2.5
var tents_r = 0.0
if camp_level > 25:
beds_r = max(min(12.0, r), r / 2.0)
tents_r = 5.5
tents = camp_level - 25
beds = max(0, beds - 2 * tents)
r = max(max(r, beds_r + 6.5), tents_r + 6.5)
circ = r * 2.0 * PI
var beds_to_place = beds
var k = 0
var tents_to_place = tents
while tents_to_place > 0:
a = 0.0
while a < 2.0 * PI:
if tents_to_place > 0:
var tent_pt = Vector3(tents_r * cos(a), 0.08 , tents_r * sin(a))
var tent_xform = Transform(Basis().rotated(Vector3.UP, -a + PI / 2.0), tent_pt)
var b = tent.instance()
add_child(b)
b.transform = tent_xform
tents_to_place -= 1
var n = int((tents_r * 2.0 * PI) / 8.0)
a += 2.0 * PI / float(n)
tents_r += 5.5
k += 1
k = 0
if beds_r <= tents_r + 1.5:
beds_r = tents_r + 1.5
while beds_to_place > 0:
a = 0.0
while a < 2.0 * PI:
if beds_to_place > 0:
var bed_pt = Vector3(beds_r * cos(a), 0.08 , beds_r * sin(a))
var bed_xform = Transform(Basis().rotated(Vector3.UP, -a + PI / 2.0), bed_pt)
var b = bed.instance()
add_child(b)
b.transform = bed_xform
beds_to_place -= 1
var n = (beds_r * 2.0 * PI) / 2.0
a += 2.0 * PI / n
beds_r += 2.5
k += 1
a = 0.0
if r - max(beds_r, tents_r) < 3.0:
r = max(beds_r, tents_r) + 3.0
circ = r * 2.0 * PI
circ = floor(circ / 4.0) * 4.0
r = circ / 2.0 / PI
while a < 2.0 * PI - 0.05:
var obj = fence
if a == 0.0:
obj = gate
var pt = Vector3(r * cos(a), 0 , r * sin(a))
var xform = Transform(Basis().rotated(Vector3.UP, -a + PI / 2.0), pt)
var f = obj.instance()
add_child(f)
f.transform = xform
a += 2.0 / circ * 2.0 * PI
func _physics_process(delta):
var space: PhysicsDirectSpaceState = get_world().get_direct_space_state()
var from = global_transform.origin - Vector3.UP * 200.0
var to = global_transform.origin + Vector3.UP * 200.0
var result = space.intersect_ray(from, to)
if result.has("collider"):
global_transform.origin = result.position
set_physics_process(false)
scenario.emit_signal("spawn_player", global_transform)

21
bandit_camp.tscn Normal file
View File

@@ -0,0 +1,21 @@
[gd_scene load_steps=9 format=2]
[ext_resource path="res://bandit_camp.gd" type="Script" id=1]
[ext_resource path="res://objects/bandit-camp-fence.scn" type="PackedScene" id=2]
[ext_resource path="res://objects/bandit-camp-fence-gate.scn" type="PackedScene" id=3]
[ext_resource path="res://objects/bandit-camp-bed-floor.scn" type="PackedScene" id=4]
[ext_resource path="res://objects/campfire.scn" type="PackedScene" id=5]
[ext_resource path="res://objects/tent.scn" type="PackedScene" id=6]
[ext_resource path="res://objects/pillory.scn" type="PackedScene" id=7]
[ext_resource path="res://objects/gibbet.scn" type="PackedScene" id=8]
[node name="bandit_camp" type="Spatial"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 149.477, 51.3701, 234.495 )
script = ExtResource( 1 )
bonfire = ExtResource( 5 )
fence = ExtResource( 2 )
gate = ExtResource( 3 )
bed = ExtResource( 4 )
pillory = ExtResource( 7 )
gibbet = ExtResource( 8 )
tent = ExtResource( 6 )

167
buildings/trailer-house.gd Normal file
View File

@@ -0,0 +1,167 @@
extends Reference
static func build_house2(main_xform: Transform):
var rnd = streaming.get_place_rnd(main_xform)
print(main_xform.origin, " seed = ", rnd.state)
var l = 5 + 2 * (rnd.randi() % 5) - 1
var h = l - 1
var d = 3 + rnd.randi() % (l - 4 + 1)
var range_used = false
var objects = []
for k in range(l + 1):
var pos = Vector3(0, 0, k * 2)
var xform = Transform(Basis(), pos)
if k > 0:
var what
if k != d && rnd.randf() > 0.5 && !range_used:
what = "roof_floor_range"
range_used = true
else:
what = "roof_floor"
objects.push_back({"xform": xform, "data": [what]})
var xt = [Transform(Basis(), pos), Transform(Basis().rotated(Vector3.UP, PI), pos - Vector3(0, 0, 2))]
for x in range(xt.size()):
if x == 0 && k == d:
continue
if rnd.randf() > 0.5:
what = "wall_solid"
elif rnd.randf() > 0.5:
what = "window_narrow"
else:
what = "window_wide"
objects.push_back({"xform": xt[x], "data": [what]})
var obj_data = []
if k > 1 && k < l && rnd.randf() > 0.6:
objects.push_back({"xform": xform, "data": ["wall_internal"]})
match k:
0:
obj_data = ["side_wall", "bottom_side"]
1:
obj_data = ["bottom"]
2:
obj_data = ["bottom_wheels"]
d:
obj_data = ["entry", "bottom"]
h:
obj_data = ["bottom_wheels"]
l:
obj_data = ["side_wall_rotated", "bottom_side_rotated", "bottom"]
_:
obj_data = ["bottom"]
objects.push_back({"xform": xform, "data": obj_data})
return objects
static func build_walls(pos: Vector3, rnd: RandomNumberGenerator):
var objects = []
var xt = [Transform(Basis(), pos), Transform(Basis().rotated(Vector3.UP, PI), pos - Vector3(0, 0, 2))]
for x in range(xt.size()):
var obj_data = []
if rnd.randf() > 0.5:
obj_data.push_back("wall_solid")
elif rnd.randf() > 0.5:
obj_data.push_back("window_narrow")
else:
obj_data.push_back("window_wide")
objects.push_back({"xform": xt[x], "data": obj_data})
return objects
static func build_house(main_xform: Transform):
var rnd = streaming.get_place_rnd(main_xform)
var terminals = [
"side_wall",
"side_wall_rotated",
"room",
"entry",
"room_range",
"wheels_room"
]
var grammar = {
"start": ["side_wall", "room", "wheels_room", "rooms_entry", "wheels_room", "side_wall_rotated"],
"rooms_entry": ["rooms", "entry!", "rooms"],
"rooms": ["rooms#", ["room", "range!"]],
"entry!": ["entry"],
"range!": ["room_range"],
"rooms#": ["rooms"]
}
var seen = {}
var queue = ["start"]
var complete = false
while !complete:
complete = true
var data = []
for k in range(queue.size()):
var item = queue[k]
print("item=", item)
if !item in terminals:
complete = false
for de in grammar[item]:
var e
if typeof(de) == TYPE_ARRAY:
while true:
e = de[rnd.randi() % de.size()]
if !e.ends_with("!") || !seen.has(e):
break
else:
e = de
print("e=", e)
if e.ends_with("!"):
if seen.has(e):
continue
else:
seen[e] = 1
if e.ends_with("#"):
if queue.size() < 12:
if rnd.randf() >= 0.3:
data.push_back(e)
else:
data.push_back(e)
else:
data.push_back(item)
queue = data
if complete:
if !seen.has("entry!") || !seen.has("range!"):
complete = false
seen.clear()
queue = ["start"]
print("queue: ", queue)
var objects = []
for k in range(queue.size()):
var pos = Vector3(0, 0, k * 2)
var xform = Transform(Basis(), pos)
var xt = [Transform(Basis(), pos), Transform(Basis().rotated(Vector3.UP, PI), pos - Vector3(0, 0, 2))]
match queue[k]:
"side_wall":
objects.push_back({"xform": xform, "data": ["side_wall", "bottom_side"]})
"room":
objects.push_back({"xform": xform, "data": ["roof_floor", "bottom"]})
objects.append_array(build_walls(pos, rnd))
if rnd.randf() > 0.6:
objects.push_back({"xform": xform, "data": ["wall_internal"]})
"wheels_room":
objects.push_back({"xform": xform, "data": ["roof_floor", "bottom_wheels"]})
objects.append_array(build_walls(pos, rnd))
if rnd.randf() > 0.6:
objects.push_back({"xform": xform, "data": ["wall_internal"]})
"room_range":
objects.push_back({"xform": xform, "data": ["roof_floor_range", "bottom"]})
objects.append_array(build_walls(pos, rnd))
if rnd.randf() > 0.6:
objects.push_back({"xform": xform, "data": ["wall_internal"]})
"entry":
for x in range(xt.size()):
var obj_data = []
if x == 0:
continue
if rnd.randf() > 0.5:
obj_data.push_back("wall_solid")
elif rnd.randf() > 0.5:
obj_data.push_back("window_narrow")
else:
obj_data.push_back("window_wide")
objects.push_back({"xform": xt[x], "data": obj_data})
objects.push_back({"xform": xform, "data": ["roof_floor", "entry", "bottom"]})
"side_wall_rotated":
objects.append_array(build_walls(pos, rnd))
objects.push_back({"xform": xform, "data": ["roof_floor", "side_wall_rotated", "bottom_side_rotated", "bottom"]})
return objects

8
bush.tscn Normal file
View File

@@ -0,0 +1,8 @@
[gd_scene load_steps=2 format=2]
[ext_resource path="res://terrain-objects/terrain-bushes_p1_l0.mesh" type="ArrayMesh" id=1]
[node name="bush" type="StaticBody"]
[node name="MeshInstance" type="MeshInstance" parent="."]
mesh = ExtResource( 1 )

26
camera/cinematic_cam.tscn Normal file
View File

@@ -0,0 +1,26 @@
[gd_scene load_steps=3 format=2]
[ext_resource path="res://camera/environment.tres" type="Environment" id=1]
[sub_resource type="SphereShape" id=1]
radius = 0.1
[node name="cinematic_cam" type="Spatial"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 6.75037, 0 )
[node name="rot_y" type="Spatial" parent="."]
[node name="rot_x" type="Spatial" parent="rot_y"]
[node name="SpringArm" type="SpringArm" parent="rot_y/rot_x"]
transform = Transform( 1, 0, 0, 0, 0.903013, 0.429613, 0, -0.429613, 0.903013, 0, 0, 0 )
shape = SubResource( 1 )
margin = 0.08
[node name="camera_offset" type="Spatial" parent="rot_y/rot_x/SpringArm"]
[node name="Camera" type="Camera" parent="rot_y/rot_x/SpringArm/camera_offset"]
transform = Transform( 1, 0, 0, 0, 0.900455, -0.434948, 0, 0.434948, 0.900455, 0, 0, 0 )
environment = ExtResource( 1 )
fov = 40.0
far = 350.0

View File

@@ -1,4 +1,4 @@
[gd_scene load_steps=138 format=2] [gd_scene load_steps=153 format=2]
[ext_resource path="res://scenes/characters/vroid1-female.gltf" type="PackedScene" id=1] [ext_resource path="res://scenes/characters/vroid1-female.gltf" type="PackedScene" id=1]
[ext_resource path="res://scenes/hair/female-hair1.tscn" type="PackedScene" id=2] [ext_resource path="res://scenes/hair/female-hair1.tscn" type="PackedScene" id=2]
@@ -29,6 +29,19 @@ filters = [ "skeleton/Skeleton:hand_l", "skeleton/Skeleton:index_1_l", "skeleton
filter_enabled = true filter_enabled = true
filters = [ "skeleton/Skeleton:hand_r", "skeleton/Skeleton:index_1_r", "skeleton/Skeleton:index_2_r", "skeleton/Skeleton:index_3_end_r", "skeleton/Skeleton:index_3_r", "skeleton/Skeleton:little_1_r", "skeleton/Skeleton:little_2_r", "skeleton/Skeleton:little_3_end_r", "skeleton/Skeleton:little_3_r", "skeleton/Skeleton:middle_1_r", "skeleton/Skeleton:middle_2_r", "skeleton/Skeleton:middle_3_end_r", "skeleton/Skeleton:middle_3_r", "skeleton/Skeleton:ring_1_r", "skeleton/Skeleton:ring_2_r", "skeleton/Skeleton:ring_3_end_r", "skeleton/Skeleton:ring_3_r", "skeleton/Skeleton:thumb_1_r", "skeleton/Skeleton:thumb_2_r", "skeleton/Skeleton:thumb_3_end_r", "skeleton/Skeleton:thumb_3_r" ] filters = [ "skeleton/Skeleton:hand_r", "skeleton/Skeleton:index_1_r", "skeleton/Skeleton:index_2_r", "skeleton/Skeleton:index_3_end_r", "skeleton/Skeleton:index_3_r", "skeleton/Skeleton:little_1_r", "skeleton/Skeleton:little_2_r", "skeleton/Skeleton:little_3_end_r", "skeleton/Skeleton:little_3_r", "skeleton/Skeleton:middle_1_r", "skeleton/Skeleton:middle_2_r", "skeleton/Skeleton:middle_3_end_r", "skeleton/Skeleton:middle_3_r", "skeleton/Skeleton:ring_1_r", "skeleton/Skeleton:ring_2_r", "skeleton/Skeleton:ring_3_end_r", "skeleton/Skeleton:ring_3_r", "skeleton/Skeleton:thumb_1_r", "skeleton/Skeleton:thumb_2_r", "skeleton/Skeleton:thumb_3_end_r", "skeleton/Skeleton:thumb_3_r" ]
[sub_resource type="AnimationNodeAnimation" id=138]
animation = "attack-melee-weapon1"
[sub_resource type="AnimationNodeTimeScale" id=139]
[sub_resource type="AnimationNodeBlendTree" id=135]
nodes/Animation/node = SubResource( 138 )
nodes/Animation/position = Vector2( 280, 140 )
nodes/attack1_speed/node = SubResource( 139 )
nodes/attack1_speed/position = Vector2( 600, 160 )
nodes/output/position = Vector2( 900, 120 )
node_connections = [ "output", 0, "attack1_speed", "attack1_speed", 0, "Animation" ]
[sub_resource type="AnimationNodeAnimation" id=9] [sub_resource type="AnimationNodeAnimation" id=9]
animation = "climb1" animation = "climb1"
@@ -57,8 +70,34 @@ node_connections = [ "output", 0, "TimeScale", "TimeScale", 0, "Animation" ]
[sub_resource type="AnimationNodeBlendTree" id=15] [sub_resource type="AnimationNodeBlendTree" id=15]
[sub_resource type="AnimationNodeAnimation" id=156]
animation = "fall-back"
[sub_resource type="AnimationNodeTimeScale" id=157]
[sub_resource type="AnimationNodeBlendTree" id=154]
nodes/Animation/node = SubResource( 156 )
nodes/Animation/position = Vector2( 201, 341 )
nodes/TimeScale/node = SubResource( 157 )
nodes/TimeScale/position = Vector2( 440, 320 )
nodes/output/position = Vector2( 680, 320 )
node_connections = [ "output", 0, "TimeScale", "TimeScale", 0, "Animation" ]
[sub_resource type="AnimationNodeAnimation" id=158]
animation = "fall-front"
[sub_resource type="AnimationNodeTimeScale" id=159]
[sub_resource type="AnimationNodeBlendTree" id=155]
nodes/Animation/node = SubResource( 158 )
nodes/Animation/position = Vector2( 161, 293 )
nodes/TimeScale/node = SubResource( 159 )
nodes/TimeScale/position = Vector2( 400, 280 )
nodes/output/position = Vector2( 720, 220 )
node_connections = [ "output", 0, "TimeScale", "TimeScale", 0, "Animation" ]
[sub_resource type="AnimationNodeAnimation" id=16] [sub_resource type="AnimationNodeAnimation" id=16]
animation = "start-grabbed" animation = "start-grabbed2"
[sub_resource type="AnimationNodeTimeScale" id=17] [sub_resource type="AnimationNodeTimeScale" id=17]
@@ -70,6 +109,33 @@ nodes/TimeScale/position = Vector2( 592, 184 )
nodes/output/position = Vector2( 860, 120 ) nodes/output/position = Vector2( 860, 120 )
node_connections = [ "output", 0, "TimeScale", "TimeScale", 0, "Animation" ] node_connections = [ "output", 0, "TimeScale", "TimeScale", 0, "Animation" ]
[sub_resource type="AnimationNodeAnimation" id=152]
animation = "guard-melee-forward1"
[sub_resource type="AnimationNodeTimeScale" id=153]
[sub_resource type="AnimationNodeBlendTree" id=147]
nodes/Animation/node = SubResource( 152 )
nodes/Animation/position = Vector2( 194, 149 )
nodes/TimeScale/node = SubResource( 153 )
nodes/TimeScale/position = Vector2( 525, 150 )
nodes/output/position = Vector2( 780, 140 )
node_connections = [ "output", 0, "TimeScale", "TimeScale", 0, "Animation" ]
[sub_resource type="AnimationNodeAnimation" id=145]
animation = "guard-melee-backwards1"
[sub_resource type="AnimationNodeTimeScale" id=146]
[sub_resource type="AnimationNodeBlendTree" id=140]
graph_offset = Vector2( 0, -262 )
nodes/Animation/node = SubResource( 145 )
nodes/Animation/position = Vector2( 119, 108 )
nodes/TimeScale/node = SubResource( 146 )
nodes/TimeScale/position = Vector2( 520, 120 )
nodes/output/position = Vector2( 820, 160 )
node_connections = [ "output", 0, "TimeScale", "TimeScale", 0, "Animation" ]
[sub_resource type="AnimationNodeAnimation" id=19] [sub_resource type="AnimationNodeAnimation" id=19]
animation = "female-idle-to-kneel1" animation = "female-idle-to-kneel1"
@@ -113,7 +179,7 @@ nodes/TimeScale/position = Vector2( 580, 100 )
nodes/output/position = Vector2( 1120, 120 ) nodes/output/position = Vector2( 1120, 120 )
nodes/t1/node = SubResource( 26 ) nodes/t1/node = SubResource( 26 )
nodes/t1/position = Vector2( 880, 100 ) nodes/t1/position = Vector2( 880, 100 )
node_connections = [ "output", 0, "t1", "TimeScale", 0, "Animation", "TimeScale 2", 0, "Animation 2", "t1", 0, "TimeScale", "t1", 1, "TimeScale 2" ] node_connections = [ "output", 0, "t1", "t1", 0, "TimeScale", "t1", 1, "TimeScale 2", "TimeScale 2", 0, "Animation 2", "TimeScale", 0, "Animation" ]
[sub_resource type="AnimationNodeAnimation" id=28] [sub_resource type="AnimationNodeAnimation" id=28]
animation = "walk1p2" animation = "walk1p2"
@@ -133,6 +199,7 @@ input_1/name = "state 1"
input_1/auto_advance = true input_1/auto_advance = true
[sub_resource type="AnimationNodeBlendTree" id=33] [sub_resource type="AnimationNodeBlendTree" id=33]
graph_offset = Vector2( -264.489, -30 )
nodes/Animation/node = SubResource( 29 ) nodes/Animation/node = SubResource( 29 )
nodes/Animation/position = Vector2( 140, 100 ) nodes/Animation/position = Vector2( 140, 100 )
"nodes/Animation 2/node" = SubResource( 28 ) "nodes/Animation 2/node" = SubResource( 28 )
@@ -144,7 +211,7 @@ nodes/TimeScale/position = Vector2( 620, 40 )
nodes/Transition/node = SubResource( 32 ) nodes/Transition/node = SubResource( 32 )
nodes/Transition/position = Vector2( 905, 264 ) nodes/Transition/position = Vector2( 905, 264 )
nodes/output/position = Vector2( 1280, 120 ) nodes/output/position = Vector2( 1280, 120 )
node_connections = [ "output", 0, "Transition", "TimeScale", 0, "Animation", "Transition", 0, "TimeScale", "Transition", 1, "TimeScale 2", "TimeScale 2", 0, "Animation 2" ] node_connections = [ "output", 0, "Transition", "Transition", 0, "TimeScale", "Transition", 1, "TimeScale 2", "TimeScale 2", 0, "Animation 2", "TimeScale", 0, "Animation" ]
[sub_resource type="AnimationNodeAnimation" id=34] [sub_resource type="AnimationNodeAnimation" id=34]
animation = "07_01-walk" animation = "07_01-walk"
@@ -172,84 +239,16 @@ nodes/TimeScale/position = Vector2( 580, 120 )
nodes/output/position = Vector2( 840, 140 ) nodes/output/position = Vector2( 840, 140 )
node_connections = [ "output", 0, "TimeScale", "TimeScale", 0, "Animation" ] node_connections = [ "output", 0, "TimeScale", "TimeScale", 0, "Animation" ]
[sub_resource type="AnimationNodeAnimation" id=40]
animation = "walk1p2"
[sub_resource type="AnimationNodeAnimation" id=41]
animation = "walk1p1"
[sub_resource type="AnimationNodeTimeScale" id=42]
[sub_resource type="AnimationNodeTimeScale" id=43]
[sub_resource type="AnimationNodeTransition" id=44]
input_count = 2
input_0/name = "state 0"
input_0/auto_advance = true
input_1/name = "state 1"
input_1/auto_advance = true
[sub_resource type="AnimationNodeBlendTree" id=45]
graph_offset = Vector2( 0, -259 )
nodes/Animation/node = SubResource( 41 )
nodes/Animation/position = Vector2( 200, 80 )
"nodes/Animation 2/node" = SubResource( 40 )
"nodes/Animation 2/position" = Vector2( 200, 280 )
nodes/TimeScale/node = SubResource( 43 )
nodes/TimeScale/position = Vector2( 660, 60 )
"nodes/TimeScale 2/node" = SubResource( 42 )
"nodes/TimeScale 2/position" = Vector2( 580, 260 )
nodes/Transition/node = SubResource( 44 )
nodes/Transition/position = Vector2( 920, 120 )
nodes/output/position = Vector2( 1260, 160 )
node_connections = [ "output", 0, "Transition", "TimeScale", 0, "Animation", "Transition", 0, "TimeScale", "Transition", 1, "TimeScale 2", "TimeScale 2", 0, "Animation 2" ]
[sub_resource type="AnimationNodeAnimation" id=46]
animation = "walk1p2"
[sub_resource type="AnimationNodeAnimation" id=47]
animation = "walk1p1"
[sub_resource type="AnimationNodeTimeScale" id=48]
[sub_resource type="AnimationNodeTimeScale" id=49]
[sub_resource type="AnimationNodeTransition" id=50]
input_count = 2
xfade_time = 0.2
input_0/name = "state 0"
input_0/auto_advance = true
input_1/name = "state 1"
input_1/auto_advance = true
[sub_resource type="AnimationNodeBlendTree" id=51]
graph_offset = Vector2( 0, -294.25 )
nodes/Animation/node = SubResource( 47 )
nodes/Animation/position = Vector2( 208, 136 )
"nodes/Animation 2/node" = SubResource( 46 )
"nodes/Animation 2/position" = Vector2( 230, 287 )
nodes/TimeScale/node = SubResource( 49 )
nodes/TimeScale/position = Vector2( 660, 80 )
"nodes/TimeScale 2/node" = SubResource( 48 )
"nodes/TimeScale 2/position" = Vector2( 680, 260 )
nodes/Transition/node = SubResource( 50 )
nodes/Transition/position = Vector2( 1000, 140 )
nodes/output/position = Vector2( 1260, 140 )
node_connections = [ "output", 0, "Transition", "TimeScale", 0, "Animation", "Transition", 0, "TimeScale", "Transition", 1, "TimeScale 2", "TimeScale 2", 0, "Animation 2" ]
[sub_resource type="AnimationNodeBlendSpace2D" id=52] [sub_resource type="AnimationNodeBlendSpace2D" id=52]
blend_point_0/node = SubResource( 27 ) blend_point_0/node = SubResource( 27 )
blend_point_0/pos = Vector2( 0, 0 ) blend_point_0/pos = Vector2( 0, 0 )
blend_point_1/node = SubResource( 33 ) blend_point_1/node = SubResource( 33 )
blend_point_1/pos = Vector2( 0.2, 0 ) blend_point_1/pos = Vector2( 0.1, 0 )
blend_point_2/node = SubResource( 36 ) blend_point_2/node = SubResource( 36 )
blend_point_2/pos = Vector2( 0.2, -1 ) blend_point_2/pos = Vector2( 0.2, -1 )
blend_point_3/node = SubResource( 39 ) blend_point_3/node = SubResource( 39 )
blend_point_3/pos = Vector2( 0.2, 1 ) blend_point_3/pos = Vector2( 0.2, 1 )
blend_point_4/node = SubResource( 45 ) blend_mode = 1
blend_point_4/pos = Vector2( 0.6, 0 )
blend_point_5/node = SubResource( 51 )
blend_point_5/pos = Vector2( 0.4, 0 )
[sub_resource type="AnimationNodeBlendTree" id=53] [sub_resource type="AnimationNodeBlendTree" id=53]
graph_offset = Vector2( 0, -95 ) graph_offset = Vector2( 0, -95 )
@@ -289,7 +288,7 @@ nodes/TimeScale/position = Vector2( 640, 200 )
nodes/Transition/node = SubResource( 59 ) nodes/Transition/node = SubResource( 59 )
nodes/Transition/position = Vector2( 860, 220 ) nodes/Transition/position = Vector2( 860, 220 )
nodes/output/position = Vector2( 1080, 200 ) nodes/output/position = Vector2( 1080, 200 )
node_connections = [ "output", 0, "Transition", "TimeScale", 0, "Animation", "Transition", 1, "TimeScale 2", "TimeScale 2", 0, "Animation 2" ] node_connections = [ "output", 0, "Transition", "Transition", 1, "TimeScale 2", "TimeScale 2", 0, "Animation 2", "TimeScale", 0, "Animation" ]
[sub_resource type="AnimationNodeAnimation" id=61] [sub_resource type="AnimationNodeAnimation" id=61]
animation = "female-pray-startled1" animation = "female-pray-startled1"
@@ -355,7 +354,7 @@ nodes/attack2/position = Vector2( 1140, 300 )
nodes/output/position = Vector2( 1580, 180 ) nodes/output/position = Vector2( 1580, 180 )
nodes/speed/node = SubResource( 74 ) nodes/speed/node = SubResource( 74 )
nodes/speed/position = Vector2( 540, 60 ) nodes/speed/position = Vector2( 540, 60 )
node_connections = [ "speed", 0, "Animation", "output", 0, "attack2", "TimeScale", 0, "Animation 2", "attack1", 0, "speed", "attack1", 1, "TimeScale", "attack2", 0, "attack1", "attack2", 1, "TimeScale 2", "TimeScale 2", 0, "Animation 3" ] node_connections = [ "speed", 0, "Animation", "output", 0, "attack2", "TimeScale 2", 0, "Animation 3", "attack2", 0, "attack1", "attack2", 1, "TimeScale 2", "attack1", 0, "speed", "attack1", 1, "TimeScale", "TimeScale", 0, "Animation 2" ]
[sub_resource type="AnimationNodeAnimation" id=76] [sub_resource type="AnimationNodeAnimation" id=76]
animation = "dagger-sacrifice-counter-p" animation = "dagger-sacrifice-counter-p"
@@ -547,15 +546,59 @@ switch_mode = 2
[sub_resource type="AnimationNodeStateMachineTransition" id=130] [sub_resource type="AnimationNodeStateMachineTransition" id=130]
switch_mode = 2 switch_mode = 2
[sub_resource type="AnimationNodeStateMachineTransition" id=136]
[sub_resource type="AnimationNodeStateMachineTransition" id=137]
switch_mode = 2
auto_advance = true
[sub_resource type="AnimationNodeStateMachineTransition" id=141]
switch_mode = 2
[sub_resource type="AnimationNodeStateMachineTransition" id=142]
switch_mode = 2
[sub_resource type="AnimationNodeStateMachineTransition" id=143]
[sub_resource type="AnimationNodeStateMachineTransition" id=144]
switch_mode = 2
auto_advance = true
[sub_resource type="AnimationNodeStateMachineTransition" id=148]
switch_mode = 2
[sub_resource type="AnimationNodeStateMachineTransition" id=149]
switch_mode = 2
[sub_resource type="AnimationNodeStateMachineTransition" id=150]
[sub_resource type="AnimationNodeStateMachineTransition" id=151]
switch_mode = 2
auto_advance = true
[sub_resource type="AnimationNodeStateMachineTransition" id=160]
[sub_resource type="AnimationNodeStateMachineTransition" id=161]
[sub_resource type="AnimationNodeStateMachine" id=110] [sub_resource type="AnimationNodeStateMachine" id=110]
states/attack-melee1/node = SubResource( 135 )
states/attack-melee1/position = Vector2( 1277, 411.193 )
states/climb1/node = SubResource( 11 ) states/climb1/node = SubResource( 11 )
states/climb1/position = Vector2( 804, 503.193 ) states/climb1/position = Vector2( 804, 503.193 )
states/climb1a/node = SubResource( 14 ) states/climb1a/node = SubResource( 14 )
states/climb1a/position = Vector2( 947, 503.193 ) states/climb1a/position = Vector2( 947, 503.193 )
states/drive/node = SubResource( 15 ) states/drive/node = SubResource( 15 )
states/drive/position = Vector2( 868, 316.193 ) states/drive/position = Vector2( 868, 316.193 )
states/fall-back/node = SubResource( 154 )
states/fall-back/position = Vector2( 1301.67, 633.193 )
states/fall-front/node = SubResource( 155 )
states/fall-front/position = Vector2( 1357.67, 576.193 )
states/grabbed/node = SubResource( 18 ) states/grabbed/node = SubResource( 18 )
states/grabbed/position = Vector2( 1277, 182.193 ) states/grabbed/position = Vector2( 1290, 90.193 )
states/guard-front-melee1/node = SubResource( 147 )
states/guard-front-melee1/position = Vector2( 1477.6, 336.193 )
states/guard-melee1/node = SubResource( 140 )
states/guard-melee1/position = Vector2( 1200.6, 496.193 )
states/kneel/node = SubResource( 21 ) states/kneel/node = SubResource( 21 )
states/kneel/position = Vector2( 522, 84 ) states/kneel/position = Vector2( 522, 84 )
states/locomotion/node = SubResource( 53 ) states/locomotion/node = SubResource( 53 )
@@ -569,11 +612,11 @@ states/pray-startled/position = Vector2( 294, 316.193 )
states/pray-startled-walk/node = SubResource( 60 ) states/pray-startled-walk/node = SubResource( 60 )
states/pray-startled-walk/position = Vector2( 294, 514.193 ) states/pray-startled-walk/position = Vector2( 294, 514.193 )
states/sacrifice/node = SubResource( 75 ) states/sacrifice/node = SubResource( 75 )
states/sacrifice/position = Vector2( 1023, 135 ) states/sacrifice/position = Vector2( 1547, 101 )
states/sacrificed/node = SubResource( 78 ) states/sacrificed/node = SubResource( 78 )
states/sacrificed/position = Vector2( 1125, 283 ) states/sacrificed/position = Vector2( 1547, 180 )
states/sleeping/node = SubResource( 81 ) states/sleeping/node = SubResource( 81 )
states/sleeping/position = Vector2( 1078, 411.193 ) states/sleeping/position = Vector2( 1045, 348.193 )
states/stand-startled/node = SubResource( 84 ) states/stand-startled/node = SubResource( 84 )
states/stand-startled/position = Vector2( 717, 411.193 ) states/stand-startled/position = Vector2( 717, 411.193 )
states/start_walking/node = SubResource( 115 ) states/start_walking/node = SubResource( 115 )
@@ -586,12 +629,12 @@ states/turn_right/node = SubResource( 126 )
states/turn_right/position = Vector2( 1059, 620.193 ) states/turn_right/position = Vector2( 1059, 620.193 )
states/use_tap/node = SubResource( 85 ) states/use_tap/node = SubResource( 85 )
states/use_tap/position = Vector2( 283, 143.193 ) states/use_tap/position = Vector2( 283, 143.193 )
transitions = [ "locomotion", "passenger", SubResource( 86 ), "passenger", "locomotion", SubResource( 87 ), "passenger", "drive", SubResource( 88 ), "drive", "passenger", SubResource( 89 ), "drive", "locomotion", SubResource( 90 ), "locomotion", "drive", SubResource( 91 ), "sacrifice", "sacrificed", SubResource( 92 ), "sacrificed", "sacrifice", SubResource( 93 ), "locomotion", "kneel", SubResource( 94 ), "kneel", "pray", SubResource( 95 ), "pray", "locomotion", SubResource( 96 ), "pray", "pray-startled", SubResource( 97 ), "pray-startled", "pray-startled-walk", SubResource( 98 ), "sleeping", "locomotion", SubResource( 99 ), "pray-startled-walk", "stand-startled", SubResource( 100 ), "stand-startled", "locomotion", SubResource( 101 ), "locomotion", "grabbed", SubResource( 102 ), "grabbed", "locomotion", SubResource( 103 ), "locomotion", "climb1", SubResource( 104 ), "climb1", "locomotion", SubResource( 105 ), "locomotion", "climb1a", SubResource( 106 ), "climb1a", "locomotion", SubResource( 107 ), "use_tap", "locomotion", SubResource( 108 ), "locomotion", "use_tap", SubResource( 109 ), "locomotion", "start_walking", SubResource( 117 ), "start_walking", "locomotion", SubResource( 118 ), "locomotion", "stop_walking", SubResource( 119 ), "stop_walking", "locomotion", SubResource( 120 ), "locomotion", "tun_left", SubResource( 127 ), "tun_left", "locomotion", SubResource( 128 ), "locomotion", "turn_right", SubResource( 129 ), "turn_right", "locomotion", SubResource( 130 ) ] transitions = [ "locomotion", "passenger", SubResource( 86 ), "passenger", "locomotion", SubResource( 87 ), "passenger", "drive", SubResource( 88 ), "drive", "passenger", SubResource( 89 ), "drive", "locomotion", SubResource( 90 ), "locomotion", "drive", SubResource( 91 ), "sacrifice", "sacrificed", SubResource( 92 ), "sacrificed", "sacrifice", SubResource( 93 ), "locomotion", "kneel", SubResource( 94 ), "kneel", "pray", SubResource( 95 ), "pray", "locomotion", SubResource( 96 ), "pray", "pray-startled", SubResource( 97 ), "pray-startled", "pray-startled-walk", SubResource( 98 ), "sleeping", "locomotion", SubResource( 99 ), "pray-startled-walk", "stand-startled", SubResource( 100 ), "stand-startled", "locomotion", SubResource( 101 ), "locomotion", "grabbed", SubResource( 102 ), "grabbed", "locomotion", SubResource( 103 ), "locomotion", "climb1", SubResource( 104 ), "climb1", "locomotion", SubResource( 105 ), "locomotion", "climb1a", SubResource( 106 ), "climb1a", "locomotion", SubResource( 107 ), "use_tap", "locomotion", SubResource( 108 ), "locomotion", "use_tap", SubResource( 109 ), "locomotion", "start_walking", SubResource( 117 ), "start_walking", "locomotion", SubResource( 118 ), "locomotion", "stop_walking", SubResource( 119 ), "stop_walking", "locomotion", SubResource( 120 ), "locomotion", "tun_left", SubResource( 127 ), "tun_left", "locomotion", SubResource( 128 ), "locomotion", "turn_right", SubResource( 129 ), "turn_right", "locomotion", SubResource( 130 ), "locomotion", "attack-melee1", SubResource( 136 ), "attack-melee1", "locomotion", SubResource( 137 ), "attack-melee1", "guard-melee1", SubResource( 141 ), "guard-melee1", "attack-melee1", SubResource( 142 ), "locomotion", "guard-melee1", SubResource( 143 ), "guard-melee1", "locomotion", SubResource( 144 ), "attack-melee1", "guard-front-melee1", SubResource( 148 ), "guard-front-melee1", "attack-melee1", SubResource( 149 ), "locomotion", "guard-front-melee1", SubResource( 150 ), "guard-front-melee1", "locomotion", SubResource( 151 ), "locomotion", "fall-front", SubResource( 160 ), "locomotion", "fall-back", SubResource( 161 ) ]
start_node = "locomotion" start_node = "locomotion"
graph_offset = Vector2( -232, 15.1925 ) graph_offset = Vector2( 496.672, 7.1925 )
[sub_resource type="AnimationNodeBlendTree" id=111] [sub_resource type="AnimationNodeBlendTree" id=111]
graph_offset = Vector2( 0, -221 ) graph_offset = Vector2( 445.846, -157.796 )
nodes/Animation/node = SubResource( 5 ) nodes/Animation/node = SubResource( 5 )
nodes/Animation/position = Vector2( 540, 280 ) nodes/Animation/position = Vector2( 540, 280 )
"nodes/Animation 2/node" = SubResource( 4 ) "nodes/Animation 2/node" = SubResource( 4 )
@@ -605,7 +648,7 @@ nodes/blade_right/position = Vector2( 1400, 100 )
nodes/output/position = Vector2( 1820, -20 ) nodes/output/position = Vector2( 1820, -20 )
nodes/state/node = SubResource( 110 ) nodes/state/node = SubResource( 110 )
nodes/state/position = Vector2( 480, 120 ) nodes/state/position = Vector2( 480, 120 )
node_connections = [ "output", 0, "blade_right", "blade_right", 0, "blade_left", "blade_right", 1, "Animation 2", "blade_left", 0, "all_scale", "blade_left", 1, "Animation", "all_scale", 0, "state" ] node_connections = [ "output", 0, "blade_right", "all_scale", 0, "state", "blade_left", 0, "all_scale", "blade_left", 1, "Animation", "blade_right", 0, "blade_left", "blade_right", 1, "Animation 2" ]
[sub_resource type="AnimationNodeStateMachinePlayback" id=112] [sub_resource type="AnimationNodeStateMachinePlayback" id=112]
@@ -614,6 +657,7 @@ node_connections = [ "output", 0, "blade_right", "blade_right", 0, "blade_left",
[node name="Skeleton" parent="skeleton" index="0"] [node name="Skeleton" parent="skeleton" index="0"]
bones/1/bound_children = [ NodePath("hips") ] bones/1/bound_children = [ NodePath("hips") ]
bones/25/bound_children = [ NodePath("chest") ] bones/25/bound_children = [ NodePath("chest") ]
bones/79/bound_children = [ NodePath("neck") ]
bones/80/bound_children = [ NodePath("head") ] bones/80/bound_children = [ NodePath("head") ]
bones/99/bound_children = [ NodePath("wrist_l") ] bones/99/bound_children = [ NodePath("wrist_l") ]
bones/101/bound_children = [ NodePath("wrist_r") ] bones/101/bound_children = [ NodePath("wrist_r") ]
@@ -622,7 +666,7 @@ bones/101/bound_children = [ NodePath("wrist_r") ]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -0.00418961, 0.00654769, 0.00506566 ) transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -0.00418961, 0.00654769, 0.00506566 )
[node name="head" type="BoneAttachment" parent="skeleton/Skeleton" index="2"] [node name="head" type="BoneAttachment" parent="skeleton/Skeleton" index="2"]
transform = Transform( 0.695045, 0.34614, -0.630227, -0.0867818, 0.910422, 0.404298, 0.713771, -0.226324, 0.66284, -0.0445963, 1.35245, -0.0152731 ) transform = Transform( 0.713409, 0.342413, -0.611461, -0.0945617, 0.911515, 0.400091, 0.694399, -0.227615, 0.682673, -0.0411225, 1.35382, -0.0195896 )
bone_name = "Head" bone_name = "Head"
[node name="marker_talk" type="Spatial" parent="skeleton/Skeleton/head" index="0"] [node name="marker_talk" type="Spatial" parent="skeleton/Skeleton/head" index="0"]
@@ -633,6 +677,9 @@ transform = Transform( 0.845972, -0.248965, 0.471515, 0.270435, 0.962465, 0.0230
[node name="head_hurt" type="Area" parent="skeleton/Skeleton/head" index="2"] [node name="head_hurt" type="Area" parent="skeleton/Skeleton/head" index="2"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.1, 0.02 ) transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.1, 0.02 )
collision_layer = 8
collision_mask = 4
monitorable = false
[node name="CollisionShape" type="CollisionShape" parent="skeleton/Skeleton/head/head_hurt" index="0"] [node name="CollisionShape" type="CollisionShape" parent="skeleton/Skeleton/head/head_hurt" index="0"]
shape = SubResource( 1 ) shape = SubResource( 1 )
@@ -649,71 +696,85 @@ transform = Transform( 1, -1.24197e-11, 0, 1.06852e-11, 1, -5.82077e-11, 0, 0, 1
[node name="female-face1" parent="skeleton/Skeleton/head/face" index="0" instance=ExtResource( 3 )] [node name="female-face1" parent="skeleton/Skeleton/head/face" index="0" instance=ExtResource( 3 )]
[node name="hips" type="BoneAttachment" parent="skeleton/Skeleton" index="3"] [node name="hips" type="BoneAttachment" parent="skeleton/Skeleton" index="3"]
transform = Transform( 0.932837, 0.0669982, 0.354143, 0.0474986, -0.99678, 0.0635026, 0.357293, -0.0424105, -0.933064, 0.000203875, 0.898321, -0.00645695 ) transform = Transform( 0.94223, 0.0611767, 0.329466, 0.0446752, -0.997287, 0.0574523, 0.332118, -0.0394095, -0.942444, 0.000203859, 0.89952, -0.00645694 )
bone_name = "Hips" bone_name = "Hips"
[node name="marker_dagger_sacrifice" type="Spatial" parent="skeleton/Skeleton/hips" index="0"] [node name="marker_dagger_sacrifice" type="Spatial" parent="skeleton/Skeleton/hips" index="0"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.2, 0.2 ) transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.2, 0.2 )
[node name="hips_hurt" type="Area" parent="skeleton/Skeleton/hips" index="1"] [node name="hips_hurt" type="Area" parent="skeleton/Skeleton/hips" index="1"]
collision_layer = 8
collision_mask = 4
monitorable = false
[node name="CollisionShape" type="CollisionShape" parent="skeleton/Skeleton/hips/hips_hurt" index="0"] [node name="CollisionShape" type="CollisionShape" parent="skeleton/Skeleton/hips/hips_hurt" index="0"]
shape = SubResource( 2 ) shape = SubResource( 2 )
[node name="wrist_r" type="BoneAttachment" parent="skeleton/Skeleton" index="4"] [node name="wrist_r" type="BoneAttachment" parent="skeleton/Skeleton" index="4"]
transform = Transform( -0.287977, 0.919611, -0.267176, 0.942778, 0.321208, 0.0894101, 0.168042, -0.22614, -0.95949, 0.217922, 0.840792, 0.0647382 ) transform = Transform( -0.245569, 0.908447, -0.338258, 0.959945, 0.276457, 0.0455697, 0.134912, -0.313518, -0.939949, 0.210898, 0.839866, 0.0647882 )
bone_name = "wrist_ik_R" bone_name = "wrist_ik_R"
[node name="weapon_right" type="Spatial" parent="skeleton/Skeleton/wrist_r" index="0"] [node name="weapon_right" type="Spatial" parent="skeleton/Skeleton/wrist_r" index="0"]
transform = Transform( 1, 0, 0, 0, -1.62921e-07, 1, 0, -1, -1.62921e-07, -0.08, 0, -0.01 ) transform = Transform( 1, 0, 0, 0, -1.62921e-07, 1, 0, -1, -1.62921e-07, -0.08, 0, -0.01 )
[node name="wrist_l" type="BoneAttachment" parent="skeleton/Skeleton" index="5"] [node name="wrist_l" type="BoneAttachment" parent="skeleton/Skeleton" index="5"]
transform = Transform( -0.0744099, -0.85538, 0.512627, -0.989629, 0.126679, 0.0677309, -0.122875, -0.50227, -0.855936, -0.175723, 0.838131, -0.0414757 ) transform = Transform( -0.0838252, -0.864731, 0.495188, -0.980276, 0.160814, 0.114885, -0.178979, -0.47579, -0.861156, -0.181656, 0.840334, -0.0498495 )
bone_name = "wrist_ik_L" bone_name = "wrist_ik_L"
[node name="weapon_left" type="Spatial" parent="skeleton/Skeleton/wrist_l" index="0"] [node name="weapon_left" type="Spatial" parent="skeleton/Skeleton/wrist_l" index="0"]
transform = Transform( 1, 0, 0, 0, -1.62921e-07, -1, 0, 1, -1.62921e-07, 0.08, 0, -0.01 ) transform = Transform( 1, 0, 0, 0, -1.62921e-07, -1, 0, 1, -1.62921e-07, 0.08, 0, -0.01 )
[node name="chest" type="BoneAttachment" parent="skeleton/Skeleton" index="6"] [node name="chest" type="BoneAttachment" parent="skeleton/Skeleton" index="6"]
transform = Transform( 0.941419, -0.0483243, -0.333891, 0.0575738, 0.998111, 0.0178291, 0.332436, -0.0360186, 0.942465, -0.00328054, 1.05887, -0.018731 ) transform = Transform( 0.958586, -0.0332876, -0.283002, 0.0462008, 0.998108, 0.0390467, 0.281199, -0.0505137, 0.958342, -0.00285422, 1.06003, -0.0194018 )
bone_name = "Chest" bone_name = "Chest"
[node name="chest_hurt" type="Area" parent="skeleton/Skeleton/chest" index="0"] [node name="chest_hurt" type="Area" parent="skeleton/Skeleton/chest" index="0"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.05, 0 ) transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.05, 0 )
collision_layer = 8
collision_mask = 4
monitorable = false
[node name="CollisionShape" type="CollisionShape" parent="skeleton/Skeleton/chest/chest_hurt" index="0"] [node name="CollisionShape" type="CollisionShape" parent="skeleton/Skeleton/chest/chest_hurt" index="0"]
shape = SubResource( 3 ) shape = SubResource( 3 )
[node name="MeshInstance" type="MeshInstance" parent="skeleton/Skeleton" index="7"] [node name="MeshInstance" type="MeshInstance" parent="skeleton/Skeleton" index="7"]
[node name="neck" type="BoneAttachment" parent="skeleton/Skeleton" index="8"]
transform = Transform( 0.839515, -0.327886, -0.433348, 0.389612, 0.918993, 0.0594129, 0.378795, -0.218737, 0.899283, -0.0168142, 1.28569, -0.00337323 )
bone_name = "Neck"
[node name="marker_neck_grab" type="Position3D" parent="skeleton/Skeleton/neck" index="0"]
transform = Transform( 0.138457, -0.626832, -0.766778, -0.568055, 0.583953, -0.579924, 0.811199, 0.515912, -0.275226, 0, 0.023, -0.085 )
visible = false
[node name="AnimationTree" type="AnimationTree" parent="." index="2"] [node name="AnimationTree" type="AnimationTree" parent="." index="2"]
tree_root = SubResource( 111 ) tree_root = SubResource( 111 )
anim_player = NodePath("../AnimationPlayer") anim_player = NodePath("../AnimationPlayer")
active = true active = true
process_mode = 0
root_motion_track = NodePath("skeleton/Skeleton:root") root_motion_track = NodePath("skeleton/Skeleton:root")
parameters/all_scale/scale = 1.0 parameters/all_scale/scale = 1.0
parameters/blade_left/blend_amount = 0.0 parameters/blade_left/blend_amount = 0.0
parameters/blade_right/blend_amount = 0.0 parameters/blade_right/blend_amount = 0.0
parameters/state/playback = SubResource( 112 ) parameters/state/playback = SubResource( 112 )
parameters/state/attack-melee1/attack1_speed/scale = 1.0
parameters/state/climb1/TimeScale/scale = 2.0 parameters/state/climb1/TimeScale/scale = 2.0
parameters/state/climb1a/TimeScale/scale = 2.0 parameters/state/climb1a/TimeScale/scale = 2.0
parameters/state/fall-back/TimeScale/scale = 1.0
parameters/state/fall-front/TimeScale/scale = 1.0
parameters/state/grabbed/TimeScale/scale = 1.0 parameters/state/grabbed/TimeScale/scale = 1.0
parameters/state/guard-front-melee1/TimeScale/scale = 1.0
parameters/state/guard-melee1/TimeScale/scale = 1.0
parameters/state/kneel/TimeScale/scale = 1.0 parameters/state/kneel/TimeScale/scale = 1.0
parameters/state/locomotion/loc/blend_position = Vector2( -0.00127554, 0.00220752 ) parameters/state/locomotion/loc/blend_position = Vector2( 0.00252736, 0.00604224 )
parameters/state/locomotion/loc/0/TimeScale/scale = 2.0 parameters/state/locomotion/loc/0/TimeScale/scale = 2.0
"parameters/state/locomotion/loc/0/TimeScale 2/scale" = 1.5 "parameters/state/locomotion/loc/0/TimeScale 2/scale" = 1.5
parameters/state/locomotion/loc/0/t1/current = 1 parameters/state/locomotion/loc/0/t1/current = 1
parameters/state/locomotion/loc/1/TimeScale/scale = 1.0 parameters/state/locomotion/loc/1/TimeScale/scale = 1.0
"parameters/state/locomotion/loc/1/TimeScale 2/scale" = 1.0 "parameters/state/locomotion/loc/1/TimeScale 2/scale" = 1.0
parameters/state/locomotion/loc/1/Transition/current = 0 parameters/state/locomotion/loc/1/Transition/current = 1
parameters/state/locomotion/loc/2/TimeScale/scale = 1.0 parameters/state/locomotion/loc/2/TimeScale/scale = 1.0
parameters/state/locomotion/loc/3/TimeScale/scale = 1.0 parameters/state/locomotion/loc/3/TimeScale/scale = 1.0
parameters/state/locomotion/loc/4/TimeScale/scale = 3.5
"parameters/state/locomotion/loc/4/TimeScale 2/scale" = 3.5
parameters/state/locomotion/loc/4/Transition/current = 0
parameters/state/locomotion/loc/5/TimeScale/scale = 1.5
"parameters/state/locomotion/loc/5/TimeScale 2/scale" = 1.5
parameters/state/locomotion/loc/5/Transition/current = 0
parameters/state/pray/TimeScale/scale = 1.0 parameters/state/pray/TimeScale/scale = 1.0
parameters/state/pray-startled/TimeScale/scale = 1.8 parameters/state/pray-startled/TimeScale/scale = 1.8
parameters/state/pray-startled-walk/TimeScale/scale = 1.3 parameters/state/pray-startled-walk/TimeScale/scale = 1.3

File diff suppressed because it is too large Load Diff

View File

@@ -1,9 +1,18 @@
[gd_scene load_steps=95 format=2] [gd_scene load_steps=123 format=2]
[ext_resource path="res://scenes/characters/vroid1-man.gltf" type="PackedScene" id=1] [ext_resource path="res://scenes/characters/vroid1-man.gltf" type="PackedScene" id=1]
[ext_resource path="res://scenes/hair/male-hair1.tscn" type="PackedScene" id=2] [ext_resource path="res://scenes/hair/male-hair1.tscn" type="PackedScene" id=2]
[ext_resource path="res://scenes/face/male-face.tscn" type="PackedScene" id=3] [ext_resource path="res://scenes/face/male-face.tscn" type="PackedScene" id=3]
[sub_resource type="SphereShape" id=149]
radius = 0.15
[sub_resource type="SphereShape" id=148]
radius = 0.18
[sub_resource type="BoxShape" id=147]
extents = Vector3( 0.2, 0.22, 0.12 )
[sub_resource type="AnimationNodeAnimation" id=1] [sub_resource type="AnimationNodeAnimation" id=1]
animation = "blend-blade-right" animation = "blend-blade-right"
@@ -18,6 +27,19 @@ filters = [ "Skeleton:j_bip_l_hand", "Skeleton:j_bip_l_index_1", "Skeleton:j_bip
filter_enabled = true filter_enabled = true
filters = [ "Skeleton:j_bip_r_hand", "Skeleton:j_bip_r_index_1", "Skeleton:j_bip_r_index_2", "Skeleton:j_bip_r_index_3", "Skeleton:j_bip_r_little_1", "Skeleton:j_bip_r_little_2", "Skeleton:j_bip_r_little_3", "Skeleton:j_bip_r_middle_1", "Skeleton:j_bip_r_middle_2", "Skeleton:j_bip_r_middle_3", "Skeleton:j_bip_r_ring_1", "Skeleton:j_bip_r_ring_2", "Skeleton:j_bip_r_ring_3", "Skeleton:j_bip_r_thumb_1", "Skeleton:j_bip_r_thumb_2", "Skeleton:j_bip_r_thumb_3" ] filters = [ "Skeleton:j_bip_r_hand", "Skeleton:j_bip_r_index_1", "Skeleton:j_bip_r_index_2", "Skeleton:j_bip_r_index_3", "Skeleton:j_bip_r_little_1", "Skeleton:j_bip_r_little_2", "Skeleton:j_bip_r_little_3", "Skeleton:j_bip_r_middle_1", "Skeleton:j_bip_r_middle_2", "Skeleton:j_bip_r_middle_3", "Skeleton:j_bip_r_ring_1", "Skeleton:j_bip_r_ring_2", "Skeleton:j_bip_r_ring_3", "Skeleton:j_bip_r_thumb_1", "Skeleton:j_bip_r_thumb_2", "Skeleton:j_bip_r_thumb_3" ]
[sub_resource type="AnimationNodeAnimation" id=145]
animation = "attack-melee-weapon1"
[sub_resource type="AnimationNodeTimeScale" id=146]
[sub_resource type="AnimationNodeBlendTree" id=142]
graph_offset = Vector2( -534, 8 )
nodes/Animation/node = SubResource( 145 )
nodes/Animation/position = Vector2( -240, 158 )
nodes/TimeScale/node = SubResource( 146 )
nodes/TimeScale/position = Vector2( 60, 160 )
node_connections = [ "output", 0, "TimeScale", "TimeScale", 0, "Animation" ]
[sub_resource type="AnimationNodeAnimation" id=5] [sub_resource type="AnimationNodeAnimation" id=5]
animation = "cliimb1" animation = "cliimb1"
@@ -57,12 +79,39 @@ nodes/TimeScale/position = Vector2( 520, 120 )
nodes/output/position = Vector2( 740, 140 ) nodes/output/position = Vector2( 740, 140 )
node_connections = [ "output", 0, "TimeScale", "TimeScale", 0, "Animation" ] node_connections = [ "output", 0, "TimeScale", "TimeScale", 0, "Animation" ]
[sub_resource type="AnimationNodeAnimation" id=166]
animation = "fall-back"
[sub_resource type="AnimationNodeTimeScale" id=167]
[sub_resource type="AnimationNodeBlendTree" id=162]
graph_offset = Vector2( -555.162, -192.155 )
nodes/Animation/node = SubResource( 166 )
nodes/Animation/position = Vector2( -180, 160 )
nodes/TimeScale/node = SubResource( 167 )
nodes/TimeScale/position = Vector2( 40, 160 )
node_connections = [ "output", 0, "TimeScale", "TimeScale", 0, "Animation" ]
[sub_resource type="AnimationNodeAnimation" id=163]
animation = "fall-front"
[sub_resource type="AnimationNodeTimeScale" id=164]
[sub_resource type="AnimationNodeBlendTree" id=165]
nodes/Animation/node = SubResource( 163 )
nodes/Animation/position = Vector2( 239, 374 )
nodes/TimeScale/node = SubResource( 164 )
nodes/TimeScale/position = Vector2( 451, 367 )
nodes/output/position = Vector2( 800, 360 )
node_connections = [ "output", 0, "TimeScale", "TimeScale", 0, "Animation" ]
[sub_resource type="AnimationNodeAnimation" id=14] [sub_resource type="AnimationNodeAnimation" id=14]
animation = "start-grab" animation = "start-grab2"
[sub_resource type="AnimationNodeTimeScale" id=15] [sub_resource type="AnimationNodeTimeScale" id=15]
[sub_resource type="AnimationNodeBlendTree" id=16] [sub_resource type="AnimationNodeBlendTree" id=16]
graph_offset = Vector2( 119.058, 0 )
nodes/Animation/node = SubResource( 14 ) nodes/Animation/node = SubResource( 14 )
nodes/Animation/position = Vector2( 573, 137 ) nodes/Animation/position = Vector2( 573, 137 )
nodes/TimeScale/node = SubResource( 15 ) nodes/TimeScale/node = SubResource( 15 )
@@ -70,6 +119,21 @@ nodes/TimeScale/position = Vector2( 820, 100 )
nodes/output/position = Vector2( 1160, 140 ) nodes/output/position = Vector2( 1160, 140 )
node_connections = [ "output", 0, "TimeScale", "TimeScale", 0, "Animation" ] node_connections = [ "output", 0, "TimeScale", "TimeScale", 0, "Animation" ]
[sub_resource type="AnimationNodeBlendTree" id=157]
[sub_resource type="AnimationNodeAnimation" id=150]
animation = "giard-melee-backwards1"
[sub_resource type="AnimationNodeTimeScale" id=151]
[sub_resource type="AnimationNodeBlendTree" id=152]
nodes/Animation/node = SubResource( 150 )
nodes/Animation/position = Vector2( 242, 180 )
nodes/TimeScale/node = SubResource( 151 )
nodes/TimeScale/position = Vector2( 520, 180 )
nodes/output/position = Vector2( 800, 180 )
node_connections = [ "output", 0, "TimeScale", "TimeScale", 0, "Animation" ]
[sub_resource type="AnimationNodeAnimation" id=17] [sub_resource type="AnimationNodeAnimation" id=17]
animation = "stand1-loop" animation = "stand1-loop"
@@ -252,7 +316,7 @@ nodes/TimeScale/position = Vector2( 780, 260 )
nodes/Transition/node = SubResource( 118 ) nodes/Transition/node = SubResource( 118 )
nodes/Transition/position = Vector2( 500, 280 ) nodes/Transition/position = Vector2( 500, 280 )
nodes/output/position = Vector2( 1000, 260 ) nodes/output/position = Vector2( 1000, 260 )
node_connections = [ "output", 0, "TimeScale", "TimeScale", 0, "Transition", "Transition", 0, "Animation", "Transition", 1, "Animation 2" ] node_connections = [ "output", 0, "TimeScale", "Transition", 0, "Animation", "Transition", 1, "Animation 2", "TimeScale", 0, "Transition" ]
[sub_resource type="AnimationNodeAnimation" id=119] [sub_resource type="AnimationNodeAnimation" id=119]
animation = "turn-right" animation = "turn-right"
@@ -280,7 +344,7 @@ nodes/TimeScale/position = Vector2( 840, 260 )
nodes/Transition/node = SubResource( 120 ) nodes/Transition/node = SubResource( 120 )
nodes/Transition/position = Vector2( 560, 260 ) nodes/Transition/position = Vector2( 560, 260 )
nodes/output/position = Vector2( 1060, 260 ) nodes/output/position = Vector2( 1060, 260 )
node_connections = [ "output", 0, "TimeScale", "TimeScale", 0, "Transition", "Transition", 0, "Animation", "Transition", 1, "Animation 2" ] node_connections = [ "output", 0, "TimeScale", "Transition", 0, "Animation", "Transition", 1, "Animation 2", "TimeScale", 0, "Transition" ]
[sub_resource type="AnimationNodeAnimation" id=123] [sub_resource type="AnimationNodeAnimation" id=123]
animation = "dagger-sacrifice-counter-a" animation = "dagger-sacrifice-counter-a"
@@ -312,7 +376,7 @@ nodes/TimeScale/position = Vector2( 700, 140 )
nodes/Transition/node = SubResource( 125 ) nodes/Transition/node = SubResource( 125 )
nodes/Transition/position = Vector2( 940, 140 ) nodes/Transition/position = Vector2( 940, 140 )
nodes/output/position = Vector2( 1240, 140 ) nodes/output/position = Vector2( 1240, 140 )
node_connections = [ "output", 0, "Transition", "TimeScale", 0, "Animation", "Transition", 0, "TimeScale", "Transition", 1, "TimeScale 2", "TimeScale 2", 0, "Animation 2" ] node_connections = [ "output", 0, "Transition", "Transition", 0, "TimeScale", "Transition", 1, "TimeScale 2", "TimeScale 2", 0, "Animation 2", "TimeScale", 0, "Animation" ]
[sub_resource type="AnimationNodeStateMachineTransition" id=55] [sub_resource type="AnimationNodeStateMachineTransition" id=55]
@@ -375,21 +439,65 @@ xfade_time = 0.5
switch_mode = 2 switch_mode = 2
xfade_time = 0.5 xfade_time = 0.5
[sub_resource type="AnimationNodeStateMachineTransition" id=143]
[sub_resource type="AnimationNodeStateMachineTransition" id=144]
switch_mode = 2
auto_advance = true
[sub_resource type="AnimationNodeStateMachineTransition" id=153]
switch_mode = 1
[sub_resource type="AnimationNodeStateMachineTransition" id=154]
switch_mode = 2
[sub_resource type="AnimationNodeStateMachineTransition" id=155]
[sub_resource type="AnimationNodeStateMachineTransition" id=156]
switch_mode = 2
auto_advance = true
[sub_resource type="AnimationNodeStateMachineTransition" id=158]
[sub_resource type="AnimationNodeStateMachineTransition" id=159]
switch_mode = 2
auto_advance = true
[sub_resource type="AnimationNodeStateMachineTransition" id=160]
switch_mode = 2
[sub_resource type="AnimationNodeStateMachineTransition" id=161]
switch_mode = 2
[sub_resource type="AnimationNodeStateMachineTransition" id=168]
[sub_resource type="AnimationNodeStateMachineTransition" id=169]
[sub_resource type="AnimationNodeStateMachine" id=70] [sub_resource type="AnimationNodeStateMachine" id=70]
states/attack-melee1/node = SubResource( 142 )
states/attack-melee1/position = Vector2( 804.317, 380 )
states/climb1/node = SubResource( 7 ) states/climb1/node = SubResource( 7 )
states/climb1/position = Vector2( 359.444, 656 ) states/climb1/position = Vector2( 359.444, 656 )
states/climb1a/node = SubResource( 10 ) states/climb1a/node = SubResource( 10 )
states/climb1a/position = Vector2( 659.444, 154 ) states/climb1a/position = Vector2( 713.444, 92 )
states/drive/node = SubResource( 13 ) states/drive/node = SubResource( 13 )
states/drive/position = Vector2( 289, 430 ) states/drive/position = Vector2( 424, 557 )
states/fall-back/node = SubResource( 162 )
states/fall-back/position = Vector2( 568.317, 615 )
states/fall-front/node = SubResource( 165 )
states/fall-front/position = Vector2( 604.317, 536 )
states/grab/node = SubResource( 16 ) states/grab/node = SubResource( 16 )
states/grab/position = Vector2( 739.444, 243 ) states/grab/position = Vector2( 713.444, 145 )
states/guard-front-melee1/node = SubResource( 157 )
states/guard-front-melee1/position = Vector2( 835.317, 274 )
states/guard-melee1/node = SubResource( 152 )
states/guard-melee1/position = Vector2( 671.317, 463 )
states/locomotion/node = SubResource( 41 ) states/locomotion/node = SubResource( 41 )
states/locomotion/position = Vector2( 231, 174 ) states/locomotion/position = Vector2( 231, 174 )
states/passenger/node = SubResource( 44 ) states/passenger/node = SubResource( 44 )
states/passenger/position = Vector2( 555.444, 339 ) states/passenger/position = Vector2( 458.444, 421 )
states/sacrificed-a/node = SubResource( 48 ) states/sacrificed-a/node = SubResource( 48 )
states/sacrificed-a/position = Vector2( 628.444, 464 ) states/sacrificed-a/position = Vector2( 625.444, 779 )
states/sleeping/node = SubResource( 51 ) states/sleeping/node = SubResource( 51 )
states/sleeping/position = Vector2( -112.556, 339 ) states/sleeping/position = Vector2( -112.556, 339 )
states/start_walking/node = SubResource( 102 ) states/start_walking/node = SubResource( 102 )
@@ -402,12 +510,12 @@ states/turn_right/node = SubResource( 110 )
states/turn_right/position = Vector2( 177.444, 671 ) states/turn_right/position = Vector2( 177.444, 671 )
states/use_tap/node = SubResource( 54 ) states/use_tap/node = SubResource( 54 )
states/use_tap/position = Vector2( -138.556, 174 ) states/use_tap/position = Vector2( -138.556, 174 )
transitions = [ "locomotion", "drive", SubResource( 55 ), "drive", "locomotion", SubResource( 56 ), "locomotion", "passenger", SubResource( 57 ), "passenger", "locomotion", SubResource( 58 ), "drive", "passenger", SubResource( 59 ), "passenger", "drive", SubResource( 60 ), "sleeping", "locomotion", SubResource( 61 ), "locomotion", "grab", SubResource( 62 ), "grab", "locomotion", SubResource( 63 ), "locomotion", "climb1", SubResource( 64 ), "climb1", "locomotion", SubResource( 65 ), "locomotion", "climb1a", SubResource( 66 ), "climb1a", "locomotion", SubResource( 67 ), "locomotion", "use_tap", SubResource( 68 ), "use_tap", "locomotion", SubResource( 69 ), "locomotion", "stop_walking", SubResource( 100 ), "stop_walking", "locomotion", SubResource( 101 ), "locomotion", "start_walking", SubResource( 103 ), "start_walking", "locomotion", SubResource( 104 ), "locomotion", "turn_left", SubResource( 111 ), "turn_left", "locomotion", SubResource( 112 ), "locomotion", "turn_right", SubResource( 113 ), "turn_right", "locomotion", SubResource( 114 ) ] transitions = [ "locomotion", "drive", SubResource( 55 ), "drive", "locomotion", SubResource( 56 ), "locomotion", "passenger", SubResource( 57 ), "passenger", "locomotion", SubResource( 58 ), "drive", "passenger", SubResource( 59 ), "passenger", "drive", SubResource( 60 ), "sleeping", "locomotion", SubResource( 61 ), "locomotion", "grab", SubResource( 62 ), "grab", "locomotion", SubResource( 63 ), "locomotion", "climb1", SubResource( 64 ), "climb1", "locomotion", SubResource( 65 ), "locomotion", "climb1a", SubResource( 66 ), "climb1a", "locomotion", SubResource( 67 ), "locomotion", "use_tap", SubResource( 68 ), "use_tap", "locomotion", SubResource( 69 ), "locomotion", "stop_walking", SubResource( 100 ), "stop_walking", "locomotion", SubResource( 101 ), "locomotion", "start_walking", SubResource( 103 ), "start_walking", "locomotion", SubResource( 104 ), "locomotion", "turn_left", SubResource( 111 ), "turn_left", "locomotion", SubResource( 112 ), "locomotion", "turn_right", SubResource( 113 ), "turn_right", "locomotion", SubResource( 114 ), "locomotion", "attack-melee1", SubResource( 143 ), "attack-melee1", "locomotion", SubResource( 144 ), "attack-melee1", "guard-melee1", SubResource( 153 ), "guard-melee1", "attack-melee1", SubResource( 154 ), "locomotion", "guard-melee1", SubResource( 155 ), "guard-melee1", "locomotion", SubResource( 156 ), "locomotion", "guard-front-melee1", SubResource( 158 ), "guard-front-melee1", "locomotion", SubResource( 159 ), "guard-front-melee1", "attack-melee1", SubResource( 160 ), "attack-melee1", "guard-front-melee1", SubResource( 161 ), "locomotion", "fall-front", SubResource( 168 ), "locomotion", "fall-back", SubResource( 169 ) ]
start_node = "locomotion" start_node = "locomotion"
graph_offset = Vector2( -470.556, -68 ) graph_offset = Vector2( -230.683, 15 )
[sub_resource type="AnimationNodeBlendTree" id=71] [sub_resource type="AnimationNodeBlendTree" id=71]
graph_offset = Vector2( -499.98, 0 ) graph_offset = Vector2( -534, -71 )
nodes/Animation/node = SubResource( 2 ) nodes/Animation/node = SubResource( 2 )
nodes/Animation/position = Vector2( -200, 260 ) nodes/Animation/position = Vector2( -200, 260 )
"nodes/Animation 2/node" = SubResource( 1 ) "nodes/Animation 2/node" = SubResource( 1 )
@@ -427,6 +535,7 @@ node_connections = [ "output", 0, "blade_right", "blade_left", 0, "state", "blad
[node name="Skeleton" parent="." index="0"] [node name="Skeleton" parent="." index="0"]
bones/1/bound_children = [ NodePath("hips") ] bones/1/bound_children = [ NodePath("hips") ]
bones/23/bound_children = [ NodePath("chest") ]
bones/75/bound_children = [ NodePath("neck") ] bones/75/bound_children = [ NodePath("neck") ]
bones/76/bound_children = [ NodePath("head") ] bones/76/bound_children = [ NodePath("head") ]
bones/80/bound_children = [ NodePath("penis_2") ] bones/80/bound_children = [ NodePath("penis_2") ]
@@ -434,7 +543,7 @@ bones/94/bound_children = [ NodePath("wrist_r") ]
bones/96/bound_children = [ NodePath("wrist_l") ] bones/96/bound_children = [ NodePath("wrist_l") ]
[node name="wrist_r" type="BoneAttachment" parent="Skeleton" index="2"] [node name="wrist_r" type="BoneAttachment" parent="Skeleton" index="2"]
transform = Transform( 0.0279129, 0.998729, 0.041974, 0.083992, -0.0441852, 0.995486, 0.996075, -0.0242614, -0.0851186, 0.24008, 1.0159, -0.0583036 ) transform = Transform( 0.0279129, 0.998728, 0.041974, 0.083992, -0.0441852, 0.995486, 0.996075, -0.0242614, -0.0851186, 0.24008, 1.0159, -0.0689935 )
bone_name = "wrist_ik_r" bone_name = "wrist_ik_r"
[node name="marker_wrist_r_grab" type="Position3D" parent="Skeleton/wrist_r" index="0"] [node name="marker_wrist_r_grab" type="Position3D" parent="Skeleton/wrist_r" index="0"]
@@ -445,7 +554,7 @@ visible = false
transform = Transform( -1.62921e-07, -1, 0, -1.62921e-07, 2.65431e-14, 1, -1, 1.62921e-07, -1.62921e-07, -0.0452205, -0.00161505, -0.0947611 ) transform = Transform( -1.62921e-07, -1, 0, -1.62921e-07, 2.65431e-14, 1, -1, 1.62921e-07, -1.62921e-07, -0.0452205, -0.00161505, -0.0947611 )
[node name="wrist_l" type="BoneAttachment" parent="Skeleton" index="3"] [node name="wrist_l" type="BoneAttachment" parent="Skeleton" index="3"]
transform = Transform( 0.531637, -0.84656, 0.0264325, -0.0845947, -0.0220212, 0.996172, -0.842737, -0.531838, -0.0833217, -0.202819, 1.0271, -0.0530299 ) transform = Transform( 0.531637, -0.84656, 0.0264325, -0.0845947, -0.0220212, 0.996172, -0.842737, -0.531838, -0.0833217, -0.202819, 1.02836, -0.0471478 )
bone_name = "wrist_ik_l" bone_name = "wrist_ik_l"
[node name="marker_wrist_l_grab" type="Position3D" parent="Skeleton/wrist_l" index="0"] [node name="marker_wrist_l_grab" type="Position3D" parent="Skeleton/wrist_l" index="0"]
@@ -456,7 +565,7 @@ visible = false
transform = Transform( -1.62921e-07, 1, 0, 1.62921e-07, 2.65431e-14, -1, -1, -1.62921e-07, -1.62921e-07, 0.04, -0.01, -0.089 ) transform = Transform( -1.62921e-07, 1, 0, 1.62921e-07, 2.65431e-14, -1, -1, -1.62921e-07, -1.62921e-07, 0.04, -0.01, -0.089 )
[node name="head" type="BoneAttachment" parent="Skeleton" index="4"] [node name="head" type="BoneAttachment" parent="Skeleton" index="4"]
transform = Transform( 0.998061, -0.0095934, -0.0614997, 0.0314598, 0.930306, 0.365432, 0.0537078, -0.366659, 0.928804, -0.0330975, 1.69764, -0.00609486 ) transform = Transform( 0.998981, -0.0174369, -0.0416214, 0.0314635, 0.930306, 0.365432, 0.0323486, -0.366369, 0.929906, -0.0329707, 1.69764, -0.0053772 )
bone_name = "J_Bip_C_Head" bone_name = "J_Bip_C_Head"
[node name="marker_talk" type="Position3D" parent="Skeleton/head" index="0"] [node name="marker_talk" type="Position3D" parent="Skeleton/head" index="0"]
@@ -473,16 +582,33 @@ transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0.011 )
[node name="male-face" parent="Skeleton/head/face" index="0" instance=ExtResource( 3 )] [node name="male-face" parent="Skeleton/head/face" index="0" instance=ExtResource( 3 )]
[node name="head_hurt" type="Area" parent="Skeleton/head" index="3"]
collision_layer = 8
collision_mask = 4
monitorable = false
[node name="CollisionShape" type="CollisionShape" parent="Skeleton/head/head_hurt" index="0"]
transform = Transform( 0.967007, -0.0921614, 0.237496, 0.0940632, 0.995561, 0.00333673, -0.236749, 0.019113, 0.971383, 0.00128094, 0.0854003, 0.000879645 )
shape = SubResource( 149 )
[node name="hips" type="BoneAttachment" parent="Skeleton" index="5"] [node name="hips" type="BoneAttachment" parent="Skeleton" index="5"]
transform = Transform( 0.988538, -0.146769, 0.0353867, 0.150102, 0.98061, -0.125986, -0.0162097, 0.129854, 0.991401, 0.000514592, 1.10104, -0.0117666 ) transform = Transform( 0.987964, -0.143962, 0.0565838, 0.150106, 0.98061, -0.125986, -0.0373495, 0.132963, 0.990417, 0.000514592, 1.10104, -0.0117666 )
bone_name = "J_Bip_C_Hips" bone_name = "J_Bip_C_Hips"
[node name="marker_hips_action" type="Position3D" parent="Skeleton/hips" index="0"] [node name="marker_hips_action" type="Position3D" parent="Skeleton/hips" index="0"]
transform = Transform( 0.999999, 0.000161137, 0.00126248, -0.000160797, 1, -0.000193566, -0.00126263, 0.000193223, 0.999999, 0.0136906, -0.0795597, 0.214268 ) transform = Transform( 0.999999, 0.000161137, 0.00126248, -0.000160797, 1, -0.000193566, -0.00126263, 0.000193223, 0.999999, 0.0136906, -0.0795597, 0.214268 )
visible = false visible = false
[node name="hips_hurt" type="Area" parent="Skeleton/hips" index="1"]
collision_layer = 8
collision_mask = 4
monitorable = false
[node name="CollisionShape" type="CollisionShape" parent="Skeleton/hips/hips_hurt" index="0"]
shape = SubResource( 148 )
[node name="neck" type="BoneAttachment" parent="Skeleton" index="6"] [node name="neck" type="BoneAttachment" parent="Skeleton" index="6"]
transform = Transform( 0.999522, -0.0284599, 0.0120657, 0.0262095, 0.987195, 0.157347, -0.0163893, -0.156956, 0.987469, -0.0303023, 1.60068, 0.00932036 ) transform = Transform( 0.998943, -0.0318141, 0.033183, 0.0262132, 0.987195, 0.157347, -0.037764, -0.156311, 0.986985, -0.0298461, 1.60068, 0.00997471 )
bone_name = "J_Bip_C_Neck" bone_name = "J_Bip_C_Neck"
[node name="marker_neck_grab" type="Position3D" parent="Skeleton/neck" index="0"] [node name="marker_neck_grab" type="Position3D" parent="Skeleton/neck" index="0"]
@@ -490,13 +616,25 @@ transform = Transform( 0.998758, -0.00781338, 0.0492147, 0.00787775, 0.999969, -
visible = false visible = false
[node name="penis_2" type="BoneAttachment" parent="Skeleton" index="7"] [node name="penis_2" type="BoneAttachment" parent="Skeleton" index="7"]
transform = Transform( 0.988538, 0.119852, -0.0918097, 0.150102, -0.845508, 0.51243, -0.0162103, -0.520337, -0.853807, 0.0156493, 0.991264, -0.105296 ) transform = Transform( 0.987964, 0.108698, -0.110052, 0.150106, -0.845508, 0.51243, -0.0373501, -0.522782, -0.851648, 0.0136458, 0.991264, -0.105598 )
bone_name = "penis2" bone_name = "penis2"
[node name="marker_penis_action" type="Position3D" parent="Skeleton/penis_2" index="0"] [node name="marker_penis_action" type="Position3D" parent="Skeleton/penis_2" index="0"]
transform = Transform( 0.998824, -0.0252848, -0.0413812, 0.0249792, 0.999657, -0.00788352, 0.0415664, 0.00684074, 0.999113, -0.0100176, 0.0641036, 0.0307807 ) transform = Transform( 0.998824, -0.0252848, -0.0413812, 0.0249792, 0.999657, -0.00788352, 0.0415664, 0.00684074, 0.999113, -0.0100176, 0.0641036, 0.0307807 )
visible = false visible = false
[node name="chest" type="BoneAttachment" parent="Skeleton" index="8"]
transform = Transform( 0.998943, -0.0241071, 0.0391486, 0.0262218, 0.998173, -0.0544354, -0.0377648, 0.0554043, 0.997749, -0.0235756, 1.33823, -0.00638926 )
bone_name = "J_Bip_C_Chest"
[node name="chest_hurt" type="Area" parent="Skeleton/chest" index="0"]
collision_layer = 8
collision_mask = 4
monitorable = false
[node name="CollisionShape" type="CollisionShape" parent="Skeleton/chest/chest_hurt" index="0"]
shape = SubResource( 147 )
[node name="AnimationTree" type="AnimationTree" parent="." index="2"] [node name="AnimationTree" type="AnimationTree" parent="." index="2"]
tree_root = SubResource( 71 ) tree_root = SubResource( 71 )
anim_player = NodePath("../AnimationPlayer") anim_player = NodePath("../AnimationPlayer")
@@ -506,10 +644,14 @@ root_motion_track = NodePath("Skeleton:Root")
parameters/blade_left/blend_amount = 0.0 parameters/blade_left/blend_amount = 0.0
parameters/blade_right/blend_amount = 0.0 parameters/blade_right/blend_amount = 0.0
parameters/state/playback = SubResource( 72 ) parameters/state/playback = SubResource( 72 )
parameters/state/attack-melee1/TimeScale/scale = 1.0
parameters/state/climb1/TimeScale/scale = 2.0 parameters/state/climb1/TimeScale/scale = 2.0
parameters/state/climb1a/TimeScale/scale = 2.0 parameters/state/climb1a/TimeScale/scale = 2.0
parameters/state/drive/TimeScale/scale = 1.0 parameters/state/drive/TimeScale/scale = 1.0
parameters/state/fall-back/TimeScale/scale = 1.0
parameters/state/fall-front/TimeScale/scale = 1.0
parameters/state/grab/TimeScale/scale = 1.0 parameters/state/grab/TimeScale/scale = 1.0
parameters/state/guard-melee1/TimeScale/scale = 1.0
parameters/state/locomotion/loc/blend_position = Vector2( -0.00293946, -0.0151844 ) parameters/state/locomotion/loc/blend_position = Vector2( -0.00293946, -0.0151844 )
parameters/state/locomotion/loc/0/TimeScale/scale = 1.0 parameters/state/locomotion/loc/0/TimeScale/scale = 1.0
parameters/state/locomotion/loc/1/TimeScale/scale = 2.0 parameters/state/locomotion/loc/1/TimeScale/scale = 2.0

7
fonts/DefaultFont.tres Normal file
View File

@@ -0,0 +1,7 @@
[gd_resource type="DynamicFont" load_steps=2 format=2]
[ext_resource path="res://fonts/Overlock-Regular.ttf" type="DynamicFontData" id=1]
[resource]
size = 30
font_data = ExtResource( 1 )

94
fonts/OFL.txt Normal file
View File

@@ -0,0 +1,94 @@
Copyright (c) 2011, Dario Manuel Muhafara (http://www.tipo.net.ar),
with Reserved Font Names "Overlock" "Overlock SC"
This Font Software is licensed under the SIL Open Font License, Version 1.1.
This license is copied below, and is also available with a FAQ at:
http://scripts.sil.org/OFL
-----------------------------------------------------------
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
-----------------------------------------------------------
PREAMBLE
The goals of the Open Font License (OFL) are to stimulate worldwide
development of collaborative font projects, to support the font creation
efforts of academic and linguistic communities, and to provide a free and
open framework in which fonts may be shared and improved in partnership
with others.
The OFL allows the licensed fonts to be used, studied, modified and
redistributed freely as long as they are not sold by themselves. The
fonts, including any derivative works, can be bundled, embedded,
redistributed and/or sold with any software provided that any reserved
names are not used by derivative works. The fonts and derivatives,
however, cannot be released under any other type of license. The
requirement for fonts to remain under this license does not apply
to any document created using the fonts or their derivatives.
DEFINITIONS
"Font Software" refers to the set of files released by the Copyright
Holder(s) under this license and clearly marked as such. This may
include source files, build scripts and documentation.
"Reserved Font Name" refers to any names specified as such after the
copyright statement(s).
"Original Version" refers to the collection of Font Software components as
distributed by the Copyright Holder(s).
"Modified Version" refers to any derivative made by adding to, deleting,
or substituting -- in part or in whole -- any of the components of the
Original Version, by changing formats or by porting the Font Software to a
new environment.
"Author" refers to any designer, engineer, programmer, technical
writer or other person who contributed to the Font Software.
PERMISSION & CONDITIONS
Permission is hereby granted, free of charge, to any person obtaining
a copy of the Font Software, to use, study, copy, merge, embed, modify,
redistribute, and sell modified and unmodified copies of the Font
Software, subject to the following conditions:
1) Neither the Font Software nor any of its individual components,
in Original or Modified Versions, may be sold by itself.
2) Original or Modified Versions of the Font Software may be bundled,
redistributed and/or sold with any software, provided that each copy
contains the above copyright notice and this license. These can be
included either as stand-alone text files, human-readable headers or
in the appropriate machine-readable metadata fields within text or
binary files as long as those fields can be easily viewed by the user.
3) No Modified Version of the Font Software may use the Reserved Font
Name(s) unless explicit written permission is granted by the corresponding
Copyright Holder. This restriction only applies to the primary font name as
presented to the users.
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
Software shall not be used to promote, endorse or advertise any
Modified Version, except to acknowledge the contribution(s) of the
Copyright Holder(s) and the Author(s) or with their explicit written
permission.
5) The Font Software, modified or unmodified, in part or in whole,
must be distributed entirely under this license, and must not be
distributed under any other license. The requirement for fonts to
remain under this license does not apply to any document created
using the Font Software.
TERMINATION
This license becomes null and void if any of the above conditions are
not met.
DISCLAIMER
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
OTHER DEALINGS IN THE FONT SOFTWARE.

BIN
fonts/Overlock-Regular.ttf Normal file

Binary file not shown.

2
hostile_dwelling.gd Normal file
View File

@@ -0,0 +1,2 @@
extends Spatial

23
hostile_dwelling.tscn Normal file
View File

@@ -0,0 +1,23 @@
[gd_scene load_steps=4 format=2]
[ext_resource path="res://objects/campfire.scn" type="PackedScene" id=1]
[ext_resource path="res://objects/tent.scn" type="PackedScene" id=2]
[ext_resource path="res://hostile_dwelling.gd" type="Script" id=3]
[node name="hostile_dwelling" type="Spatial"]
script = ExtResource( 3 )
[node name="campfire" parent="." instance=ExtResource( 1 )]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 )
[node name="tent" parent="." instance=ExtResource( 2 )]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 2, 0, 3 )
[node name="npc1" type="Spatial" parent="." groups=["bandit", "male", "spawn"]]
transform = Transform( 0.930494, 0, 0.366306, 0, 1, 0, -0.366306, 0, 0.930494, 4.71933, 0.178202, 0 )
[node name="npc3" type="Spatial" parent="." groups=["bandit", "male", "spawn"]]
transform = Transform( 0.930494, 0, 0.366306, 0, 1, 0, -0.366306, 0, 0.930494, 2.49152, 0.178202, 0 )
[node name="npc2" type="Spatial" parent="." groups=["bandit", "female", "spawn"]]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -2.38509, 0.249482, 0.0150008 )

BIN
objects/DarkMetal.material Normal file

Binary file not shown.

BIN
objects/DarkRed.material Normal file

Binary file not shown.

Binary file not shown.

BIN
objects/Grey.material Normal file

Binary file not shown.

BIN
objects/Grey_001.material Normal file

Binary file not shown.

Binary file not shown.

BIN
objects/Metal.material Normal file

Binary file not shown.

BIN
objects/Red.material Normal file

Binary file not shown.

BIN
objects/Red_001.material Normal file

Binary file not shown.

BIN
objects/White.material Normal file

Binary file not shown.

BIN
objects/White_001.material Normal file

Binary file not shown.

BIN
objects/Wood.material Normal file

Binary file not shown.

BIN
objects/WoodLight.material Normal file

Binary file not shown.

BIN
objects/Wood_001.material Normal file

Binary file not shown.

BIN
objects/Wood_003.material Normal file

Binary file not shown.

Binary file not shown.

BIN
objects/bandit-camp.bin Normal file

Binary file not shown.

1606
objects/bandit-camp.gltf Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -2,12 +2,12 @@
importer="scene" importer="scene"
type="PackedScene" type="PackedScene"
path="res://.import/vroid1-man-animate.gltf-b58dd05f3dd46f7cb8ff28f705603ee5.scn" path="res://.import/bandit-camp.gltf-d3ef9366a694d4783ebaa390be1668fb.scn"
[deps] [deps]
source_file="res://characters/vroid1-man-animate.gltf" source_file="res://objects/bandit-camp.gltf"
dest_files=[ "res://.import/vroid1-man-animate.gltf-b58dd05f3dd46f7cb8ff28f705603ee5.scn" ] dest_files=[ "res://.import/bandit-camp.gltf-d3ef9366a694d4783ebaa390be1668fb.scn" ]
[params] [params]
@@ -15,12 +15,13 @@ nodes/root_type="Spatial"
nodes/root_name="Scene Root" nodes/root_name="Scene Root"
nodes/root_scale=1.0 nodes/root_scale=1.0
nodes/custom_script="" nodes/custom_script=""
nodes/storage=0 nodes/storage=1
nodes/use_legacy_names=false nodes/use_legacy_names=false
materials/location=1 materials/location=1
materials/storage=1 materials/storage=1
materials/keep_on_reimport=true materials/keep_on_reimport=true
meshes/compress=true meshes/octahedral_compression=true
meshes/compress=4286
meshes/ensure_tangents=true meshes/ensure_tangents=true
meshes/storage=0 meshes/storage=0
meshes/light_baking=0 meshes/light_baking=0

BIN
objects/colorRed.material Normal file

Binary file not shown.

32
objects/courtroom.gd Normal file
View File

@@ -0,0 +1,32 @@
extends MeshInstance
# Declare member variables here. Examples:
# var a = 2
# var b = "text"
# Called when the node enters the scene tree for the first time.
func _ready():
call("spawn_everything")
func spawn_everything():
for k in get_children():
if k.name.begins_with("spawn_"):
if k.name.begins_with("spawn_player"):
if scenario.castle1_captured:
scenario.emit_signal("spawn_player", k.global_transform)
else:
k.add_to_group("spawn")
if k.name.begins_with("spawn_courtmaid"):
k.add_to_group("female")
k.add_to_group("courtmaid")
k.set_meta("roster", ["castle1", "courtroom"])
if k.name.begins_with("spawn_mystress"):
k.add_to_group("female")
k.add_to_group("mystress")
k.set_meta("roster", ["castle1", "courtroom"])
if k.name.begins_with("spawn_tied_male"):
k.add_to_group("male")
k.add_to_group("captured")
k.set_meta("roster", ["castle1", "courtroom"])
print("SPAWN!! ", k.name)

7
objects/courtroom.tscn Normal file
View File

@@ -0,0 +1,7 @@
[gd_scene load_steps=3 format=2]
[ext_resource path="res://objects/courtroom.scn" type="PackedScene" id=1]
[ext_resource path="res://objects/courtroom.gd" type="Script" id=2]
[node name="courtroom" instance=ExtResource( 1 )]
script = ExtResource( 2 )

Binary file not shown.

Binary file not shown.

View File

@@ -1,7 +1,7 @@
extends Spatial extends Spatial
const tile_size = 8 const tile_size = 8
const palace_size = 8 const palace_size = 12
const layers = 4 const layers = 4
func _ready(): func _ready():
@@ -25,10 +25,10 @@ func _ready():
var xform = Transform(Basis(), Vector3(x, voffset, z)) var xform = Transform(Basis(), Vector3(x, voffset, z))
if i > 0 && i < palace_size - 1: if i > 0 && i < palace_size - 1:
if j > 0 && j < palace_size - 1: if j > 0 && j < palace_size - 1:
call_deferred("place", ct, xform) call("place", ct, xform)
if i in [0, palace_size - 1] || j in [0, palace_size - 1]: if i in [0, palace_size - 1] || j in [0, palace_size - 1]:
if (j == palace_size / 2.0 || i != palace_size / 2.0): if (j == palace_size / 2.0 || i != palace_size / 2.0):
call_deferred("place", "foundation_tile", xform) call("place", "foundation_tile", xform)
else: else:
var ct = "room_tile" var ct = "room_tile"
var tower_angles = { var tower_angles = {
@@ -60,30 +60,32 @@ func _ready():
xform.basis = Basis().rotated(Vector3.UP, tower_angles[i][j]) xform.basis = Basis().rotated(Vector3.UP, tower_angles[i][j])
if layer == layers - 1: if layer == layers - 1:
var twr = "tower_roof_tile" var twr = "tower_roof_tile"
call_deferred("place", twr, xform) call("place", twr, xform)
else: else:
var tw = "tower_walls_tile" var tw = "tower_walls_tile"
call_deferred("place", tw, xform) call("place", tw, xform)
var st = "stairs_tile" var st = "stairs_tile"
call_deferred("place", st, xform) call("place", st, xform)
if layer == 1: if layer == 1:
var tfl = "tower_floor_tile" var tfl = "tower_floor_tile"
call_deferred("place", tfl, xform) call("place", tfl, xform)
call("place", "courtroom", Transform(Basis(), Vector3(-2, 0, 0)))
var car = Spatial.new() var car = Spatial.new()
car.add_to_group("spawn") car.add_to_group("spawn")
car.add_to_group("keep") car.add_to_group("keep")
car.add_to_group("car") car.add_to_group("car")
add_child(car) add_child(car)
for e in range(5): car.global_transform.origin = Vector3(-5, 0, -5)
var major_f = Spatial.new() # for e in range(5):
major_f.add_to_group("spawn") # var major_f = Spatial.new()
if e == 0: # major_f.add_to_group("spawn")
major_f.add_to_group("male") # if e == 0:
else: # major_f.add_to_group("male")
major_f.add_to_group("female") # else:
major_f.add_to_group("keep") # major_f.add_to_group("female")
add_child(major_f) # major_f.add_to_group("keep")
major_f.global_transform = Transform(Basis(), Vector3(cos(PI / 3 * e) * 2.0, 0, sin(PI / 3 * e) * 2.0) + Vector3(10.0, 0, 0)) # add_child(major_f)
# major_f.global_transform = Transform(Basis(), Vector3(cos(PI / 3 * e) * 2.0, 0, sin(PI / 3 * e) * 2.0) + Vector3(10.0, 0, 0))
print("PALACE done") print("PALACE done")
func place(obj: String, where: Transform): func place(obj: String, where: Transform):
@@ -92,19 +94,19 @@ func place(obj: String, where: Transform):
func spawn_wall(layer:int, i: int, j: int, xform: Transform): func spawn_wall(layer:int, i: int, j: int, xform: Transform):
if layer == layers - 1: if layer == layers - 1:
var rt = "roof_tile" var rt = "roof_tile"
call_deferred("place", rt, xform) call("place", rt, xform)
elif (j != palace_size / 2.0 && i != palace_size / 2.0)|| layer > 2: elif (j != palace_size / 2.0 && i != palace_size / 2.0)|| layer > 2:
var ct = "room_tile" var ct = "room_tile"
call_deferred("place", ct, xform) call("place", ct, xform)
elif (j == palace_size / 2.0 && i != palace_size / 2.0) && layer == 1: elif (j == palace_size / 2.0 && i != palace_size / 2.0) && layer == 1:
var ent = "entry_tile" var ent = "entry_tile"
call_deferred("place", ent, xform) call("place", ent, xform)
elif (j != palace_size / 2.0 && i == palace_size / 2.0) && layer == 1: elif (j != palace_size / 2.0 && i == palace_size / 2.0) && layer == 1:
var gw = "gate_bottom_tile" var gw = "gate_bottom_tile"
call_deferred("place", gw, xform) call("place", gw, xform)
elif (j != palace_size / 2.0 && i == palace_size / 2.0) && layer == 2: elif (j != palace_size / 2.0 && i == palace_size / 2.0) && layer == 2:
var gw = "gate_top_tile" var gw = "gate_top_tile"
call_deferred("place", gw, xform) call("place", gw, xform)
elif (j == palace_size / 2.0 && i != palace_size / 2.0) && layer == 2: elif (j == palace_size / 2.0 && i != palace_size / 2.0) && layer == 2:
var ct = "room_tile" var ct = "room_tile"
call_deferred("place", ct, xform) call("place", ct, xform)

File diff suppressed because it is too large Load Diff

View File

@@ -20,6 +20,7 @@ nodes/use_legacy_names=false
materials/location=1 materials/location=1
materials/storage=1 materials/storage=1
materials/keep_on_reimport=true materials/keep_on_reimport=true
meshes/octahedral_compression=true
meshes/compress=true meshes/compress=true
meshes/ensure_tangents=true meshes/ensure_tangents=true
meshes/storage=0 meshes/storage=0

Binary file not shown.

BIN
objects/stone_001.material Normal file

Binary file not shown.

View File

@@ -1,21 +1,8 @@
extends Spatial extends Spatial
onready var rnd = RandomNumberGenerator.new()
var spawn = []
func _ready():
pass
func spawn_child(n: String, xform: Transform) -> void:
var x = xform
if n.ends_with("_rotated"):
x.basis = x.basis.rotated(Vector3(0, 1, 0), PI)
n = n.replace("_rotated", "")
streaming.spawn_child(n, global_transform * x)
static func build_house(main_xform: Transform): static func build_house(main_xform: Transform):
var rnd = RandomNumberGenerator.new() var rnd = streaming.get_place_rnd(main_xform)
var s = int(main_xform.origin.x + 100 * main_xform.origin.z * 2) % 0x1ffffff print(main_xform.origin, " seed = ", rnd.state)
rnd.seed = s
print(main_xform.origin, " seed = ", s)
var l = 6 + 2 * rnd.randi() % 7 - 1 var l = 6 + 2 * rnd.randi() % 7 - 1
var h = l - 1 var h = l - 1
var d = 3 + rnd.randi() % (l - 5 + 1) var d = 3 + rnd.randi() % (l - 5 + 1)
@@ -73,10 +60,7 @@ func _process(delta):
state = 1 state = 1
1: 1:
var objects = build_house(global_transform) var objects = build_house(global_transform)
for obj in objects: streaming.spawn_house_objects(global_transform, objects)
var x = obj.xform
for w in obj.data:
call_deferred("spawn_child", w, x)
state = 2 state = 2
2: 2:
set_process(false) set_process(false)

View File

@@ -20,6 +20,7 @@ nodes/use_legacy_names=false
materials/location=1 materials/location=1
materials/storage=1 materials/storage=1
materials/keep_on_reimport=true materials/keep_on_reimport=true
meshes/octahedral_compression=true
meshes/compress=true meshes/compress=true
meshes/ensure_tangents=true meshes/ensure_tangents=true
meshes/storage=0 meshes/storage=0

BIN
objects/wood.material Normal file

Binary file not shown.

BIN
objects/woodBark.material Normal file

Binary file not shown.

Binary file not shown.

BIN
objects/wood_006.material Normal file

Binary file not shown.

View File

@@ -8,13 +8,26 @@
config_version=4 config_version=4
_global_script_classes=[ {
"base": "VoxelGeneratorScript",
"class": "TerrainData",
"language": "GDScript",
"path": "res://generator.gd"
} ]
_global_script_class_icons={
"TerrainData": ""
}
[application] [application]
run/main_scene="res://world.tscn" config/name="academy2"
run/main_scene="res://ui/main_menu.tscn"
config/use_custom_user_dir=true
config/custom_user_dir_name="academy2"
run/flush_stdout_on_print=true
[autoload] [autoload]
Map="res://autoload/map.tscn"
characters="*res://autoload/characters.gd" characters="*res://autoload/characters.gd"
controls="*res://autoload/controls.gd" controls="*res://autoload/controls.gd"
doors="*res://autoload/doors.gd" doors="*res://autoload/doors.gd"
@@ -23,9 +36,12 @@ inventory="*res://autoload/inventory.gd"
streaming="*res://autoload/streaming.tscn" streaming="*res://autoload/streaming.tscn"
freezer="*res://autoload/freezer.gd" freezer="*res://autoload/freezer.gd"
scenario="*res://autoload/scenario.gd" scenario="*res://autoload/scenario.gd"
orchestration="*res://autoload/orchestration.tscn"
combat="*res://autoload/combat.gd"
[debug] [debug]
settings/profiler/max_functions=65535
settings/stdout/verbose_stdout=true settings/stdout/verbose_stdout=true
[display] [display]
@@ -69,9 +85,40 @@ fps_mode={
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":86,"physical_scancode":0,"unicode":0,"echo":false,"script":null) "events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":86,"physical_scancode":0,"unicode":0,"echo":false,"script":null)
] ]
} }
action2={
"deadzone": 0.5,
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":70,"physical_scancode":0,"unicode":0,"echo":false,"script":null)
]
}
attack={
"deadzone": 0.5,
"events": [ Object(InputEventMouseButton,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"button_mask":0,"position":Vector2( 0, 0 ),"global_position":Vector2( 0, 0 ),"factor":1.0,"button_index":1,"pressed":false,"doubleclick":false,"script":null)
]
}
jump={
"deadzone": 0.5,
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":32,"physical_scancode":0,"unicode":0,"echo":false,"script":null)
]
}
[memory]
limits/multithreaded_server/rid_pool_prealloc=256
limits/message_queue/max_size_kb=6144
limits/command_queue/multithreading_queue_size_kb=512
[physics]
common/physics_fps=150
3d/physics_engine="Bullet"
[rendering] [rendering]
quality/driver/fallback_to_gles2=true quality/driver/fallback_to_gles2=true
quality/spatial_partitioning/render_tree_balance=0.22 quality/spatial_partitioning/render_tree_balance=0.22
batching/options/use_batching=false
[voxel]
threads/count/minimum=2
threads/count/margin_below_max=2
threads/main/time_budget_ms=1.0

View File

@@ -20,6 +20,7 @@ nodes/use_legacy_names=false
materials/location=1 materials/location=1
materials/storage=1 materials/storage=1
materials/keep_on_reimport=true materials/keep_on_reimport=true
meshes/octahedral_compression=true
meshes/compress=true meshes/compress=true
meshes/ensure_tangents=true meshes/ensure_tangents=true
meshes/storage=0 meshes/storage=0

Binary file not shown.

Binary file not shown.

File diff suppressed because it is too large Load Diff

View File

@@ -20,6 +20,7 @@ nodes/use_legacy_names=false
materials/location=1 materials/location=1
materials/storage=1 materials/storage=1
materials/keep_on_reimport=true materials/keep_on_reimport=true
meshes/octahedral_compression=true
meshes/compress=true meshes/compress=true
meshes/ensure_tangents=true meshes/ensure_tangents=true
meshes/storage=0 meshes/storage=0
@@ -28,11 +29,11 @@ meshes/lightmap_texel_size=0.1
skins/use_named_skins=true skins/use_named_skins=true
external_files/store_in_subdir=false external_files/store_in_subdir=false
animation/import=true animation/import=true
animation/fps=15 animation/fps=24.0
animation/filter_script="" animation/filter_script=""
animation/storage=false animation/storage=false
animation/keep_custom_tracks=false animation/keep_custom_tracks=false
animation/optimizer/enabled=true animation/optimizer/enabled=false
animation/optimizer/max_linear_error=0.05 animation/optimizer/max_linear_error=0.05
animation/optimizer/max_angular_error=0.01 animation/optimizer/max_angular_error=0.01
animation/optimizer/max_angle=22 animation/optimizer/max_angle=22

Binary file not shown.

File diff suppressed because it is too large Load Diff

View File

@@ -20,6 +20,7 @@ nodes/use_legacy_names=false
materials/location=1 materials/location=1
materials/storage=1 materials/storage=1
materials/keep_on_reimport=true materials/keep_on_reimport=true
meshes/octahedral_compression=true
meshes/compress=true meshes/compress=true
meshes/ensure_tangents=true meshes/ensure_tangents=true
meshes/storage=0 meshes/storage=0
@@ -28,11 +29,11 @@ meshes/lightmap_texel_size=0.1
skins/use_named_skins=true skins/use_named_skins=true
external_files/store_in_subdir=false external_files/store_in_subdir=false
animation/import=true animation/import=true
animation/fps=15 animation/fps=24.0
animation/filter_script="" animation/filter_script=""
animation/storage=false animation/storage=false
animation/keep_custom_tracks=false animation/keep_custom_tracks=false
animation/optimizer/enabled=true animation/optimizer/enabled=false
animation/optimizer/max_linear_error=0.05 animation/optimizer/max_linear_error=0.05
animation/optimizer/max_angular_error=0.01 animation/optimizer/max_angular_error=0.01
animation/optimizer/max_angle=22 animation/optimizer/max_angle=22

Binary file not shown.

Binary file not shown.

View File

@@ -20,6 +20,7 @@ nodes/use_legacy_names=false
materials/location=1 materials/location=1
materials/storage=1 materials/storage=1
materials/keep_on_reimport=true materials/keep_on_reimport=true
meshes/octahedral_compression=true
meshes/compress=true meshes/compress=true
meshes/ensure_tangents=true meshes/ensure_tangents=true
meshes/storage=1 meshes/storage=1

Binary file not shown.

File diff suppressed because it is too large Load Diff

View File

@@ -20,6 +20,7 @@ nodes/use_legacy_names=false
materials/location=1 materials/location=1
materials/storage=1 materials/storage=1
materials/keep_on_reimport=true materials/keep_on_reimport=true
meshes/octahedral_compression=true
meshes/compress=true meshes/compress=true
meshes/ensure_tangents=true meshes/ensure_tangents=true
meshes/storage=0 meshes/storage=0

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -20,6 +20,7 @@ nodes/use_legacy_names=false
materials/location=1 materials/location=1
materials/storage=1 materials/storage=1
materials/keep_on_reimport=true materials/keep_on_reimport=true
meshes/octahedral_compression=true
meshes/compress=true meshes/compress=true
meshes/ensure_tangents=true meshes/ensure_tangents=true
meshes/storage=0 meshes/storage=0

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 146 KiB

View File

@@ -0,0 +1,37 @@
[remap]
importer="texture"
type="StreamTexture"
path.s3tc="res://.import/mystress_clothes_Base_color.png-05bc7913628fc71aa57eb46689def024.s3tc.stex"
path.etc2="res://.import/mystress_clothes_Base_color.png-05bc7913628fc71aa57eb46689def024.etc2.stex"
metadata={
"imported_formats": [ "s3tc", "etc2" ],
"vram_texture": true
}
[deps]
source_file="res://scenes/clothes/mystress_clothes_Base_color.png"
dest_files=[ "res://.import/mystress_clothes_Base_color.png-05bc7913628fc71aa57eb46689def024.s3tc.stex", "res://.import/mystress_clothes_Base_color.png-05bc7913628fc71aa57eb46689def024.etc2.stex" ]
[params]
compress/mode=2
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=true
flags/filter=true
flags/mipmaps=true
flags/anisotropic=false
flags/srgb=1
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
process/normal_map_invert_y=false
stream=false
size_limit=0
detect_3d=false
svg/scale=1.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

View File

@@ -0,0 +1,37 @@
[remap]
importer="texture"
type="StreamTexture"
path.s3tc="res://.import/mystress_clothes_Metallic-mystress_clothes_Roughness.png-4f6eace375ef874de1f81e5d5e0055e8.s3tc.stex"
path.etc2="res://.import/mystress_clothes_Metallic-mystress_clothes_Roughness.png-4f6eace375ef874de1f81e5d5e0055e8.etc2.stex"
metadata={
"imported_formats": [ "s3tc", "etc2" ],
"vram_texture": true
}
[deps]
source_file="res://scenes/clothes/mystress_clothes_Metallic-mystress_clothes_Roughness.png"
dest_files=[ "res://.import/mystress_clothes_Metallic-mystress_clothes_Roughness.png-4f6eace375ef874de1f81e5d5e0055e8.s3tc.stex", "res://.import/mystress_clothes_Metallic-mystress_clothes_Roughness.png-4f6eace375ef874de1f81e5d5e0055e8.etc2.stex" ]
[params]
compress/mode=2
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=true
flags/filter=true
flags/mipmaps=true
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
process/normal_map_invert_y=false
stream=false
size_limit=0
detect_3d=false
svg/scale=1.0

View File

@@ -20,6 +20,7 @@ nodes/use_legacy_names=true
materials/location=1 materials/location=1
materials/storage=1 materials/storage=1
materials/keep_on_reimport=true materials/keep_on_reimport=true
meshes/octahedral_compression=true
meshes/compress=true meshes/compress=true
meshes/ensure_tangents=true meshes/ensure_tangents=true
meshes/storage=1 meshes/storage=1

View File

@@ -20,6 +20,7 @@ nodes/use_legacy_names=false
materials/location=1 materials/location=1
materials/storage=1 materials/storage=1
materials/keep_on_reimport=true materials/keep_on_reimport=true
meshes/octahedral_compression=true
meshes/compress=true meshes/compress=true
meshes/ensure_tangents=true meshes/ensure_tangents=true
meshes/storage=0 meshes/storage=0

View File

@@ -20,6 +20,7 @@ nodes/use_legacy_names=false
materials/location=1 materials/location=1
materials/storage=1 materials/storage=1
materials/keep_on_reimport=true materials/keep_on_reimport=true
meshes/octahedral_compression=true
meshes/compress=true meshes/compress=true
meshes/ensure_tangents=true meshes/ensure_tangents=true
meshes/storage=0 meshes/storage=0

View File

@@ -20,6 +20,7 @@ nodes/use_legacy_names=false
materials/location=1 materials/location=1
materials/storage=1 materials/storage=1
materials/keep_on_reimport=true materials/keep_on_reimport=true
meshes/octahedral_compression=true
meshes/compress=true meshes/compress=true
meshes/ensure_tangents=true meshes/ensure_tangents=true
meshes/storage=0 meshes/storage=0

Some files were not shown because too many files have changed in this diff Show More