stuff
This commit is contained in:
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
.import
|
||||
*.scn
|
||||
604
autoload/characters.gd
Normal file
604
autoload/characters.gd
Normal file
@@ -0,0 +1,604 @@
|
||||
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 male = preload("res://characters/vroid1-man.tscn")
|
||||
onready var face_ctrl = preload("res://scenes/face/head_comtrol.tscn")
|
||||
onready var modules = {
|
||||
# "physics": load("res://scripts/modules/character_physics.gd"),
|
||||
"cmdq": load("res://scripts/modules/cmdq.gd"),
|
||||
"marker": load("res://scripts/modules/npc_marker.gd"),
|
||||
"sacrifice": load("res://scripts/modules/npc_sacrifice.gd"),
|
||||
"nun": load("res://scripts/modules/npc_nun.gd"),
|
||||
"player": load("res://scripts/modules/player_controls.gd"),
|
||||
"player_clothes": load("res://scripts/modules/player_clothes.gd"),
|
||||
"hurtboxes": load("res://scripts/modules/character_hurtboxes.gd"),
|
||||
"student": load("res://scripts/modules/npc_student.gd")
|
||||
}
|
||||
|
||||
var face_data_path = "res://scenes/face/"
|
||||
var hair_data_path = "res://scenes/hair/"
|
||||
var female_faces = []
|
||||
var male_faces = []
|
||||
var female_hairs = []
|
||||
var male_hairs = []
|
||||
var hair_materials = []
|
||||
|
||||
var name_data = {}
|
||||
var rnd
|
||||
|
||||
var roommates = {}
|
||||
|
||||
#var _crowd: DetourCrowdManager
|
||||
|
||||
func _ready():
|
||||
set_root_motion_mod(Transform())
|
||||
var fd = File.new()
|
||||
fd.open("res://data/names.json", File.READ)
|
||||
var names = fd.get_as_text()
|
||||
var result = JSON.parse(names)
|
||||
name_data = result.result
|
||||
rnd = RandomNumberGenerator.new()
|
||||
var data_fd: = File.new()
|
||||
for g in ["male", "female"]:
|
||||
var fp = face_data_path + g + "-face.tscn"
|
||||
if data_fd.file_exists(fp):
|
||||
match g:
|
||||
"female":
|
||||
female_faces.push_back(fp)
|
||||
"male":
|
||||
male_faces.push_back(fp)
|
||||
for id in range(10000):
|
||||
var fp_m = face_data_path + "male-face" + str(id) + ".tscn"
|
||||
var fp_f = face_data_path + "female-face" + str(id) + ".tscn"
|
||||
var hp_m = hair_data_path + "male-hair" + str(id) + ".tscn"
|
||||
var hp_f = hair_data_path + "female-hair" + str(id) + ".tscn"
|
||||
var mat = hair_data_path + "hair" + str(id) + ".tres"
|
||||
if data_fd.file_exists(fp_m):
|
||||
male_faces.push_back(fp_m)
|
||||
if data_fd.file_exists(fp_f):
|
||||
female_faces.push_back(fp_f)
|
||||
if data_fd.file_exists(hp_m):
|
||||
male_hairs.push_back(hp_m)
|
||||
if data_fd.file_exists(hp_f):
|
||||
female_hairs.push_back(hp_f)
|
||||
if data_fd.file_exists(mat):
|
||||
hair_materials.push_back(mat)
|
||||
assert(male_faces.size() > 0)
|
||||
assert(female_faces.size() > 0)
|
||||
assert(male_hairs.size() > 0)
|
||||
assert(female_hairs.size() > 0)
|
||||
assert(hair_materials.size() > 0)
|
||||
|
||||
func get_relationship(obj1, obj2, s) -> int:
|
||||
var stats1 = {}
|
||||
var stats2 = {}
|
||||
if obj1.has_meta("stats"):
|
||||
stats1 = obj1.get_meta("stats")
|
||||
if obj2.has_meta("stats"):
|
||||
stats2 = obj2.get_meta("stats")
|
||||
if !stats2.has("relationships"):
|
||||
return 0
|
||||
var rel = stats2.relationships
|
||||
var cid = stats1.firstname + stats1.lastname
|
||||
if !rel.has(cid):
|
||||
return 0
|
||||
var rel_data = rel[cid]
|
||||
if rel_data.has(s):
|
||||
return rel_data[s]
|
||||
return 0
|
||||
func set_relationships(obj1, obj2, s, v: int) -> void:
|
||||
assert(obj1)
|
||||
assert(obj2)
|
||||
var stats1 = {}
|
||||
var stats2 = {}
|
||||
if obj1.has_meta("stats"):
|
||||
stats1 = obj1.get_meta("stats")
|
||||
if obj2.has_meta("stats"):
|
||||
stats2 = obj2.get_meta("stats")
|
||||
if !stats2.has("relationships"):
|
||||
stats2.relationships = {}
|
||||
var rel = stats2.relationships
|
||||
var cid = stats1.firstname + stats1.lastname
|
||||
if !rel.has(cid):
|
||||
rel[cid] = {}
|
||||
rel[cid][s] = v
|
||||
print(stats2)
|
||||
obj2.set_meta("stats", stats2)
|
||||
func get_face_node(sc: Node) -> Node:
|
||||
var face_node_paths = ["skeleton/Skeleton/head/face", "Skeleton/head/face"]
|
||||
for e in face_node_paths:
|
||||
if sc.has_node(e):
|
||||
print("face node: ", e)
|
||||
return sc.get_node(e)
|
||||
assert(0)
|
||||
return null
|
||||
|
||||
func get_hair_node(sc: Node) -> Node:
|
||||
var hair_node_paths = ["skeleton/Skeleton/head/hair", "Skeleton/head/hair"]
|
||||
for e in hair_node_paths:
|
||||
if sc.has_node(e):
|
||||
print("hair node: ", e)
|
||||
return sc.get_node(e)
|
||||
assert(0)
|
||||
return null
|
||||
func compose_kinematic_character(g, enable_modules = [], face = -1, hair = -1, hair_mat = -1):
|
||||
var body = KinematicBody.new()
|
||||
var cshape = CollisionShape.new()
|
||||
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):
|
||||
assert(obj)
|
||||
var xform = obj.global_transform
|
||||
var p = obj.get_parent()
|
||||
obj.queue_free()
|
||||
var body = compose_kinematic_character(g, enable_modules, face, hair, hair_mat)
|
||||
p.add_child(body)
|
||||
body.global_transform = xform
|
||||
var orientation = Transform()
|
||||
orientation.basis = xform.basis
|
||||
body.set_meta("orientation", orientation)
|
||||
return body
|
||||
const basedir = "res://scenes/clothes/"
|
||||
func prepare_extra_skeleton(obj, g):
|
||||
var queue = [obj]
|
||||
while queue.size() > 0:
|
||||
var item = queue.pop_front()
|
||||
if item is Skeleton:
|
||||
item.add_to_group(g)
|
||||
break
|
||||
for g in item.get_children():
|
||||
queue.push_back(g)
|
||||
func set_hair_material(hair, mat: Material):
|
||||
assert(mat)
|
||||
var queue = [hair]
|
||||
while queue.size() > 0:
|
||||
var item = queue.pop_front()
|
||||
if item is MeshInstance:
|
||||
item.set_surface_material(0, mat)
|
||||
break
|
||||
for g in item.get_children():
|
||||
queue.push_back(g)
|
||||
func setup_garments(obj, garments, garments_head, material):
|
||||
var skel = obj.get_meta("skeleton")
|
||||
var hair_skel = obj.get_meta("hair_skeleton")
|
||||
|
||||
if obj.has_meta("garments"):
|
||||
print("Can remove garments")
|
||||
var d = obj.get_meta("garments")
|
||||
var db = d.body_data
|
||||
var dh = d.head_data
|
||||
for e in db + dh:
|
||||
print("remove: ", e)
|
||||
# obj.remove_child(e)
|
||||
if e.get_parent() == obj:
|
||||
obj.remove_child(e)
|
||||
e.queue_free()
|
||||
var gdata_body = []
|
||||
for g in garments:
|
||||
var m: MeshInstance = MeshInstance.new()
|
||||
m.name = g
|
||||
print("loading: ", basedir + g + ".mesh")
|
||||
var geo: ArrayMesh = load(basedir + g + ".mesh")
|
||||
assert(geo)
|
||||
print("mesh: ", geo, "mat: ", material)
|
||||
geo.surface_set_material(0, material)
|
||||
m.mesh = geo
|
||||
# m.skeleton = m.get_path_to(root.get_meta("skeleton"))
|
||||
# = root.get_meta("skeleton")
|
||||
skel.add_child(m)
|
||||
m.transform = Transform()
|
||||
gdata_body.push_back(m)
|
||||
var gdata_head = []
|
||||
for g in garments_head:
|
||||
var m: MeshInstance = MeshInstance.new()
|
||||
m.name = g
|
||||
var geo: ArrayMesh = load(basedir + g + ".mesh")
|
||||
print("mesh: ", geo, "mat: ", material)
|
||||
geo.surface_set_material(0, material)
|
||||
m.mesh = geo
|
||||
# m.skeleton = m.get_path_to(root.get_meta("skeleton"))
|
||||
# = root.get_meta("skeleton")
|
||||
hair_skel.add_child(m)
|
||||
m.transform = Transform()
|
||||
gdata_head.push_back(m)
|
||||
var gdata = {
|
||||
"body": garments,
|
||||
"head": garments_head,
|
||||
"material": material,
|
||||
"body_data": gdata_body,
|
||||
"head_data": gdata_head
|
||||
}
|
||||
obj.set_meta("garments", gdata)
|
||||
|
||||
func lastname():
|
||||
var lastnames = name_data.lastname
|
||||
var d = lastnames.size()
|
||||
return lastnames[rnd.randi() % d].to_lower().capitalize()
|
||||
|
||||
func firstname(g):
|
||||
var firstnames = name_data[g].firstname
|
||||
var d = firstnames.size()
|
||||
return firstnames[rnd.randi() % d].to_lower().capitalize()
|
||||
|
||||
func generate_stats(npc: Node):
|
||||
var stats = npc.get_meta("stats")
|
||||
var strength = 10 + rnd.randi() % 100
|
||||
var max_health = 10 + rnd.randi() % 100
|
||||
var max_stamina = 10 + rnd.randi() % 100
|
||||
stats.tiredness = 0.0
|
||||
stats.hunger = 0.0
|
||||
stats.thirst = 0.0
|
||||
stats.libido = 0.0
|
||||
stats.toilet = 0.0
|
||||
stats.stress = 0.0
|
||||
stats.health = max_health
|
||||
stats.stamina = max_stamina
|
||||
stats.max_health = max_health
|
||||
stats.max_stamina = max_stamina
|
||||
stats.violence = rnd.randi() % (int(strength * 0.5))
|
||||
stats.xp = 0
|
||||
npc.set_meta("stats", stats)
|
||||
var stat_changes = {
|
||||
"sleep":{
|
||||
"tiredness": -0.3,
|
||||
"stress": -0.03
|
||||
},
|
||||
"eating": {
|
||||
"hunger": -0.9,
|
||||
"stress": -0.01
|
||||
},
|
||||
"drinking": {
|
||||
"thirst": -2.8,
|
||||
"stress": -0.01
|
||||
},
|
||||
"use_tap": {
|
||||
"thirst": -2.8,
|
||||
"stress": -0.01
|
||||
},
|
||||
"locomotion": {
|
||||
"tiredness": 0.0015,
|
||||
"hunger": 0.025,
|
||||
"thirst": 0.045,
|
||||
"stress": 0.0001,
|
||||
"libido": 0.00015,
|
||||
"toilet": 0.0002
|
||||
}
|
||||
}
|
||||
func update_stats(npc: Node):
|
||||
var stats = npc.get_meta("stats")
|
||||
if stats.tiredness < 10.0:
|
||||
if stats.stamina < stats.max_stamina:
|
||||
stats.stamina += 0.1
|
||||
stats.stamina = clamp(stats.stamina, 0, stats.max_stamina)
|
||||
var animtree = npc.get_meta("animation_tree")
|
||||
var state = animtree["parameters/state/playback"].get_current_node()
|
||||
if state in stat_changes.keys():
|
||||
for s in stat_changes[state].keys():
|
||||
stats[s] += stat_changes[state][s]
|
||||
if stats[s] < 0:
|
||||
stats[s] = 0.0
|
||||
npc.set_meta("stats", stats)
|
||||
|
||||
# Action part should be integrated into SmartObjectManager
|
||||
func check_leave_smart(npc: Node):
|
||||
return
|
||||
if !npc.has_meta("smart_object"):
|
||||
return
|
||||
var sm = npc.get_meta("smart_object")
|
||||
var new_goal = calculate_goal(npc)
|
||||
if !sm.is_in_group(new_goal):
|
||||
# var animtree = npc.get_meta("animation_tree")
|
||||
# animtree["parameters/state/playback"].travel("locomotion")
|
||||
npc.remove_meta("smart_object")
|
||||
|
||||
func calculate_goal(npc: Node):
|
||||
var utility = {
|
||||
"sleep": ["tiredness", 900],
|
||||
"hungry": ["hunger", 1000],
|
||||
"thirsty": ["thirst", 1300],
|
||||
"relieve_stress": ["stress", 800],
|
||||
"have_sex": ["libido", 500],
|
||||
"idle": ["", 600]
|
||||
}
|
||||
var stats = npc.get_meta("stats")
|
||||
var rutility = -10000
|
||||
var goal = "idle"
|
||||
var last_goal = ""
|
||||
var last_utility = -1
|
||||
if npc.has_meta("last_goal"):
|
||||
last_goal = npc.get_meta("last_goal")
|
||||
goal = npc.get_meta("last_goal")
|
||||
if npc.has_meta("last_utility"):
|
||||
last_utility = int(npc.get_meta("last_utility"))
|
||||
rutility = int(npc.get_meta("last_utility") * 2.0)
|
||||
for k in utility.keys():
|
||||
var st = 1.0
|
||||
if utility[k][0] != "":
|
||||
st = stats[utility[k][0]]
|
||||
var mul = utility[k][1]
|
||||
var cutil = int(st * mul)
|
||||
if rutility < cutil:
|
||||
rutility = cutil
|
||||
goal = k
|
||||
npc.set_meta("last_goal", goal)
|
||||
if goal == last_goal:
|
||||
npc.set_meta("last_utility", last_utility)
|
||||
else:
|
||||
npc.set_meta("last_utility", rutility)
|
||||
|
||||
return goal
|
||||
|
||||
var cooldown = 0.0
|
||||
|
||||
var close_groups = {}
|
||||
|
||||
func walkto_(npc, target):
|
||||
assert(npc.has_meta("agent_id"))
|
||||
if npc.has_mete("agent_id"):
|
||||
walkto_agent(npc, target)
|
||||
# if npc.has_meta("_target"):
|
||||
# var otarget = npc.get_meta("_target")
|
||||
# if target == otarget:
|
||||
# return
|
||||
# assert(npc.has_meta("agent_id"))
|
||||
# npc.set_meta("_target", target)
|
||||
## print("walk to ", target)
|
||||
## print("walk to ", target)
|
||||
## print("walk to ", target)
|
||||
# var agent_id = npc.get_meta("agent_id")
|
||||
# if target is Spatial:
|
||||
# get_crowd().set_agent_target_position(agent_id, target.global_transform.origin)
|
||||
# elif target is Vector3:
|
||||
# get_crowd().set_agent_target_position(agent_id, target)
|
||||
|
||||
#func update_to_agent(root):
|
||||
# if !_crowd:
|
||||
# return
|
||||
# if !root.has_meta("agent_id"):
|
||||
# _crowd.add_agent(root, 0, false, PoolRealArray([0.2, 1.5, 0.3, 3.0]))
|
||||
# if !root.has_meta("agent_id"):
|
||||
# return
|
||||
# if !root.has_meta("_target"):
|
||||
# return
|
||||
# var velocity = root.get_meta("agent_velocity")
|
||||
# if velocity.length() == 0:
|
||||
# characters.set_walk_speed(root, 0, 0)
|
||||
# else:
|
||||
## print("agent_velocity=", velocity)
|
||||
# var vel1 = velocity
|
||||
# vel1.y = 0
|
||||
# var xform: = Transform().looking_at(vel1, Vector3.UP)
|
||||
# xform = xform.orthonormalized()
|
||||
# var orientation = root.get_meta("orientation")
|
||||
# orientation.basis = orientation.basis.slerp(xform.basis, get_physics_process_delta_time())
|
||||
# root.set_meta("orientation", orientation)
|
||||
# characters.set_walk_speed(root, clamp(vel1.length() / 6.5, 0.0, 1.0), 0)
|
||||
#
|
||||
#func character_physics(root):
|
||||
# var delta = get_physics_process_delta_time()
|
||||
# var animtree = root.get_meta("animation_tree")
|
||||
# var orientation = root.get_meta("orientation")
|
||||
# var root_motion = animtree.get_root_motion_transform()
|
||||
# orientation *= root_motion
|
||||
# var h_velocity = orientation.origin / delta
|
||||
# var velocity: = Vector3()
|
||||
# velocity.x = h_velocity.x
|
||||
# velocity.z = h_velocity.z
|
||||
# velocity.y = h_velocity.y
|
||||
## if root.has_meta("climb"):
|
||||
## print("has climb meta")
|
||||
## if root.has_meta("cmdqueue"):
|
||||
## print("+has cmdqueue")
|
||||
# if !root.has_meta("vehicle") && !root.has_meta("cmdqueue"):
|
||||
# if root is KinematicBody:
|
||||
# if !root.is_on_floor():
|
||||
# velocity += Vector3(0, -9.8, 0)
|
||||
# velocity = root.move_and_slide(velocity, Vector3.UP, true, 4, 0.785, false)
|
||||
# elif root.has_meta("cmdqueue") && root.has_meta("cmdq_walk"):
|
||||
# if root is KinematicBody:
|
||||
# if !root.is_on_floor() && !root.has_meta("climb"):
|
||||
# velocity += Vector3(0, -9.8, 0)
|
||||
# velocity = root.move_and_slide(velocity, Vector3.UP, true, 4, 0.785, false)
|
||||
# elif root.has_meta("cmdqueue") && root.has_meta("climb"):
|
||||
# if root is KinematicBody:
|
||||
# velocity.y = h_velocity.y
|
||||
# velocity = root.move_and_slide(velocity, Vector3.UP, true, 4, 0.785, false)
|
||||
# orientation.origin = Vector3()
|
||||
# orientation = orientation.orthonormalized()
|
||||
# root.global_transform.basis = orientation.basis
|
||||
# root.set_meta("orientation", orientation)
|
||||
# if root.has_meta("vehicle"):
|
||||
# var vehicle: VehicleBody = get_meta("vehicle")
|
||||
# if has_meta("vehicle_offset"):
|
||||
# var xform = get_meta("vehicle_offset")
|
||||
# root.global_transform = vehicle.global_transform * xform
|
||||
# if root.has_node("blackboard"):
|
||||
# var bb = root.get_node("blackboard")
|
||||
# bb.set("velocity", velocity)
|
||||
# update_to_agent(root)
|
||||
|
||||
func check_main_animtree(item):
|
||||
if !item is AnimationTree:
|
||||
return false
|
||||
for g in ["hair", "face"]:
|
||||
if item.is_in_group(g):
|
||||
return false
|
||||
return true
|
||||
|
||||
func check_main_skeleton(item):
|
||||
if !item is Skeleton:
|
||||
return false
|
||||
for g in ["hair", "face"]:
|
||||
if item.is_in_group(g):
|
||||
return false
|
||||
return true
|
||||
|
||||
func setup_character_physics(root):
|
||||
var queue = [root]
|
||||
while queue.size() > 0:
|
||||
var item = queue.pop_front()
|
||||
if check_main_animtree(item):
|
||||
root.set_meta("animation_tree", item)
|
||||
if check_main_skeleton(item):
|
||||
root.set_meta("skeleton", item)
|
||||
if item is Skeleton && item.is_in_group("hair"):
|
||||
root.set_meta("hair_skeleton", item)
|
||||
if item is Skeleton && item.is_in_group("face"):
|
||||
root.set_meta("face_skeleton", item)
|
||||
for e in item.get_children():
|
||||
queue.push_back(e)
|
||||
# var velocity = Vector3()
|
||||
var orientation = Transform()
|
||||
if root.is_inside_tree():
|
||||
orientation = root.global_transform
|
||||
orientation.origin = Vector3()
|
||||
root.set_meta("orientation", orientation)
|
||||
|
||||
func _process(delta):
|
||||
if cooldown > 0.0:
|
||||
cooldown -= delta
|
||||
return
|
||||
for e in get_tree().get_nodes_in_group("character"):
|
||||
var gr = []
|
||||
for o in get_tree().get_nodes_in_group("character"):
|
||||
if e == o:
|
||||
continue
|
||||
var e_org = e.global_transform.origin
|
||||
var o_org = o.global_transform.origin
|
||||
if e_org.distance_to(o_org) < 1.2:
|
||||
gr.push_back(o)
|
||||
close_groups[e] = gr
|
||||
if e.has_meta("animation_tree"):
|
||||
var animtree = e.get_meta("animation_tree")
|
||||
var state = animtree["parameters/state/playback"].get_current_node()
|
||||
var face_playback = e.get_meta("face_playback")
|
||||
var face_ctrl = e.get_meta("face_control")
|
||||
var p = face_ctrl[face_playback]
|
||||
if state == "sleeping":
|
||||
if p.get_current_node() != "sleeping":
|
||||
p.travel("sleeping")
|
||||
else:
|
||||
if p.get_current_node() != "locomotion":
|
||||
p.travel("locomotion")
|
||||
cooldown = 0.2
|
||||
func get_player():
|
||||
var c = get_viewport().get_camera()
|
||||
if !c:
|
||||
return null
|
||||
if !c.has_meta("player"):
|
||||
return null
|
||||
var player = c.get_meta("player")
|
||||
if !player:
|
||||
return null
|
||||
return player
|
||||
|
||||
func _physics_process(delta):
|
||||
var player = get_player()
|
||||
if !player:
|
||||
return
|
||||
if player.has_meta("animation_tree") && !player.has_meta("vehicle"):
|
||||
character_physics(player)
|
||||
# for e in get_tree().get_nodes_in_group("character") + [player]:
|
||||
# if e && e.has_meta("animation_tree"):
|
||||
# character_physics(e)
|
||||
192
autoload/controls.gd
Normal file
192
autoload/controls.gd
Normal file
@@ -0,0 +1,192 @@
|
||||
extends Node
|
||||
|
||||
var is_gui = false
|
||||
|
||||
var rot_cam = Vector3()
|
||||
var mouse_sens = 0.3
|
||||
var camera_anglev = 0
|
||||
|
||||
var fps_mode = false
|
||||
var tmp_fps_mode = false
|
||||
var focus_cam: Camera
|
||||
var cam_focused: bool = false
|
||||
|
||||
var menu: Node
|
||||
func display_menu():
|
||||
menu.popup()
|
||||
|
||||
|
||||
func _ready():
|
||||
focus_cam = Camera.new()
|
||||
add_child(focus_cam)
|
||||
focus_cam.set_as_toplevel(true)
|
||||
# var escape_menu = preload("res://ui/save_game.tscn")
|
||||
# menu = escape_menu.instance()
|
||||
# add_child(menu)
|
||||
|
||||
func is_fps_mode():
|
||||
return fps_mode || tmp_fps_mode
|
||||
|
||||
func _input(event):
|
||||
if !is_gui:
|
||||
Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED)
|
||||
if event is InputEventMouseMotion && !is_gui:
|
||||
rot_cam.y = deg2rad(-event.relative.x * mouse_sens)
|
||||
var changev = -event.relative.y * mouse_sens
|
||||
var player
|
||||
if get_viewport().get_camera().has_meta("player"):
|
||||
player = get_viewport().get_camera().get_meta("player")
|
||||
if !player:
|
||||
return
|
||||
var cam = player.get_meta("cam")
|
||||
var fps_cam = player.get_meta("fps_cam")
|
||||
if cam.current:
|
||||
if camera_anglev + changev > -30 and camera_anglev + changev < 40:
|
||||
camera_anglev += changev
|
||||
rot_cam.x = deg2rad(changev)
|
||||
elif fps_cam.current:
|
||||
if camera_anglev + changev > -60 and camera_anglev + changev < 60:
|
||||
camera_anglev += changev
|
||||
rot_cam.x = deg2rad(changev)
|
||||
func focus_camera(obj):
|
||||
if !obj:
|
||||
print("NOTHING TO FOCUS")
|
||||
return
|
||||
if cam_focused:
|
||||
return
|
||||
print("FOCUS")
|
||||
var cur_cam = get_viewport().get_camera()
|
||||
var player = cur_cam.get_meta("player")
|
||||
var cam = player.get_meta("cam")
|
||||
focus_cam.global_transform = cam.global_transform
|
||||
var do = obj.global_transform.origin
|
||||
focus_cam.look_at(do, Vector3.UP)
|
||||
cam_focused = true
|
||||
focus_cam.set_meta("camera", cur_cam)
|
||||
focus_cam.set_current(true)
|
||||
focus_cam.set_meta("player", player)
|
||||
func unfocus_camera():
|
||||
cam_focused = false
|
||||
var ncam = focus_cam.get_meta("camera")
|
||||
ncam.set_current(true)
|
||||
|
||||
func fix_cam(state, _delta):
|
||||
var player = get_viewport().get_camera().get_meta("player")
|
||||
if !is_fps_mode():
|
||||
var cam = player.get_meta("cam")
|
||||
var cam_rot_y = cam.get_meta("cam_rot_y")
|
||||
var cam_rot_x = cam.get_meta("cam_rot_x")
|
||||
cam_rot_y.rotate_y(rot_cam.y)
|
||||
cam_rot_x.rotate_x(rot_cam.x)
|
||||
else:
|
||||
if !player.has_meta("vehicle") && !player.has_meta("cmdqueue"):
|
||||
var fps_cam = player.get_meta("fps_cam")
|
||||
var fps_cam_rot_x = fps_cam.get_meta("fps_cam_rot_x")
|
||||
var o: Transform = player.get_meta("orientation")
|
||||
o.basis = o.basis.rotated(Vector3(0, 1, 0), rot_cam.y)
|
||||
fps_cam_rot_x.rotate_x(rot_cam.x)
|
||||
player.set_meta("orientation", o)
|
||||
|
||||
rot_cam.y = 0
|
||||
rot_cam.x = 0
|
||||
func get_player():
|
||||
var c = get_viewport().get_camera()
|
||||
assert(c)
|
||||
if !c:
|
||||
return null
|
||||
assert(c.has_meta("player"))
|
||||
if !c.has_meta("player"):
|
||||
return null
|
||||
var player = c.get_meta("player")
|
||||
assert(player)
|
||||
if !player:
|
||||
return null
|
||||
assert(player)
|
||||
return player
|
||||
|
||||
func switch_fps_mode(value):
|
||||
var player = get_player()
|
||||
print(player)
|
||||
if !player:
|
||||
return
|
||||
assert(player != null)
|
||||
var cam = player.get_meta("cam")
|
||||
var fps_cam = player.get_meta("fps_cam")
|
||||
var cam_rot_y = cam.get_meta("cam_rot_y")
|
||||
if !value:
|
||||
cam.current = true
|
||||
player.show_face()
|
||||
#need to convert to globals
|
||||
cam_rot_y.rotation.y = player.rotation.y
|
||||
else:
|
||||
fps_cam.current = true
|
||||
player.hide_face()
|
||||
|
||||
var tmp_fps_cooldown = 0.0
|
||||
|
||||
|
||||
func _process(delta):
|
||||
var c = get_viewport().get_camera()
|
||||
if !c:
|
||||
return
|
||||
|
||||
if !c.has_meta("player"):
|
||||
return
|
||||
|
||||
var player = get_player()
|
||||
if !player:
|
||||
return
|
||||
if !is_gui && Input.is_action_just_pressed("ui_cancel"):
|
||||
is_gui = true
|
||||
Input.set_mouse_mode(Input.MOUSE_MODE_VISIBLE)
|
||||
display_menu()
|
||||
if !is_gui && Input.get_mouse_mode() != Input.MOUSE_MODE_CAPTURED:
|
||||
Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED)
|
||||
elif is_gui && Input.get_mouse_mode() == Input.MOUSE_MODE_CAPTURED:
|
||||
Input.set_mouse_mode(Input.MOUSE_MODE_VISIBLE)
|
||||
var cam = player.get_meta("cam")
|
||||
var fps_cam = player.get_meta("fps_cam")
|
||||
var cam_pos = cam.get_meta("cam_pos")
|
||||
var cam_arm = cam.get_meta("cam_arm")
|
||||
cam_pos.global_transform.origin = player.global_transform.origin
|
||||
cam.look_at(player.global_transform.origin + Vector3(0, 1.9, 0), Vector3.UP)
|
||||
|
||||
if Input.is_action_just_pressed("fps_mode") && !tmp_fps_mode:
|
||||
fps_mode = !fps_mode
|
||||
switch_fps_mode(fps_mode)
|
||||
if !fps_mode && !tmp_fps_mode && !player.has_meta("vehicle"):
|
||||
var s = cam_arm.global_transform.origin
|
||||
var t = cam.global_transform.origin
|
||||
if tmp_fps_cooldown <= 0.0:
|
||||
if s.distance_to(t) < 0.3:
|
||||
tmp_fps_mode = true
|
||||
switch_fps_mode(tmp_fps_mode)
|
||||
tmp_fps_cooldown = 1.0
|
||||
if !fps_mode && tmp_fps_mode:
|
||||
var s = cam_arm.global_transform.origin
|
||||
var t = cam.global_transform.origin
|
||||
if tmp_fps_cooldown <= 0.0:
|
||||
if s.distance_to(t) > 0.4:
|
||||
tmp_fps_mode = false
|
||||
switch_fps_mode(tmp_fps_mode)
|
||||
tmp_fps_cooldown = 3.0
|
||||
if tmp_fps_cooldown > 0.0:
|
||||
tmp_fps_cooldown -= delta
|
||||
|
||||
var spawn_delay = 0.5
|
||||
func _physics_process(delta):
|
||||
if spawn_delay > 0.5:
|
||||
spawn_delay -= delta
|
||||
return
|
||||
var c = get_viewport().get_camera()
|
||||
if !c:
|
||||
return
|
||||
if !c.has_meta("player"):
|
||||
return
|
||||
var player = c.get_meta("player")
|
||||
if !player:
|
||||
return
|
||||
var space = player.get_world().space
|
||||
var state = PhysicsServer.space_get_direct_state(space)
|
||||
fix_cam(state, delta)
|
||||
|
||||
72
autoload/doors.gd
Normal file
72
autoload/doors.gd
Normal file
@@ -0,0 +1,72 @@
|
||||
extends Node
|
||||
|
||||
|
||||
# Declare member variables here. Examples:
|
||||
# var a = 2
|
||||
# var b = "text"
|
||||
var door_list = {}
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready():
|
||||
pass # Replace with function body.
|
||||
|
||||
func register_door(obj: Node, name, door_obj, axis, cangle, oangle, spd):
|
||||
assert(obj)
|
||||
assert(door_obj)
|
||||
var root_name = str(obj.get_path())
|
||||
if !door_list.has(root_name):
|
||||
door_list[root_name] = {}
|
||||
var base = door_obj.transform
|
||||
door_list[root_name][name] = {}
|
||||
door_list[root_name][name].obj = door_obj
|
||||
door_list[root_name][name].base = base
|
||||
door_list[root_name][name].axis = axis
|
||||
door_list[root_name][name].cangle = cangle
|
||||
door_list[root_name][name].oangle = oangle
|
||||
door_list[root_name][name].cur_angle = cangle
|
||||
door_list[root_name][name].speed = spd
|
||||
door_list[root_name][name].active = false
|
||||
door_list[root_name][name].state = 0
|
||||
func open_door(obj, name):
|
||||
var root_name = str(obj.get_path())
|
||||
if !door_list.has(root_name):
|
||||
return
|
||||
door_list[root_name][name].active = true
|
||||
door_list[root_name][name].state = 1
|
||||
func close_door(obj, name):
|
||||
var root_name = str(obj.get_path())
|
||||
if !door_list.has(root_name):
|
||||
return
|
||||
door_list[root_name][name].active = true
|
||||
door_list[root_name][name].state = 0
|
||||
func is_active(obj, name):
|
||||
var root_name = str(obj.get_path())
|
||||
if !door_list.has(root_name):
|
||||
return false
|
||||
return door_list[root_name][name].active
|
||||
func get_state(obj, name):
|
||||
var root_name = str(obj.get_path())
|
||||
if !door_list.has(root_name):
|
||||
return -1
|
||||
return door_list[root_name][name].state
|
||||
func _process(delta):
|
||||
for e in door_list.keys():
|
||||
for j in door_list[e].keys():
|
||||
var m = door_list[e][j]
|
||||
if m.active:
|
||||
var change = min(1.0, m.speed * delta)
|
||||
match m.state:
|
||||
0:
|
||||
if abs(m.cur_angle - m.cangle) < 0.001:
|
||||
m.cur_angle = m.cangle
|
||||
m.active = false
|
||||
else:
|
||||
m.cur_angle = lerp_angle(m.cur_angle, m.cangle, change)
|
||||
1:
|
||||
if abs(m.cur_angle - m.oangle) < 0.001:
|
||||
m.cur_angle = m.oangle
|
||||
m.active = false
|
||||
else:
|
||||
m.cur_angle = lerp_angle(m.cur_angle, m.oangle, change)
|
||||
m.obj.transform.basis = m.base.basis.rotated(m.axis, m.cur_angle)
|
||||
|
||||
131
autoload/freezer.gd
Normal file
131
autoload/freezer.gd
Normal file
@@ -0,0 +1,131 @@
|
||||
extends Node
|
||||
|
||||
|
||||
# Declare member variables here. Examples:
|
||||
# var a = 2
|
||||
# var b = "text"
|
||||
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
var freeze_dist = 20.0
|
||||
func _ready():
|
||||
pass # Replace with function body.
|
||||
|
||||
|
||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
func freeze_character(c):
|
||||
var pos = c.transform
|
||||
var sp = Spatial.new()
|
||||
var pp = c.get_parent()
|
||||
var character_data = {}
|
||||
var stats = {}
|
||||
if c.has_meta("character_data"):
|
||||
character_data = c.get_meta("character_data")
|
||||
if c.has_meta("stats"):
|
||||
stats = c.get_meta("stats")
|
||||
pp.add_child(sp)
|
||||
sp.transform = pos
|
||||
sp.add_to_group("frozen")
|
||||
sp.set_meta("character_data", character_data)
|
||||
var animtree: AnimationTree = c.get_meta("animation_tree")
|
||||
assert(animtree)
|
||||
var animation_node = animtree["parameters/state/playback"].get_current_node()
|
||||
sp.set_meta("animation_node", animation_node)
|
||||
# sp.set_meta("animation_tree", str(c.get_path_to(animtree)))
|
||||
sp.set_meta("stats", stats)
|
||||
if characters.get_crowd():
|
||||
characters.get_crowd().remove_agent(c)
|
||||
c.queue_free()
|
||||
|
||||
func prepare_save_data() -> bool:
|
||||
if !freeze_all():
|
||||
return false
|
||||
scenario.save_data.characters = []
|
||||
for c in get_tree().get_nodes_in_group("frozen"):
|
||||
var n = {}
|
||||
n.character_data = c.get_meta("character_data")
|
||||
n.stats = c.get_meta("stats")
|
||||
n.animation_node = c.get_meta("animation_node")
|
||||
n.xform = var2str(c.global_transform)
|
||||
scenario.save_data.characters.push_back(n)
|
||||
return true
|
||||
func get_player():
|
||||
var c = get_viewport().get_camera()
|
||||
if !c:
|
||||
return null
|
||||
if !c.has_meta("player"):
|
||||
return null
|
||||
var player = c.get_meta("player")
|
||||
if !player:
|
||||
return null
|
||||
return player
|
||||
|
||||
func unfreeze_character(c):
|
||||
var data = c.get_meta("character_data")
|
||||
var stats = c.get_meta("stats")
|
||||
print("HAIR: ", data.hair, " ", data.hair_mat)
|
||||
var nc = characters.replace_character(c, data.sex, data.modules, data.face, data.hair, data.hair_mat)
|
||||
nc.set_meta("stats", stats)
|
||||
var animtree: AnimationTree = nc.get_meta("animation_tree")
|
||||
assert(animtree)
|
||||
var animation_node = c.get_meta("animation_node")
|
||||
animtree["parameters/state/playback"].start(animation_node)
|
||||
animtree["parameters/state/playback"].travel(animation_node)
|
||||
nc.set_meta("saved_anim_state", animation_node)
|
||||
var state = 0
|
||||
var delay = 0.0
|
||||
func freeze_all() -> bool:
|
||||
var player = get_player()
|
||||
var ok = true
|
||||
for c in get_tree().get_nodes_in_group("character"):
|
||||
if c == player:
|
||||
continue
|
||||
elif c.name.begins_with("npc_spawn"):
|
||||
c.queue_free()
|
||||
continue
|
||||
elif c.name == "npc" && !c.has_meta("animation_tree"):
|
||||
print("bad ", c.name, " ", c.get_meta_list())
|
||||
for e in c.get_meta_list():
|
||||
print("bad", c.get_meta(e))
|
||||
c.queue_free()
|
||||
continue
|
||||
assert(c.has_meta("animation_tree"))
|
||||
if c.has_meta("animation_tree"):
|
||||
freeze_character(c)
|
||||
else:
|
||||
ok = false
|
||||
assert(ok)
|
||||
return ok
|
||||
func _process(delta):
|
||||
var cam = get_viewport().get_camera()
|
||||
var player = get_player()
|
||||
if !player:
|
||||
return
|
||||
var cpos = cam.global_transform.origin
|
||||
match state:
|
||||
0:
|
||||
characters.set_process(false)
|
||||
for c in get_tree().get_nodes_in_group("character"):
|
||||
if c == player:
|
||||
continue
|
||||
var p = c.global_transform.origin
|
||||
if p.distance_squared_to(cpos) > freeze_dist * freeze_dist:
|
||||
if c.has_meta("animation_tree"):
|
||||
freeze_character(c)
|
||||
characters.set_process(true)
|
||||
state = 1
|
||||
delay = 1.0
|
||||
# print("spawned: ", get_tree().get_nodes_in_group("character").size())
|
||||
# print("frozen: ", get_tree().get_nodes_in_group("frozen").size())
|
||||
1:
|
||||
characters.set_process(false)
|
||||
for c in get_tree().get_nodes_in_group("frozen"):
|
||||
var p = c.global_transform.origin
|
||||
if p.distance_squared_to(cpos) < 0.25 * freeze_dist * freeze_dist:
|
||||
print("unfreeze")
|
||||
unfreeze_character(c)
|
||||
characters.set_process(true)
|
||||
if delay > 0.0:
|
||||
delay -= delta
|
||||
else:
|
||||
state = 0
|
||||
89
autoload/inventory.gd
Normal file
89
autoload/inventory.gd
Normal file
@@ -0,0 +1,89 @@
|
||||
extends Node
|
||||
signal pick_up(item_name, obj)
|
||||
|
||||
func _ready():
|
||||
pass
|
||||
|
||||
var items = {
|
||||
"s_dagger": false
|
||||
}
|
||||
|
||||
var item_dialogue = {
|
||||
"s_dagger": {
|
||||
"item_fullname": "sacrificial dagger",
|
||||
"item_artname": "the sacrificial dagger",
|
||||
"item_msg": "You see ancient dagger a small piece of metal with nothing special about it except the feeling of uneasiness and understanding that this is not ordinary weapon, but something with different purpose than just defeating the enemy. Something to thank bloodthirsty gods? Or avoid their wrath.",
|
||||
"item_take_msg": "You fill freezing touch of the rough dagger at your hand. You feel the touch of ancient history, of many many veins opened, and lots of hearts pierced.",
|
||||
"item_leave_msg": "You left the dagger be."
|
||||
}
|
||||
}
|
||||
|
||||
onready var item_scenes = {
|
||||
"s_dagger": load("res://scenes/weapons/sacrificial_dagger.tscn")
|
||||
}
|
||||
onready var item_collision_scenes = {
|
||||
"s_dagger": load("res://scenes/weapons/dagger_collision.tscn")
|
||||
}
|
||||
func equip(obj, item_name):
|
||||
if obj.has_meta("equipped"):
|
||||
return
|
||||
print("EQUIP ", item_name)
|
||||
assert(obj)
|
||||
assert(item_scenes.has(item_name))
|
||||
var r = item_scenes[item_name].instance()
|
||||
var c = item_collision_scenes[item_name].instance()
|
||||
obj.add_child(r)
|
||||
r.add_child(c)
|
||||
r.transform = Transform()
|
||||
c.transform = Transform()
|
||||
print("EQUIP ", item_name, " OK", obj, r)
|
||||
obj.set_meta("equipped", item_name)
|
||||
func register_pick_up(m, obj, item_name):
|
||||
var mdata = {
|
||||
"method": "pick_up",
|
||||
"item": item_name,
|
||||
"item_obj": obj
|
||||
}
|
||||
markers.init_marker(self, m, mdata)
|
||||
|
||||
func pick_up_dialogue(item, item_obj):
|
||||
return
|
||||
# if controls.is_gui:
|
||||
# return
|
||||
# Dialogic.set_autosave(false)
|
||||
# var scene = "pick_up_item"
|
||||
# print("SCENE: ", scene)
|
||||
# controls.is_gui = true
|
||||
# var dialogue = Dialogic.start(scene, false)
|
||||
# Dialogic.set_variable("item_name", item)
|
||||
# Dialogic.set_variable("item_fullname", item_dialogue[item].item_fullname)
|
||||
# Dialogic.set_variable("item_artname", item_dialogue[item].item_artname)
|
||||
# Dialogic.set_variable("item_msg", item_dialogue[item].item_msg)
|
||||
# Dialogic.set_variable("item_take_msg", item_dialogue[item].item_take_msg)
|
||||
# Dialogic.set_variable("item_leave_msg", item_dialogue[item].item_leave_msg)
|
||||
# add_child(dialogue)
|
||||
# dialogue.connect("timeline_end", self, "finish_dialogue", [dialogue])
|
||||
# dialogue.connect("dialogic_signal", self, "signal_process", [dialogue])
|
||||
# dialogue.set_meta("item", item)
|
||||
# dialogue.set_meta("item_obj", item_obj)
|
||||
func finish_dialogue(dname, d):
|
||||
controls.is_gui = false
|
||||
d.queue_free()
|
||||
|
||||
func signal_process(s, d):
|
||||
var item = d.get_meta("item")
|
||||
var item_obj = d.get_meta("item_obj")
|
||||
match s:
|
||||
"item_accepted":
|
||||
items[item] = true
|
||||
emit_signal("pick_up", item, item_obj)
|
||||
"item_rejected":
|
||||
pass
|
||||
func pick_up(obj):
|
||||
if items.has(obj.item) && items[obj.item]:
|
||||
return
|
||||
if item_dialogue.has(obj.item):
|
||||
pick_up_dialogue(obj.item, obj.item_obj)
|
||||
else:
|
||||
items[obj.item] = true
|
||||
emit_signal("pick_up", obj.item, obj.item_obj)
|
||||
52
autoload/map.gd
Normal file
52
autoload/map.gd
Normal file
@@ -0,0 +1,52 @@
|
||||
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")
|
||||
16
autoload/map.tscn
Normal file
16
autoload/map.tscn
Normal file
@@ -0,0 +1,16 @@
|
||||
[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 )
|
||||
213
autoload/marker.gd
Normal file
213
autoload/marker.gd
Normal file
@@ -0,0 +1,213 @@
|
||||
extends Node
|
||||
|
||||
var marker_list = []
|
||||
var label_count = 10
|
||||
var labels = []
|
||||
var max_dist = 4
|
||||
var current_marker
|
||||
var cam
|
||||
|
||||
func node_added(node):
|
||||
if node.name.begins_with("marker_"):
|
||||
if !node in marker_list:
|
||||
marker_list.push_back(node)
|
||||
func node_removed(node):
|
||||
marker_list.erase(node)
|
||||
|
||||
var state = 0
|
||||
func _ready():
|
||||
get_tree().connect("node_added", self, "node_added")
|
||||
get_tree().connect("node_removed", self, "node_removed")
|
||||
var root = get_tree().get_root()
|
||||
var queue = [root]
|
||||
while queue.size() > 0:
|
||||
var item = queue.pop_front()
|
||||
if item.name.begins_with("marker_"):
|
||||
marker_list.push_back(item)
|
||||
for e in item.get_children():
|
||||
queue.push_back(e)
|
||||
|
||||
func see_through_marker(m):
|
||||
if !m.has_meta("marker_data"):
|
||||
return false
|
||||
var md = m.get_meta("marker_data")
|
||||
if md.has("see_through") && md.see_through == true:
|
||||
return true
|
||||
return false
|
||||
|
||||
func _process(delta):
|
||||
if state == 0:
|
||||
var root = get_tree().get_root()
|
||||
for _e in range(label_count):
|
||||
var tl = Label.new()
|
||||
root.add_child(tl)
|
||||
tl.hide()
|
||||
labels.push_back(tl)
|
||||
state = 1
|
||||
if state == 1:
|
||||
var cam = get_viewport().get_camera()
|
||||
if !cam.has_meta("player"):
|
||||
return
|
||||
var player = cam.get_meta("player")
|
||||
assert(player)
|
||||
var size = get_viewport().size
|
||||
var center = size/2
|
||||
var visible_markers = []
|
||||
var wstate = cam.get_world().direct_space_state
|
||||
for e in marker_list:
|
||||
var cam_pos = cam.global_transform.origin
|
||||
var player_pos = player.global_transform.origin
|
||||
var marker_pos = e.global_transform.origin
|
||||
if player_pos.distance_squared_to(marker_pos) < max_dist * max_dist:
|
||||
var lpos = cam.global_transform.xform_inv(marker_pos)
|
||||
if lpos.z < 0:
|
||||
if see_through_marker(e) && e.visible:
|
||||
visible_markers.push_back(e)
|
||||
elif e.visible:
|
||||
var xlist = [player]
|
||||
if e.has_meta("marker_data"):
|
||||
var md = e.get_meta("marker_data")
|
||||
if !md.has("obj"):
|
||||
e.hide()
|
||||
else:
|
||||
if md.obj is PhysicsBody:
|
||||
xlist.push_back(md.obj)
|
||||
else:
|
||||
e.hide()
|
||||
|
||||
var result = wstate.intersect_ray(cam_pos, marker_pos, xlist)
|
||||
if !result.has("collider") || !result.collider:
|
||||
visible_markers.push_back(e)
|
||||
|
||||
var free_labels = []
|
||||
var process_markers = visible_markers.duplicate()
|
||||
for e in labels:
|
||||
var l: Label = e
|
||||
if l.has_meta("marker"):
|
||||
# var n = l.get_meta("marker")
|
||||
# if n in visible_markers:
|
||||
# process_markers.erase(n)
|
||||
# else:
|
||||
l.remove_meta("marker")
|
||||
free_labels.push_back(l)
|
||||
l.hide()
|
||||
else:
|
||||
free_labels.push_back(l)
|
||||
l.hide()
|
||||
if free_labels.size() == 0:
|
||||
state = 2
|
||||
return
|
||||
for e in process_markers:
|
||||
if free_labels.size() == 0:
|
||||
break
|
||||
var pos = cam.unproject_position(e.global_transform.origin)
|
||||
var l = free_labels.pop_front()
|
||||
var t = InputMap.get_action_list("activate")[0].as_text() + ": "
|
||||
if e.name.ends_with("_door"):
|
||||
t += "Open"
|
||||
elif e.name.ends_with("_container"):
|
||||
t += "Access"
|
||||
elif e.name.ends_with("_pickup"):
|
||||
t += "Pick up"
|
||||
elif e.name.ends_with("_vehicleseat") || e.name.ends_with("_seat"):
|
||||
t += "Sit"
|
||||
elif e.name.ends_with("_exit"):
|
||||
t += "Exit"
|
||||
elif e.name.ends_with("_talk"):
|
||||
t += "Talk"
|
||||
elif e.name.ends_with("_action"):
|
||||
t += "Action"
|
||||
elif e.name.ends_with("_grab"):
|
||||
t += "Grab"
|
||||
elif e.name.ends_with("_take"):
|
||||
t += "Take"
|
||||
elif e.name.ends_with("_sacrifice"):
|
||||
t += "Sacrifice"
|
||||
l.set_meta("marker", e)
|
||||
l.text = t
|
||||
l.add_color_override("font_color", Color(0.6,0.6,1,1))
|
||||
l.rect_position = pos - l.rect_size / 2.0
|
||||
l.show()
|
||||
var current = null
|
||||
var cur_d = INF
|
||||
for l in labels:
|
||||
if l.visible:
|
||||
var d = l.rect_position.distance_squared_to(center)
|
||||
if !current:
|
||||
cur_d = d
|
||||
current = l
|
||||
else:
|
||||
if cur_d > d:
|
||||
current = l
|
||||
cur_d = d
|
||||
if current:
|
||||
current.add_color_override("font_color", Color(0.9,0.9,1,1))
|
||||
current_marker = current.get_meta("marker")
|
||||
else:
|
||||
current_marker = null
|
||||
|
||||
state = 2
|
||||
|
||||
if state == 2:
|
||||
state = 1
|
||||
# var player = get_viewport().get_camera().get_meta("player")
|
||||
# if !controls.is_gui && !player.has_meta("group_behavior") && !player.has_meta("")
|
||||
# if Input.is_action_just_pressed("activate"):
|
||||
# var marker = current_marker
|
||||
# if marker && marker.has_meta("marker_data"):
|
||||
# var md = marker.get_meta("marker_data")
|
||||
# print("marker_data: ", md)
|
||||
# if md.has("obj"):
|
||||
# print("obj: ", md.obj.name)
|
||||
# if md.has("obj") && md.has("method"):
|
||||
# print("activate ", md.obj.name, " ", md.method)
|
||||
# md.obj.call_deferred(md.method, md)
|
||||
func activate_marker():
|
||||
print("Activate marker")
|
||||
var marker = current_marker
|
||||
if marker && marker.has_meta("marker_data"):
|
||||
var md = marker.get_meta("marker_data")
|
||||
print("marker_data: ", md)
|
||||
if md.has("obj"):
|
||||
print("obj: ", md.obj.name)
|
||||
if md.has("obj") && md.has("method"):
|
||||
print("activate ", md.obj.name, " ", md.method)
|
||||
md.obj.call_deferred(md.method, md)
|
||||
|
||||
func init_markers(obj, marker_info):
|
||||
var queue = [obj]
|
||||
while queue.size() > 0:
|
||||
var item = queue.pop_front()
|
||||
if item.name.begins_with("marker_"):
|
||||
if marker_info.has(item.name):
|
||||
marker_info[item.name].marker_obj = item
|
||||
for e in item.get_children():
|
||||
queue.push_back(e)
|
||||
queue = [obj]
|
||||
while queue.size() > 0:
|
||||
var item = queue.pop_front()
|
||||
if item.name.begins_with("marker_"):
|
||||
var marker_data = {}
|
||||
marker_data.obj = obj
|
||||
if marker_info.has(item.name):
|
||||
var o = marker_info[item.name]
|
||||
for k in o.keys():
|
||||
marker_data[k] = o[k]
|
||||
if o.has("see_through") && o.see_through:
|
||||
item.hide()
|
||||
item.set_meta("marker_data", marker_data)
|
||||
for e in item.get_children():
|
||||
queue.push_back(e)
|
||||
func init_marker(m, obj, data):
|
||||
assert(m)
|
||||
assert(obj)
|
||||
assert(data)
|
||||
var marker_data = {}
|
||||
marker_data.obj = m
|
||||
for e in data.keys():
|
||||
marker_data[e] = data[e]
|
||||
if data.has("see_through") && data.see_through:
|
||||
obj.hide()
|
||||
obj.set_meta("marker_data", marker_data)
|
||||
if !obj in marker_list:
|
||||
marker_list.push_back(obj)
|
||||
17
autoload/scenario.gd
Normal file
17
autoload/scenario.gd
Normal file
@@ -0,0 +1,17 @@
|
||||
extends Node
|
||||
|
||||
|
||||
# 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():
|
||||
pass # Replace with function body.
|
||||
|
||||
var save_data = {}
|
||||
|
||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
#func _process(delta):
|
||||
# pass
|
||||
296
autoload/streaming.gd
Normal file
296
autoload/streaming.gd
Normal file
@@ -0,0 +1,296 @@
|
||||
extends Node
|
||||
|
||||
export var trailer_house: PackedScene
|
||||
export var palace: PackedScene
|
||||
export var car: PackedScene
|
||||
|
||||
onready var obj_names = {
|
||||
"palace": palace,
|
||||
"trailer_house": trailer_house
|
||||
}
|
||||
|
||||
var done = false
|
||||
|
||||
class radial_grid:
|
||||
var radial_points = []
|
||||
var max_r = 0.0
|
||||
var grid = []
|
||||
var width: int = 0
|
||||
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 towns = 0
|
||||
func setup_town(site):
|
||||
if !RoadsData.site_is_town(site):
|
||||
print("site ", site, " type: ", RoadsData.get_site_type(site))
|
||||
return
|
||||
var poly = RoadsData.get_site_polygon_3d(site)
|
||||
var height = RoadsData.get_site_avg_height(site)
|
||||
var border2 = calc_border(poly, 60)
|
||||
var aabbs = []
|
||||
var poly2 = []
|
||||
poly2.resize(border2.size())
|
||||
for p in range(border2.size()):
|
||||
poly2[p] = Vector2(border2[p].x, border2[p].z)
|
||||
var center = Vector3()
|
||||
for p in poly:
|
||||
center += p
|
||||
center /= poly.size()
|
||||
center.y = height
|
||||
grid.build(border2, center)
|
||||
var radial_points = grid.radial_points
|
||||
var max_r = 0.0
|
||||
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
|
||||
for p in range(radial_points.size()):
|
||||
var ep = radial_points[p]
|
||||
var d = (center - ep).normalized()
|
||||
var dst = ep.distance_to(center)
|
||||
print(dst)
|
||||
if dst < 64.0 + 12 + 8 + 4:
|
||||
continue
|
||||
var step = 16.0
|
||||
var pstart = ep
|
||||
while dst > 0.0:
|
||||
var ok = true
|
||||
if !Geometry.is_point_in_polygon(Vector2(pstart.x, pstart.z), poly2):
|
||||
ok = false
|
||||
if ok:
|
||||
for b in aabbs:
|
||||
if b.has_point(pstart):
|
||||
ok = false
|
||||
if ok:
|
||||
var xform = Transform(Basis(), pstart).looking_at(pstart + d, Vector3.UP)
|
||||
stream_obj("trailer_house", xform)
|
||||
var aabb = AABB(pstart, Vector3())
|
||||
aabb = aabb.grow(20)
|
||||
aabbs.push_back(aabb)
|
||||
print("placed to: ", pstart)
|
||||
pstart = pstart + d * step
|
||||
dst -= step
|
||||
towns += 1
|
||||
|
||||
func setup_first_town():
|
||||
assert(!done)
|
||||
var poly = RoadsData.get_site_polygon_3d(0)
|
||||
var height = RoadsData.get_site_avg_height(0)
|
||||
var border = calc_border(poly, 32)
|
||||
var border1a = calc_border(poly, 42)
|
||||
var border2 = calc_border(poly, 60)
|
||||
|
||||
var poly2 = []
|
||||
poly2.resize(border2.size())
|
||||
for p in range(border2.size()):
|
||||
poly2[p] = Vector2(border2[p].x, border2[p].z)
|
||||
var center = Vector3()
|
||||
for p in poly:
|
||||
center += p
|
||||
center /= poly.size()
|
||||
center.y = height
|
||||
grid.build(border2, center)
|
||||
var radial_points = grid.radial_points
|
||||
var max_r = 0.0
|
||||
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
|
||||
var u = radial_points.size()
|
||||
var v = int(max_r / 32)
|
||||
var grid = []
|
||||
grid.resize(u * v)
|
||||
for p in range(u):
|
||||
var start = radial_points[p]
|
||||
var end = center
|
||||
var step = (end - start).normalized() * (end - start).length() / float(v + 1)
|
||||
var val = start
|
||||
for q in range(v):
|
||||
grid[p * v + q] = {"position": val}
|
||||
var aabbs = []
|
||||
var palace_aabb = AABB(center, Vector3())
|
||||
palace_aabb = palace_aabb.grow(48)
|
||||
print(palace_aabb)
|
||||
aabbs.push_back(palace_aabb)
|
||||
stream_obj("palace", Transform(Basis(), center))
|
||||
|
||||
for p in range(radial_points.size()):
|
||||
var ep = radial_points[p]
|
||||
var d = (center - ep).normalized()
|
||||
var dst = ep.distance_to(center)
|
||||
print(dst)
|
||||
if dst < 64.0 + 12 + 8 + 4:
|
||||
continue
|
||||
var step = 16.0
|
||||
var pstart = ep
|
||||
while dst > 0.0:
|
||||
var ok = true
|
||||
if !Geometry.is_point_in_polygon(Vector2(pstart.x, pstart.z), poly2):
|
||||
ok = false
|
||||
if ok:
|
||||
for b in aabbs:
|
||||
if b.has_point(pstart):
|
||||
ok = false
|
||||
if ok:
|
||||
var xform = Transform(Basis(), pstart).looking_at(pstart + d, Vector3.UP)
|
||||
stream_obj("trailer_house", xform)
|
||||
var aabb = AABB(pstart, Vector3())
|
||||
aabb = aabb.grow(20)
|
||||
aabbs.push_back(aabb)
|
||||
print("placed to: ", pstart)
|
||||
pstart = pstart + d * step
|
||||
dst -= step
|
||||
towns += 1
|
||||
done = true
|
||||
|
||||
func _ready():
|
||||
for k in obj_names.keys():
|
||||
Spawner.add_scene(k, obj_names[k])
|
||||
|
||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
var delay = 3.0
|
||||
var state = 0
|
||||
func _process(delta):
|
||||
match state:
|
||||
0:
|
||||
delay -= delta
|
||||
if delay < 0:
|
||||
state = 1
|
||||
1:
|
||||
Spawner.update_view(self, 300)
|
||||
var sc = get_tree().root
|
||||
var viewport: = get_viewport()
|
||||
if !viewport:
|
||||
return
|
||||
var cam: = viewport.get_camera()
|
||||
if !cam:
|
||||
return
|
||||
var cam_xform: = cam.global_transform
|
||||
|
||||
func stream_obj(obj: String, xform: Transform):
|
||||
Spawner.place_scene(obj, xform)
|
||||
func _physics_process(delta):
|
||||
var cam = get_viewport().get_camera()
|
||||
if !cam:
|
||||
return
|
||||
match state:
|
||||
1:
|
||||
var space_state = get_viewport().get_world().direct_space_state
|
||||
# probaly should not be here
|
||||
for n in get_tree().get_nodes_in_group("spawn"):
|
||||
var ok = false
|
||||
if !n.is_in_group("keep"):
|
||||
var where = n.get_global_transform().origin
|
||||
var from = where
|
||||
var to = where
|
||||
from.y -= 8.0
|
||||
to.y += 8.0
|
||||
var result = space_state.intersect_ray(from, to)
|
||||
if result.empty() || !result.has("collider"):
|
||||
continue
|
||||
if result.collider:
|
||||
n.global_transform.origin = result.position
|
||||
ok = true
|
||||
if ok || n.is_in_group("keep"):
|
||||
if n.is_in_group("male"):
|
||||
characters.replace_character(n, "male", ["cmdq", "marker", "hurtboxes", "student"])
|
||||
elif n.is_in_group("female"):
|
||||
characters.replace_character(n, "female", ["cmdq", "marker", "hurtboxes", "student"])
|
||||
elif n.is_in_group("car"):
|
||||
var c = car.instance()
|
||||
var p = get_tree().root
|
||||
p.add_child(c)
|
||||
c.global_transform = n.global_transform
|
||||
n.queue_free()
|
||||
12
autoload/streaming.tscn
Normal file
12
autoload/streaming.tscn
Normal file
@@ -0,0 +1,12 @@
|
||||
[gd_scene load_steps=5 format=2]
|
||||
|
||||
[ext_resource path="res://autoload/streaming.gd" type="Script" id=1]
|
||||
[ext_resource path="res://objects/trailer-house.tscn" type="PackedScene" id=2]
|
||||
[ext_resource path="res://objects/palace.tscn" type="PackedScene" id=3]
|
||||
[ext_resource path="res://scenes/vehicles/car.tscn" type="PackedScene" id=4]
|
||||
|
||||
[node name="streaming" type="Node"]
|
||||
script = ExtResource( 1 )
|
||||
trailer_house = ExtResource( 2 )
|
||||
palace = ExtResource( 3 )
|
||||
car = ExtResource( 4 )
|
||||
26
camera/camera_pos.tscn
Normal file
26
camera/camera_pos.tscn
Normal 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="camera_pos" 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, 1.75, 0.2 )
|
||||
shape = SubResource( 1 )
|
||||
spring_length = 2.0
|
||||
margin = 0.04
|
||||
|
||||
[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 )
|
||||
far = 350.0
|
||||
15
camera/environment.tres
Normal file
15
camera/environment.tres
Normal file
@@ -0,0 +1,15 @@
|
||||
[gd_resource type="Environment" load_steps=2 format=2]
|
||||
|
||||
[sub_resource type="ProceduralSky" id=1]
|
||||
|
||||
[resource]
|
||||
background_mode = 2
|
||||
background_sky = SubResource( 1 )
|
||||
ambient_light_energy = 0.7
|
||||
fog_enabled = true
|
||||
fog_color = Color( 0.447059, 0.501961, 0.552941, 1 )
|
||||
fog_sun_color = Color( 1, 0.901961, 0.701961, 1 )
|
||||
fog_sun_amount = 0.25
|
||||
fog_depth_end = 250.0
|
||||
fog_depth_curve = 0.196146
|
||||
dof_blur_far_quality = 0
|
||||
13
camera/fps_cam_pos.tscn
Normal file
13
camera/fps_cam_pos.tscn
Normal file
@@ -0,0 +1,13 @@
|
||||
[gd_scene load_steps=2 format=2]
|
||||
|
||||
[ext_resource path="res://camera/environment.tres" type="Environment" id=1]
|
||||
|
||||
[node name="fps_cam_pos" type="Spatial"]
|
||||
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.75, -0.2 )
|
||||
|
||||
[node name="fos_cam_rot_y" type="Spatial" parent="."]
|
||||
|
||||
[node name="fps_cam_rot_x" type="Spatial" parent="fos_cam_rot_y"]
|
||||
|
||||
[node name="fps_camera" type="Camera" parent="fos_cam_rot_y/fps_cam_rot_x"]
|
||||
environment = ExtResource( 1 )
|
||||
12
characters/character.gd
Normal file
12
characters/character.gd
Normal file
@@ -0,0 +1,12 @@
|
||||
extends KinematicBody
|
||||
|
||||
|
||||
func _ready():
|
||||
add_to_group("characters")
|
||||
|
||||
func hide_face():
|
||||
$"vroid1-man/Skeleton/head/face".hide()
|
||||
$"vroid1-man/Skeleton/head/hair".hide()
|
||||
func show_face():
|
||||
$"vroid1-man/Skeleton/head/face".show()
|
||||
$"vroid1-man/Skeleton/head/hair".show()
|
||||
734
characters/vroid1-female.tscn
Normal file
734
characters/vroid1-female.tscn
Normal file
@@ -0,0 +1,734 @@
|
||||
[gd_scene load_steps=138 format=2]
|
||||
|
||||
[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/face/female-face1.tscn" type="PackedScene" id=3]
|
||||
|
||||
[sub_resource type="SphereShape" id=1]
|
||||
radius = 0.13
|
||||
|
||||
[sub_resource type="SphereShape" id=2]
|
||||
radius = 0.14
|
||||
|
||||
[sub_resource type="BoxShape" id=3]
|
||||
extents = Vector3( 0.13, 0.16, 0.06 )
|
||||
|
||||
[sub_resource type="AnimationNodeAnimation" id=4]
|
||||
animation = "blend-right-arm-blade"
|
||||
|
||||
[sub_resource type="AnimationNodeAnimation" id=5]
|
||||
animation = "blend-left-arm-blade"
|
||||
|
||||
[sub_resource type="AnimationNodeTimeScale" id=6]
|
||||
|
||||
[sub_resource type="AnimationNodeBlend2" id=7]
|
||||
filter_enabled = true
|
||||
filters = [ "skeleton/Skeleton:hand_l", "skeleton/Skeleton:index_1_l", "skeleton/Skeleton:index_2_l", "skeleton/Skeleton:index_3_end_l", "skeleton/Skeleton:index_3_l", "skeleton/Skeleton:little_1_l", "skeleton/Skeleton:little_2_l", "skeleton/Skeleton:little_3_end_l", "skeleton/Skeleton:little_3_l", "skeleton/Skeleton:middle_1_l", "skeleton/Skeleton:middle_2_l", "skeleton/Skeleton:middle_3_end_l", "skeleton/Skeleton:middle_3_l", "skeleton/Skeleton:ring_1_l", "skeleton/Skeleton:ring_2_l", "skeleton/Skeleton:ring_3_end_l", "skeleton/Skeleton:ring_3_l", "skeleton/Skeleton:thumb_1_l", "skeleton/Skeleton:thumb_2_l", "skeleton/Skeleton:thumb_3_end_l", "skeleton/Skeleton:thumb_3_l" ]
|
||||
|
||||
[sub_resource type="AnimationNodeBlend2" id=8]
|
||||
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" ]
|
||||
|
||||
[sub_resource type="AnimationNodeAnimation" id=9]
|
||||
animation = "climb1"
|
||||
|
||||
[sub_resource type="AnimationNodeTimeScale" id=10]
|
||||
|
||||
[sub_resource type="AnimationNodeBlendTree" id=11]
|
||||
nodes/Animation/node = SubResource( 9 )
|
||||
nodes/Animation/position = Vector2( 235, 191 )
|
||||
nodes/TimeScale/node = SubResource( 10 )
|
||||
nodes/TimeScale/position = Vector2( 480, 160 )
|
||||
nodes/output/position = Vector2( 760, 160 )
|
||||
node_connections = [ "output", 0, "TimeScale", "TimeScale", 0, "Animation" ]
|
||||
|
||||
[sub_resource type="AnimationNodeAnimation" id=12]
|
||||
animation = "climb1a"
|
||||
|
||||
[sub_resource type="AnimationNodeTimeScale" id=13]
|
||||
|
||||
[sub_resource type="AnimationNodeBlendTree" id=14]
|
||||
nodes/Animation/node = SubResource( 12 )
|
||||
nodes/Animation/position = Vector2( 354, 279 )
|
||||
nodes/TimeScale/node = SubResource( 13 )
|
||||
nodes/TimeScale/position = Vector2( 763, 297 )
|
||||
nodes/output/position = Vector2( 1220, 300 )
|
||||
node_connections = [ "output", 0, "TimeScale", "TimeScale", 0, "Animation" ]
|
||||
|
||||
[sub_resource type="AnimationNodeBlendTree" id=15]
|
||||
|
||||
[sub_resource type="AnimationNodeAnimation" id=16]
|
||||
animation = "start-grabbed"
|
||||
|
||||
[sub_resource type="AnimationNodeTimeScale" id=17]
|
||||
|
||||
[sub_resource type="AnimationNodeBlendTree" id=18]
|
||||
nodes/Animation/node = SubResource( 16 )
|
||||
nodes/Animation/position = Vector2( 380, 100 )
|
||||
nodes/TimeScale/node = SubResource( 17 )
|
||||
nodes/TimeScale/position = Vector2( 592, 184 )
|
||||
nodes/output/position = Vector2( 860, 120 )
|
||||
node_connections = [ "output", 0, "TimeScale", "TimeScale", 0, "Animation" ]
|
||||
|
||||
[sub_resource type="AnimationNodeAnimation" id=19]
|
||||
animation = "female-idle-to-kneel1"
|
||||
|
||||
[sub_resource type="AnimationNodeTimeScale" id=20]
|
||||
|
||||
[sub_resource type="AnimationNodeBlendTree" id=21]
|
||||
nodes/Animation/node = SubResource( 19 )
|
||||
nodes/Animation/position = Vector2( 390, 274 )
|
||||
nodes/TimeScale/node = SubResource( 20 )
|
||||
nodes/TimeScale/position = Vector2( 826, 273 )
|
||||
nodes/output/position = Vector2( 1180, 280 )
|
||||
node_connections = [ "output", 0, "TimeScale", "TimeScale", 0, "Animation" ]
|
||||
|
||||
[sub_resource type="AnimationNodeAnimation" id=22]
|
||||
animation = "11_01-idle"
|
||||
|
||||
[sub_resource type="AnimationNodeAnimation" id=23]
|
||||
animation = "10_01-idle"
|
||||
|
||||
[sub_resource type="AnimationNodeTimeScale" id=24]
|
||||
|
||||
[sub_resource type="AnimationNodeTimeScale" id=25]
|
||||
|
||||
[sub_resource type="AnimationNodeTransition" id=26]
|
||||
input_count = 2
|
||||
xfade_time = 0.4
|
||||
input_0/name = "idle1"
|
||||
input_0/auto_advance = true
|
||||
input_1/name = "idle2"
|
||||
input_1/auto_advance = true
|
||||
|
||||
[sub_resource type="AnimationNodeBlendTree" id=27]
|
||||
nodes/Animation/node = SubResource( 23 )
|
||||
nodes/Animation/position = Vector2( 55, 117 )
|
||||
"nodes/Animation 2/node" = SubResource( 22 )
|
||||
"nodes/Animation 2/position" = Vector2( 80, 260 )
|
||||
nodes/TimeScale/node = SubResource( 25 )
|
||||
nodes/TimeScale/position = Vector2( 580, 100 )
|
||||
"nodes/TimeScale 2/node" = SubResource( 24 )
|
||||
"nodes/TimeScale 2/position" = Vector2( 380, 240 )
|
||||
nodes/output/position = Vector2( 1120, 120 )
|
||||
nodes/t1/node = SubResource( 26 )
|
||||
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" ]
|
||||
|
||||
[sub_resource type="AnimationNodeAnimation" id=28]
|
||||
animation = "walk1p2"
|
||||
|
||||
[sub_resource type="AnimationNodeAnimation" id=29]
|
||||
animation = "walk1p1"
|
||||
|
||||
[sub_resource type="AnimationNodeTimeScale" id=30]
|
||||
|
||||
[sub_resource type="AnimationNodeTimeScale" id=31]
|
||||
|
||||
[sub_resource type="AnimationNodeTransition" id=32]
|
||||
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=33]
|
||||
nodes/Animation/node = SubResource( 29 )
|
||||
nodes/Animation/position = Vector2( 140, 100 )
|
||||
"nodes/Animation 2/node" = SubResource( 28 )
|
||||
"nodes/Animation 2/position" = Vector2( 180, 260 )
|
||||
nodes/TimeScale/node = SubResource( 31 )
|
||||
nodes/TimeScale/position = Vector2( 620, 40 )
|
||||
"nodes/TimeScale 2/node" = SubResource( 30 )
|
||||
"nodes/TimeScale 2/position" = Vector2( 610, 231 )
|
||||
nodes/Transition/node = SubResource( 32 )
|
||||
nodes/Transition/position = Vector2( 905, 264 )
|
||||
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" ]
|
||||
|
||||
[sub_resource type="AnimationNodeAnimation" id=34]
|
||||
animation = "07_01-walk"
|
||||
|
||||
[sub_resource type="AnimationNodeTimeScale" id=35]
|
||||
|
||||
[sub_resource type="AnimationNodeBlendTree" id=36]
|
||||
nodes/Animation/node = SubResource( 34 )
|
||||
nodes/Animation/position = Vector2( 128, 154 )
|
||||
nodes/TimeScale/node = SubResource( 35 )
|
||||
nodes/TimeScale/position = Vector2( 420, 160 )
|
||||
nodes/output/position = Vector2( 640, 160 )
|
||||
node_connections = [ "output", 0, "TimeScale", "TimeScale", 0, "Animation" ]
|
||||
|
||||
[sub_resource type="AnimationNodeAnimation" id=37]
|
||||
animation = "07_03-walk"
|
||||
|
||||
[sub_resource type="AnimationNodeTimeScale" id=38]
|
||||
|
||||
[sub_resource type="AnimationNodeBlendTree" id=39]
|
||||
nodes/Animation/node = SubResource( 37 )
|
||||
nodes/Animation/position = Vector2( 220, 120 )
|
||||
nodes/TimeScale/node = SubResource( 38 )
|
||||
nodes/TimeScale/position = Vector2( 580, 120 )
|
||||
nodes/output/position = Vector2( 840, 140 )
|
||||
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]
|
||||
blend_point_0/node = SubResource( 27 )
|
||||
blend_point_0/pos = Vector2( 0, 0 )
|
||||
blend_point_1/node = SubResource( 33 )
|
||||
blend_point_1/pos = Vector2( 0.2, 0 )
|
||||
blend_point_2/node = SubResource( 36 )
|
||||
blend_point_2/pos = Vector2( 0.2, -1 )
|
||||
blend_point_3/node = SubResource( 39 )
|
||||
blend_point_3/pos = Vector2( 0.2, 1 )
|
||||
blend_point_4/node = SubResource( 45 )
|
||||
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]
|
||||
graph_offset = Vector2( 0, -95 )
|
||||
nodes/loc/node = SubResource( 52 )
|
||||
nodes/loc/position = Vector2( 580, 80 )
|
||||
nodes/output/position = Vector2( 960, 160 )
|
||||
node_connections = [ "output", 0, "loc" ]
|
||||
|
||||
[sub_resource type="AnimationNodeBlendTree" id=54]
|
||||
|
||||
[sub_resource type="AnimationNodeAnimation" id=55]
|
||||
animation = "female-pray-startled-walk1-loop"
|
||||
|
||||
[sub_resource type="AnimationNodeAnimation" id=56]
|
||||
animation = "female-pray-startled-walk1-loop"
|
||||
|
||||
[sub_resource type="AnimationNodeTimeScale" id=57]
|
||||
|
||||
[sub_resource type="AnimationNodeTimeScale" id=58]
|
||||
|
||||
[sub_resource type="AnimationNodeTransition" id=59]
|
||||
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=60]
|
||||
nodes/Animation/node = SubResource( 56 )
|
||||
nodes/Animation/position = Vector2( 200, 280 )
|
||||
"nodes/Animation 2/node" = SubResource( 55 )
|
||||
"nodes/Animation 2/position" = Vector2( 200, 420 )
|
||||
nodes/TimeScale/node = SubResource( 58 )
|
||||
nodes/TimeScale/position = Vector2( 640, 200 )
|
||||
"nodes/TimeScale 2/node" = SubResource( 57 )
|
||||
"nodes/TimeScale 2/position" = Vector2( 640, 360 )
|
||||
nodes/Transition/node = SubResource( 59 )
|
||||
nodes/Transition/position = Vector2( 860, 220 )
|
||||
nodes/output/position = Vector2( 1080, 200 )
|
||||
node_connections = [ "output", 0, "Transition", "TimeScale", 0, "Animation", "Transition", 1, "TimeScale 2", "TimeScale 2", 0, "Animation 2" ]
|
||||
|
||||
[sub_resource type="AnimationNodeAnimation" id=61]
|
||||
animation = "female-pray-startled1"
|
||||
|
||||
[sub_resource type="AnimationNodeTimeScale" id=62]
|
||||
|
||||
[sub_resource type="AnimationNodeBlendTree" id=63]
|
||||
nodes/Animation/node = SubResource( 61 )
|
||||
nodes/Animation/position = Vector2( 181, 220 )
|
||||
nodes/TimeScale/node = SubResource( 62 )
|
||||
nodes/TimeScale/position = Vector2( 590, 212 )
|
||||
nodes/output/position = Vector2( 880, 160 )
|
||||
node_connections = [ "output", 0, "TimeScale", "TimeScale", 0, "Animation" ]
|
||||
|
||||
[sub_resource type="AnimationNodeAnimation" id=64]
|
||||
animation = "female-pray-complete"
|
||||
|
||||
[sub_resource type="AnimationNodeTimeScale" id=65]
|
||||
|
||||
[sub_resource type="AnimationNodeBlendTree" id=66]
|
||||
nodes/Animation/node = SubResource( 64 )
|
||||
nodes/Animation/position = Vector2( 585, 170 )
|
||||
nodes/TimeScale/node = SubResource( 65 )
|
||||
nodes/TimeScale/position = Vector2( 865, 191 )
|
||||
nodes/output/position = Vector2( 1280, 180 )
|
||||
node_connections = [ "output", 0, "TimeScale", "TimeScale", 0, "Animation" ]
|
||||
|
||||
[sub_resource type="AnimationNodeAnimation" id=67]
|
||||
animation = "idle-lying-tied-attack1"
|
||||
|
||||
[sub_resource type="AnimationNodeAnimation" id=68]
|
||||
animation = "idle-lying-tied-attack2"
|
||||
|
||||
[sub_resource type="AnimationNodeAnimation" id=69]
|
||||
animation = "idle-lying-tied-loop"
|
||||
|
||||
[sub_resource type="AnimationNodeTimeScale" id=70]
|
||||
|
||||
[sub_resource type="AnimationNodeTimeScale" id=71]
|
||||
|
||||
[sub_resource type="AnimationNodeOneShot" id=72]
|
||||
|
||||
[sub_resource type="AnimationNodeOneShot" id=73]
|
||||
|
||||
[sub_resource type="AnimationNodeTimeScale" id=74]
|
||||
|
||||
[sub_resource type="AnimationNodeBlendTree" id=75]
|
||||
graph_offset = Vector2( -12, 62 )
|
||||
nodes/Animation/node = SubResource( 69 )
|
||||
nodes/Animation/position = Vector2( 222, 131 )
|
||||
"nodes/Animation 2/node" = SubResource( 67 )
|
||||
"nodes/Animation 2/position" = Vector2( 220, 280 )
|
||||
"nodes/Animation 3/node" = SubResource( 68 )
|
||||
"nodes/Animation 3/position" = Vector2( 238, 428 )
|
||||
nodes/TimeScale/node = SubResource( 71 )
|
||||
nodes/TimeScale/position = Vector2( 500, 240 )
|
||||
"nodes/TimeScale 2/node" = SubResource( 70 )
|
||||
"nodes/TimeScale 2/position" = Vector2( 500, 380 )
|
||||
nodes/attack1/node = SubResource( 72 )
|
||||
nodes/attack1/position = Vector2( 800, 120 )
|
||||
nodes/attack2/node = SubResource( 73 )
|
||||
nodes/attack2/position = Vector2( 1140, 300 )
|
||||
nodes/output/position = Vector2( 1580, 180 )
|
||||
nodes/speed/node = SubResource( 74 )
|
||||
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" ]
|
||||
|
||||
[sub_resource type="AnimationNodeAnimation" id=76]
|
||||
animation = "dagger-sacrifice-counter-p"
|
||||
|
||||
[sub_resource type="AnimationNodeTimeScale" id=77]
|
||||
|
||||
[sub_resource type="AnimationNodeBlendTree" id=78]
|
||||
graph_offset = Vector2( 0, -259 )
|
||||
nodes/Animation/node = SubResource( 76 )
|
||||
nodes/Animation/position = Vector2( 440, 160 )
|
||||
nodes/TimeScale/node = SubResource( 77 )
|
||||
nodes/TimeScale/position = Vector2( 760, 140 )
|
||||
nodes/output/position = Vector2( 1000, 180 )
|
||||
node_connections = [ "output", 0, "TimeScale", "TimeScale", 0, "Animation" ]
|
||||
|
||||
[sub_resource type="AnimationNodeAnimation" id=79]
|
||||
animation = "sleeping1-loop"
|
||||
|
||||
[sub_resource type="AnimationNodeTimeScale" id=80]
|
||||
|
||||
[sub_resource type="AnimationNodeBlendTree" id=81]
|
||||
nodes/Animation/node = SubResource( 79 )
|
||||
nodes/Animation/position = Vector2( 321, 172 )
|
||||
nodes/TimeScale/node = SubResource( 80 )
|
||||
nodes/TimeScale/position = Vector2( 600, 160 )
|
||||
nodes/output/position = Vector2( 800, 140 )
|
||||
node_connections = [ "output", 0, "TimeScale", "TimeScale", 0, "Animation" ]
|
||||
|
||||
[sub_resource type="AnimationNodeAnimation" id=82]
|
||||
animation = "female-pray-startled-walk1-stand"
|
||||
|
||||
[sub_resource type="AnimationNodeTimeScale" id=83]
|
||||
|
||||
[sub_resource type="AnimationNodeBlendTree" id=84]
|
||||
graph_offset = Vector2( 0, -259 )
|
||||
nodes/Animation/node = SubResource( 82 )
|
||||
nodes/Animation/position = Vector2( 120, 160 )
|
||||
nodes/TimeScale/node = SubResource( 83 )
|
||||
nodes/TimeScale/position = Vector2( 640, 100 )
|
||||
nodes/output/position = Vector2( 1040, 80 )
|
||||
node_connections = [ "output", 0, "TimeScale", "TimeScale", 0, "Animation" ]
|
||||
|
||||
[sub_resource type="AnimationNodeAnimation" id=121]
|
||||
animation = "start-walking"
|
||||
|
||||
[sub_resource type="AnimationNodeTimeScale" id=122]
|
||||
|
||||
[sub_resource type="AnimationNodeBlendTree" id=115]
|
||||
nodes/Animation/node = SubResource( 121 )
|
||||
nodes/Animation/position = Vector2( 189, 171 )
|
||||
nodes/TimeScale/node = SubResource( 122 )
|
||||
nodes/TimeScale/position = Vector2( 420, 160 )
|
||||
nodes/output/position = Vector2( 640, 160 )
|
||||
node_connections = [ "output", 0, "TimeScale", "TimeScale", 0, "Animation" ]
|
||||
|
||||
[sub_resource type="AnimationNodeAnimation" id=123]
|
||||
animation = "stop-walking"
|
||||
|
||||
[sub_resource type="AnimationNodeTimeScale" id=124]
|
||||
|
||||
[sub_resource type="AnimationNodeBlendTree" id=116]
|
||||
nodes/Animation/node = SubResource( 123 )
|
||||
nodes/Animation/position = Vector2( 275, 334 )
|
||||
nodes/TimeScale/node = SubResource( 124 )
|
||||
nodes/TimeScale/position = Vector2( 587, 359 )
|
||||
nodes/output/position = Vector2( 860, 340 )
|
||||
node_connections = [ "output", 0, "TimeScale", "TimeScale", 0, "Animation" ]
|
||||
|
||||
[sub_resource type="AnimationNodeAnimation" id=131]
|
||||
animation = "turn-left"
|
||||
|
||||
[sub_resource type="AnimationNodeTimeScale" id=132]
|
||||
|
||||
[sub_resource type="AnimationNodeBlendTree" id=125]
|
||||
nodes/Animation/node = SubResource( 131 )
|
||||
nodes/Animation/position = Vector2( 200, 240 )
|
||||
nodes/TimeScale/node = SubResource( 132 )
|
||||
nodes/TimeScale/position = Vector2( 445, 231 )
|
||||
nodes/output/position = Vector2( 680, 240 )
|
||||
node_connections = [ "output", 0, "TimeScale", "TimeScale", 0, "Animation" ]
|
||||
|
||||
[sub_resource type="AnimationNodeAnimation" id=133]
|
||||
animation = "turn-right"
|
||||
|
||||
[sub_resource type="AnimationNodeTimeScale" id=134]
|
||||
|
||||
[sub_resource type="AnimationNodeBlendTree" id=126]
|
||||
nodes/Animation/node = SubResource( 133 )
|
||||
nodes/Animation/position = Vector2( 213, 136 )
|
||||
nodes/TimeScale/node = SubResource( 134 )
|
||||
nodes/TimeScale/position = Vector2( 480, 140 )
|
||||
nodes/output/position = Vector2( 780, 160 )
|
||||
node_connections = [ "output", 0, "TimeScale", "TimeScale", 0, "Animation" ]
|
||||
|
||||
[sub_resource type="AnimationNodeAnimation" id=113]
|
||||
animation = "default"
|
||||
|
||||
[sub_resource type="AnimationNodeTimeScale" id=114]
|
||||
|
||||
[sub_resource type="AnimationNodeBlendTree" id=85]
|
||||
nodes/Animation/node = SubResource( 113 )
|
||||
nodes/Animation/position = Vector2( 139, 122 )
|
||||
nodes/TimeScale/node = SubResource( 114 )
|
||||
nodes/TimeScale/position = Vector2( 461, 131 )
|
||||
nodes/output/position = Vector2( 860, 140 )
|
||||
node_connections = [ "output", 0, "TimeScale", "TimeScale", 0, "Animation" ]
|
||||
|
||||
[sub_resource type="AnimationNodeStateMachineTransition" id=86]
|
||||
|
||||
[sub_resource type="AnimationNodeStateMachineTransition" id=87]
|
||||
|
||||
[sub_resource type="AnimationNodeStateMachineTransition" id=88]
|
||||
|
||||
[sub_resource type="AnimationNodeStateMachineTransition" id=89]
|
||||
|
||||
[sub_resource type="AnimationNodeStateMachineTransition" id=90]
|
||||
|
||||
[sub_resource type="AnimationNodeStateMachineTransition" id=91]
|
||||
|
||||
[sub_resource type="AnimationNodeStateMachineTransition" id=92]
|
||||
|
||||
[sub_resource type="AnimationNodeStateMachineTransition" id=93]
|
||||
switch_mode = 2
|
||||
auto_advance = true
|
||||
|
||||
[sub_resource type="AnimationNodeStateMachineTransition" id=94]
|
||||
|
||||
[sub_resource type="AnimationNodeStateMachineTransition" id=95]
|
||||
switch_mode = 2
|
||||
|
||||
[sub_resource type="AnimationNodeStateMachineTransition" id=96]
|
||||
|
||||
[sub_resource type="AnimationNodeStateMachineTransition" id=97]
|
||||
|
||||
[sub_resource type="AnimationNodeStateMachineTransition" id=98]
|
||||
switch_mode = 2
|
||||
auto_advance = true
|
||||
xfade_time = 0.1
|
||||
|
||||
[sub_resource type="AnimationNodeStateMachineTransition" id=99]
|
||||
|
||||
[sub_resource type="AnimationNodeStateMachineTransition" id=100]
|
||||
switch_mode = 2
|
||||
|
||||
[sub_resource type="AnimationNodeStateMachineTransition" id=101]
|
||||
switch_mode = 2
|
||||
|
||||
[sub_resource type="AnimationNodeStateMachineTransition" id=102]
|
||||
|
||||
[sub_resource type="AnimationNodeStateMachineTransition" id=103]
|
||||
|
||||
[sub_resource type="AnimationNodeStateMachineTransition" id=104]
|
||||
|
||||
[sub_resource type="AnimationNodeStateMachineTransition" id=105]
|
||||
switch_mode = 2
|
||||
auto_advance = true
|
||||
|
||||
[sub_resource type="AnimationNodeStateMachineTransition" id=106]
|
||||
|
||||
[sub_resource type="AnimationNodeStateMachineTransition" id=107]
|
||||
switch_mode = 2
|
||||
auto_advance = true
|
||||
|
||||
[sub_resource type="AnimationNodeStateMachineTransition" id=108]
|
||||
switch_mode = 2
|
||||
auto_advance = true
|
||||
|
||||
[sub_resource type="AnimationNodeStateMachineTransition" id=109]
|
||||
|
||||
[sub_resource type="AnimationNodeStateMachineTransition" id=117]
|
||||
|
||||
[sub_resource type="AnimationNodeStateMachineTransition" id=118]
|
||||
switch_mode = 2
|
||||
auto_advance = true
|
||||
|
||||
[sub_resource type="AnimationNodeStateMachineTransition" id=119]
|
||||
|
||||
[sub_resource type="AnimationNodeStateMachineTransition" id=120]
|
||||
switch_mode = 2
|
||||
auto_advance = true
|
||||
|
||||
[sub_resource type="AnimationNodeStateMachineTransition" id=127]
|
||||
|
||||
[sub_resource type="AnimationNodeStateMachineTransition" id=128]
|
||||
switch_mode = 2
|
||||
|
||||
[sub_resource type="AnimationNodeStateMachineTransition" id=129]
|
||||
|
||||
[sub_resource type="AnimationNodeStateMachineTransition" id=130]
|
||||
switch_mode = 2
|
||||
|
||||
[sub_resource type="AnimationNodeStateMachine" id=110]
|
||||
states/climb1/node = SubResource( 11 )
|
||||
states/climb1/position = Vector2( 804, 503.193 )
|
||||
states/climb1a/node = SubResource( 14 )
|
||||
states/climb1a/position = Vector2( 947, 503.193 )
|
||||
states/drive/node = SubResource( 15 )
|
||||
states/drive/position = Vector2( 868, 316.193 )
|
||||
states/grabbed/node = SubResource( 18 )
|
||||
states/grabbed/position = Vector2( 1277, 182.193 )
|
||||
states/kneel/node = SubResource( 21 )
|
||||
states/kneel/position = Vector2( 522, 84 )
|
||||
states/locomotion/node = SubResource( 53 )
|
||||
states/locomotion/position = Vector2( 822, 111 )
|
||||
states/passenger/node = SubResource( 54 )
|
||||
states/passenger/position = Vector2( 574, 327 )
|
||||
states/pray/node = SubResource( 66 )
|
||||
states/pray/position = Vector2( 381, 222 )
|
||||
states/pray-startled/node = SubResource( 63 )
|
||||
states/pray-startled/position = Vector2( 294, 316.193 )
|
||||
states/pray-startled-walk/node = SubResource( 60 )
|
||||
states/pray-startled-walk/position = Vector2( 294, 514.193 )
|
||||
states/sacrifice/node = SubResource( 75 )
|
||||
states/sacrifice/position = Vector2( 1023, 135 )
|
||||
states/sacrificed/node = SubResource( 78 )
|
||||
states/sacrificed/position = Vector2( 1125, 283 )
|
||||
states/sleeping/node = SubResource( 81 )
|
||||
states/sleeping/position = Vector2( 1078, 411.193 )
|
||||
states/stand-startled/node = SubResource( 84 )
|
||||
states/stand-startled/position = Vector2( 717, 411.193 )
|
||||
states/start_walking/node = SubResource( 115 )
|
||||
states/start_walking/position = Vector2( 522, 597.193 )
|
||||
states/stop_walking/node = SubResource( 116 )
|
||||
states/stop_walking/position = Vector2( 663, 697.193 )
|
||||
states/tun_left/node = SubResource( 125 )
|
||||
states/tun_left/position = Vector2( 868, 633.193 )
|
||||
states/turn_right/node = SubResource( 126 )
|
||||
states/turn_right/position = Vector2( 1059, 620.193 )
|
||||
states/use_tap/node = SubResource( 85 )
|
||||
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 ) ]
|
||||
start_node = "locomotion"
|
||||
graph_offset = Vector2( -232, 15.1925 )
|
||||
|
||||
[sub_resource type="AnimationNodeBlendTree" id=111]
|
||||
graph_offset = Vector2( 0, -221 )
|
||||
nodes/Animation/node = SubResource( 5 )
|
||||
nodes/Animation/position = Vector2( 540, 280 )
|
||||
"nodes/Animation 2/node" = SubResource( 4 )
|
||||
"nodes/Animation 2/position" = Vector2( 920, 280 )
|
||||
nodes/all_scale/node = SubResource( 6 )
|
||||
nodes/all_scale/position = Vector2( 840, -20 )
|
||||
nodes/blade_left/node = SubResource( 7 )
|
||||
nodes/blade_left/position = Vector2( 1040, 0 )
|
||||
nodes/blade_right/node = SubResource( 8 )
|
||||
nodes/blade_right/position = Vector2( 1400, 100 )
|
||||
nodes/output/position = Vector2( 1820, -20 )
|
||||
nodes/state/node = SubResource( 110 )
|
||||
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" ]
|
||||
|
||||
[sub_resource type="AnimationNodeStateMachinePlayback" id=112]
|
||||
|
||||
[node name="vroid1-female" instance=ExtResource( 1 )]
|
||||
|
||||
[node name="Skeleton" parent="skeleton" index="0"]
|
||||
bones/1/bound_children = [ NodePath("hips") ]
|
||||
bones/25/bound_children = [ NodePath("chest") ]
|
||||
bones/80/bound_children = [ NodePath("head") ]
|
||||
bones/99/bound_children = [ NodePath("wrist_l") ]
|
||||
bones/101/bound_children = [ NodePath("wrist_r") ]
|
||||
|
||||
[node name="body" parent="skeleton/Skeleton" index="0"]
|
||||
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"]
|
||||
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 )
|
||||
bone_name = "Head"
|
||||
|
||||
[node name="marker_talk" type="Spatial" parent="skeleton/Skeleton/head" index="0"]
|
||||
transform = Transform( 0.938982, -0.1833, 0.290986, 0.0970959, 0.953036, 0.286975, -0.3299, -0.241222, 0.912684, -0.00304712, 0.094561, -0.232747 )
|
||||
|
||||
[node name="marker_hips_action" type="Spatial" parent="skeleton/Skeleton/head" index="1"]
|
||||
transform = Transform( 0.845972, -0.248965, 0.471515, 0.270435, 0.962465, 0.0230151, -0.459582, 0.108024, 0.88155, 0.0862694, -0.150184, 0.25561 )
|
||||
|
||||
[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 )
|
||||
|
||||
[node name="CollisionShape" type="CollisionShape" parent="skeleton/Skeleton/head/head_hurt" index="0"]
|
||||
shape = SubResource( 1 )
|
||||
|
||||
[node name="hair" type="Spatial" parent="skeleton/Skeleton/head" index="3"]
|
||||
transform = Transform( 1, 0, 0, 0, 0.984808, -0.173648, 0, 0.173648, 0.984808, 0, 0, 0 )
|
||||
|
||||
[node name="female-hair1" parent="skeleton/Skeleton/head/hair" index="0" instance=ExtResource( 2 )]
|
||||
transform = Transform( 1, -3.21306e-08, 5.58794e-08, 1.86265e-08, 1, 1.49012e-08, 3.35276e-08, -7.45058e-09, 1, 0, 0, 0 )
|
||||
|
||||
[node name="face" type="Spatial" parent="skeleton/Skeleton/head" index="4"]
|
||||
transform = Transform( 1, -1.24197e-11, 0, 1.06852e-11, 1, -5.82077e-11, 0, 0, 1, -0.005, -0.002, 0.006 )
|
||||
|
||||
[node name="female-face1" parent="skeleton/Skeleton/head/face" index="0" instance=ExtResource( 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 )
|
||||
bone_name = "Hips"
|
||||
|
||||
[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 )
|
||||
|
||||
[node name="hips_hurt" type="Area" parent="skeleton/Skeleton/hips" index="1"]
|
||||
|
||||
[node name="CollisionShape" type="CollisionShape" parent="skeleton/Skeleton/hips/hips_hurt" index="0"]
|
||||
shape = SubResource( 2 )
|
||||
|
||||
[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 )
|
||||
bone_name = "wrist_ik_R"
|
||||
|
||||
[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 )
|
||||
|
||||
[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 )
|
||||
bone_name = "wrist_ik_L"
|
||||
|
||||
[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 )
|
||||
|
||||
[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 )
|
||||
bone_name = "Chest"
|
||||
|
||||
[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 )
|
||||
|
||||
[node name="CollisionShape" type="CollisionShape" parent="skeleton/Skeleton/chest/chest_hurt" index="0"]
|
||||
shape = SubResource( 3 )
|
||||
|
||||
[node name="MeshInstance" type="MeshInstance" parent="skeleton/Skeleton" index="7"]
|
||||
|
||||
[node name="AnimationTree" type="AnimationTree" parent="." index="2"]
|
||||
tree_root = SubResource( 111 )
|
||||
anim_player = NodePath("../AnimationPlayer")
|
||||
active = true
|
||||
root_motion_track = NodePath("skeleton/Skeleton:root")
|
||||
parameters/all_scale/scale = 1.0
|
||||
parameters/blade_left/blend_amount = 0.0
|
||||
parameters/blade_right/blend_amount = 0.0
|
||||
parameters/state/playback = SubResource( 112 )
|
||||
parameters/state/climb1/TimeScale/scale = 2.0
|
||||
parameters/state/climb1a/TimeScale/scale = 2.0
|
||||
parameters/state/grabbed/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/0/TimeScale/scale = 2.0
|
||||
"parameters/state/locomotion/loc/0/TimeScale 2/scale" = 1.5
|
||||
parameters/state/locomotion/loc/0/t1/current = 1
|
||||
parameters/state/locomotion/loc/1/TimeScale/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/2/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-startled/TimeScale/scale = 1.8
|
||||
parameters/state/pray-startled-walk/TimeScale/scale = 1.3
|
||||
"parameters/state/pray-startled-walk/TimeScale 2/scale" = 1.6
|
||||
parameters/state/pray-startled-walk/Transition/current = 1
|
||||
parameters/state/sacrifice/TimeScale/scale = 1.0
|
||||
"parameters/state/sacrifice/TimeScale 2/scale" = 1.0
|
||||
parameters/state/sacrifice/attack1/active = false
|
||||
parameters/state/sacrifice/attack2/active = false
|
||||
parameters/state/sacrifice/speed/scale = 1.0
|
||||
parameters/state/sacrificed/TimeScale/scale = 1.0
|
||||
parameters/state/sleeping/TimeScale/scale = 1.0
|
||||
parameters/state/stand-startled/TimeScale/scale = 0.7
|
||||
parameters/state/start_walking/TimeScale/scale = 1.0
|
||||
parameters/state/stop_walking/TimeScale/scale = 1.0
|
||||
parameters/state/tun_left/TimeScale/scale = 1.0
|
||||
parameters/state/turn_right/TimeScale/scale = 1.0
|
||||
parameters/state/use_tap/TimeScale/scale = 1.0
|
||||
BIN
characters/vroid1-man-animate.bin
Normal file
BIN
characters/vroid1-man-animate.bin
Normal file
Binary file not shown.
259662
characters/vroid1-man-animate.gltf
Normal file
259662
characters/vroid1-man-animate.gltf
Normal file
File diff suppressed because it is too large
Load Diff
1064
characters/vroid1-man-animate.gltf.import
Normal file
1064
characters/vroid1-man-animate.gltf.import
Normal file
File diff suppressed because it is too large
Load Diff
3
characters/vroid1-man-at.tres
Normal file
3
characters/vroid1-man-at.tres
Normal file
@@ -0,0 +1,3 @@
|
||||
[gd_resource type="AnimationNodeStateMachinePlayback" format=2]
|
||||
|
||||
[resource]
|
||||
210
characters/vroid1-man-xat.tres
Normal file
210
characters/vroid1-man-xat.tres
Normal file
@@ -0,0 +1,210 @@
|
||||
[gd_resource type="AnimationNodeBlendTree" load_steps=44 format=2]
|
||||
|
||||
[sub_resource type="AnimationNodeAnimation" id=1]
|
||||
animation = "blend-blade-right"
|
||||
|
||||
[sub_resource type="AnimationNodeAnimation" id=2]
|
||||
animation = "blend-blade-left"
|
||||
|
||||
[sub_resource type="AnimationNodeBlend2" id=3]
|
||||
filter_enabled = true
|
||||
filters = [ "Skeleton:j_bip_l_hand", "Skeleton:j_bip_l_index_1", "Skeleton:j_bip_l_index_2", "Skeleton:j_bip_l_index_3", "Skeleton:j_bip_l_little_1", "Skeleton:j_bip_l_little_2", "Skeleton:j_bip_l_little_3", "Skeleton:j_bip_l_middle_1", "Skeleton:j_bip_l_middle_2", "Skeleton:j_bip_l_middle_3", "Skeleton:j_bip_l_ring_1", "Skeleton:j_bip_l_ring_2", "Skeleton:j_bip_l_ring_3", "Skeleton:j_bip_l_thumb_1", "Skeleton:j_bip_l_thumb_2", "Skeleton:j_bip_l_thumb_3" ]
|
||||
|
||||
[sub_resource type="AnimationNodeBlend2" id=4]
|
||||
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" ]
|
||||
|
||||
[sub_resource type="AnimationNodeAnimation" id=5]
|
||||
animation = "drive-loop"
|
||||
|
||||
[sub_resource type="AnimationNodeTimeScale" id=6]
|
||||
|
||||
[sub_resource type="AnimationNodeBlendTree" id=7]
|
||||
nodes/Animation/node = SubResource( 5 )
|
||||
nodes/Animation/position = Vector2( 276, 122 )
|
||||
nodes/TimeScale/node = SubResource( 6 )
|
||||
nodes/TimeScale/position = Vector2( 520, 120 )
|
||||
nodes/output/position = Vector2( 740, 140 )
|
||||
node_connections = [ "output", 0, "TimeScale", "TimeScale", 0, "Animation" ]
|
||||
|
||||
[sub_resource type="AnimationNodeAnimation" id=8]
|
||||
animation = "stand1-loop"
|
||||
|
||||
[sub_resource type="AnimationNodeTimeScale" id=9]
|
||||
|
||||
[sub_resource type="AnimationNodeBlendTree" id=10]
|
||||
nodes/Animation/node = SubResource( 8 )
|
||||
nodes/Animation/position = Vector2( 320, 140 )
|
||||
nodes/TimeScale/node = SubResource( 9 )
|
||||
nodes/TimeScale/position = Vector2( 580, 140 )
|
||||
nodes/output/position = Vector2( 780, 160 )
|
||||
node_connections = [ "output", 0, "TimeScale", "TimeScale", 0, "Animation" ]
|
||||
|
||||
[sub_resource type="AnimationNodeTimeScale" id=11]
|
||||
|
||||
[sub_resource type="AnimationNodeAnimation" id=12]
|
||||
animation = "08_01-walk-p1"
|
||||
|
||||
[sub_resource type="AnimationNodeAnimation" id=13]
|
||||
animation = "08_01-walk-p2"
|
||||
|
||||
[sub_resource type="AnimationNodeAnimation" id=14]
|
||||
animation = "08_01-walk-p3"
|
||||
|
||||
[sub_resource type="AnimationNodeAnimation" id=15]
|
||||
animation = "08_01-walk-p4"
|
||||
|
||||
[sub_resource type="AnimationNodeStateMachineTransition" id=16]
|
||||
switch_mode = 2
|
||||
auto_advance = true
|
||||
xfade_time = 0.01
|
||||
|
||||
[sub_resource type="AnimationNodeStateMachineTransition" id=17]
|
||||
switch_mode = 2
|
||||
auto_advance = true
|
||||
xfade_time = 0.01
|
||||
|
||||
[sub_resource type="AnimationNodeStateMachineTransition" id=18]
|
||||
switch_mode = 2
|
||||
auto_advance = true
|
||||
xfade_time = 0.01
|
||||
|
||||
[sub_resource type="AnimationNodeStateMachineTransition" id=19]
|
||||
switch_mode = 2
|
||||
auto_advance = true
|
||||
xfade_time = 0.01
|
||||
|
||||
[sub_resource type="AnimationNodeStateMachine" id=20]
|
||||
states/08_01-walk-p1/node = SubResource( 12 )
|
||||
states/08_01-walk-p1/position = Vector2( 249, 186 )
|
||||
states/08_01-walk-p2/node = SubResource( 13 )
|
||||
states/08_01-walk-p2/position = Vector2( 536, 75 )
|
||||
states/08_01-walk-p3/node = SubResource( 14 )
|
||||
states/08_01-walk-p3/position = Vector2( 824, 75 )
|
||||
states/08_01-walk-p4/node = SubResource( 15 )
|
||||
states/08_01-walk-p4/position = Vector2( 1084, 186 )
|
||||
transitions = [ "08_01-walk-p1", "08_01-walk-p2", SubResource( 16 ), "08_01-walk-p2", "08_01-walk-p3", SubResource( 17 ), "08_01-walk-p3", "08_01-walk-p4", SubResource( 18 ), "08_01-walk-p4", "08_01-walk-p1", SubResource( 19 ) ]
|
||||
start_node = "08_01-walk-p1"
|
||||
end_node = "08_01-walk-p4"
|
||||
|
||||
[sub_resource type="AnimationNodeBlendTree" id=21]
|
||||
nodes/TimeScale/node = SubResource( 11 )
|
||||
nodes/TimeScale/position = Vector2( 520, 140 )
|
||||
nodes/output/position = Vector2( 780, 160 )
|
||||
nodes/walk/node = SubResource( 20 )
|
||||
nodes/walk/position = Vector2( 220, 140 )
|
||||
node_connections = [ "output", 0, "TimeScale", "TimeScale", 0, "walk" ]
|
||||
|
||||
[sub_resource type="AnimationNodeAnimation" id=22]
|
||||
animation = "strafe-right-loop"
|
||||
|
||||
[sub_resource type="AnimationNodeTimeScale" id=23]
|
||||
|
||||
[sub_resource type="AnimationNodeBlendTree" id=24]
|
||||
nodes/Animation/node = SubResource( 22 )
|
||||
nodes/Animation/position = Vector2( 340, 140 )
|
||||
nodes/TimeScale/node = SubResource( 23 )
|
||||
nodes/TimeScale/position = Vector2( 580, 140 )
|
||||
nodes/output/position = Vector2( 780, 160 )
|
||||
node_connections = [ "output", 0, "TimeScale", "TimeScale", 0, "Animation" ]
|
||||
|
||||
[sub_resource type="AnimationNodeAnimation" id=25]
|
||||
animation = "strafe-left-loop"
|
||||
|
||||
[sub_resource type="AnimationNodeTimeScale" id=26]
|
||||
|
||||
[sub_resource type="AnimationNodeBlendTree" id=27]
|
||||
nodes/Animation/node = SubResource( 25 )
|
||||
nodes/Animation/position = Vector2( 200, 140 )
|
||||
nodes/TimeScale/node = SubResource( 26 )
|
||||
nodes/TimeScale/position = Vector2( 580, 140 )
|
||||
nodes/output/position = Vector2( 920, 160 )
|
||||
node_connections = [ "output", 0, "TimeScale", "TimeScale", 0, "Animation" ]
|
||||
|
||||
[sub_resource type="AnimationNodeBlendSpace2D" id=28]
|
||||
blend_point_0/node = SubResource( 10 )
|
||||
blend_point_0/pos = Vector2( 0, 0 )
|
||||
blend_point_1/node = SubResource( 21 )
|
||||
blend_point_1/pos = Vector2( 0.1, 0 )
|
||||
blend_point_2/node = SubResource( 24 )
|
||||
blend_point_2/pos = Vector2( 0, 1 )
|
||||
blend_point_3/node = SubResource( 27 )
|
||||
blend_point_3/pos = Vector2( 0, -1 )
|
||||
|
||||
[sub_resource type="AnimationNodeBlendTree" id=29]
|
||||
graph_offset = Vector2( -453, -150 )
|
||||
nodes/loc/node = SubResource( 28 )
|
||||
nodes/loc/position = Vector2( 180, -20 )
|
||||
nodes/output/position = Vector2( 580, 120 )
|
||||
node_connections = [ "output", 0, "loc" ]
|
||||
|
||||
[sub_resource type="AnimationNodeAnimation" id=30]
|
||||
animation = "car-passenger-loop"
|
||||
|
||||
[sub_resource type="AnimationNodeTimeScale" id=31]
|
||||
|
||||
[sub_resource type="AnimationNodeBlendTree" id=32]
|
||||
nodes/Animation/node = SubResource( 30 )
|
||||
nodes/Animation/position = Vector2( 300, 80 )
|
||||
nodes/TimeScale/node = SubResource( 31 )
|
||||
nodes/TimeScale/position = Vector2( 560, 80 )
|
||||
nodes/output/position = Vector2( 800, 80 )
|
||||
node_connections = [ "output", 0, "TimeScale", "TimeScale", 0, "Animation" ]
|
||||
|
||||
[sub_resource type="AnimationNodeAnimation" id=33]
|
||||
animation = "dagger-sacrifice-counter-a"
|
||||
|
||||
[sub_resource type="AnimationNodeTimeScale" id=34]
|
||||
|
||||
[sub_resource type="AnimationNodeTimeSeek" id=35]
|
||||
|
||||
[sub_resource type="AnimationNodeBlendTree" id=36]
|
||||
graph_offset = Vector2( 0, -262 )
|
||||
nodes/Animation/node = SubResource( 33 )
|
||||
nodes/Animation/position = Vector2( 520, 180 )
|
||||
nodes/TimeScale/node = SubResource( 34 )
|
||||
nodes/TimeScale/position = Vector2( 980, 200 )
|
||||
nodes/output/position = Vector2( 1480, 180 )
|
||||
nodes/seek/node = SubResource( 35 )
|
||||
nodes/seek/position = Vector2( 920, -20 )
|
||||
node_connections = [ "seek", 0, "Animation", "output", 0, "TimeScale", "TimeScale", 0, "seek" ]
|
||||
|
||||
[sub_resource type="AnimationNodeStateMachineTransition" id=37]
|
||||
|
||||
[sub_resource type="AnimationNodeStateMachineTransition" id=38]
|
||||
|
||||
[sub_resource type="AnimationNodeStateMachineTransition" id=39]
|
||||
|
||||
[sub_resource type="AnimationNodeStateMachineTransition" id=40]
|
||||
|
||||
[sub_resource type="AnimationNodeStateMachineTransition" id=41]
|
||||
|
||||
[sub_resource type="AnimationNodeStateMachineTransition" id=42]
|
||||
|
||||
[sub_resource type="AnimationNodeStateMachine" id=43]
|
||||
states/drive/node = SubResource( 7 )
|
||||
states/drive/position = Vector2( 231, 282 )
|
||||
states/locomotion/node = SubResource( 29 )
|
||||
states/locomotion/position = Vector2( 231, 174 )
|
||||
states/passenger/node = SubResource( 32 )
|
||||
states/passenger/position = Vector2( 452.444, 220 )
|
||||
states/sacrificed-a/node = SubResource( 36 )
|
||||
states/sacrificed-a/position = Vector2( 628.444, 464 )
|
||||
transitions = [ "locomotion", "drive", SubResource( 37 ), "drive", "locomotion", SubResource( 38 ), "locomotion", "passenger", SubResource( 39 ), "passenger", "locomotion", SubResource( 40 ), "drive", "passenger", SubResource( 41 ), "passenger", "drive", SubResource( 42 ) ]
|
||||
start_node = "locomotion"
|
||||
graph_offset = Vector2( -471.556, 74 )
|
||||
|
||||
[resource]
|
||||
graph_offset = Vector2( -631.583, -146.25 )
|
||||
nodes/Animation/node = SubResource( 2 )
|
||||
nodes/Animation/position = Vector2( -200, 260 )
|
||||
"nodes/Animation 2/node" = SubResource( 1 )
|
||||
"nodes/Animation 2/position" = Vector2( -280, 400 )
|
||||
nodes/blade_left/node = SubResource( 3 )
|
||||
nodes/blade_left/position = Vector2( 220, 180 )
|
||||
nodes/blade_right/node = SubResource( 4 )
|
||||
nodes/blade_right/position = Vector2( 680, 320 )
|
||||
nodes/output/position = Vector2( 1040, 120 )
|
||||
nodes/state/node = SubResource( 43 )
|
||||
nodes/state/position = Vector2( -179, 86 )
|
||||
node_connections = [ "output", 0, "blade_right", "blade_left", 0, "state", "blade_left", 1, "Animation", "blade_right", 0, "blade_left", "blade_right", 1, "Animation 2" ]
|
||||
531
characters/vroid1-man.tscn
Normal file
531
characters/vroid1-man.tscn
Normal file
@@ -0,0 +1,531 @@
|
||||
[gd_scene load_steps=95 format=2]
|
||||
|
||||
[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/face/male-face.tscn" type="PackedScene" id=3]
|
||||
|
||||
[sub_resource type="AnimationNodeAnimation" id=1]
|
||||
animation = "blend-blade-right"
|
||||
|
||||
[sub_resource type="AnimationNodeAnimation" id=2]
|
||||
animation = "blend-blade-left"
|
||||
|
||||
[sub_resource type="AnimationNodeBlend2" id=3]
|
||||
filter_enabled = true
|
||||
filters = [ "Skeleton:j_bip_l_hand", "Skeleton:j_bip_l_index_1", "Skeleton:j_bip_l_index_2", "Skeleton:j_bip_l_index_3", "Skeleton:j_bip_l_little_1", "Skeleton:j_bip_l_little_2", "Skeleton:j_bip_l_little_3", "Skeleton:j_bip_l_middle_1", "Skeleton:j_bip_l_middle_2", "Skeleton:j_bip_l_middle_3", "Skeleton:j_bip_l_ring_1", "Skeleton:j_bip_l_ring_2", "Skeleton:j_bip_l_ring_3", "Skeleton:j_bip_l_thumb_1", "Skeleton:j_bip_l_thumb_2", "Skeleton:j_bip_l_thumb_3" ]
|
||||
|
||||
[sub_resource type="AnimationNodeBlend2" id=4]
|
||||
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" ]
|
||||
|
||||
[sub_resource type="AnimationNodeAnimation" id=5]
|
||||
animation = "cliimb1"
|
||||
|
||||
[sub_resource type="AnimationNodeTimeScale" id=6]
|
||||
|
||||
[sub_resource type="AnimationNodeBlendTree" id=7]
|
||||
nodes/Animation/node = SubResource( 5 )
|
||||
nodes/Animation/position = Vector2( 480, 260 )
|
||||
nodes/TimeScale/node = SubResource( 6 )
|
||||
nodes/TimeScale/position = Vector2( 800, 260 )
|
||||
nodes/output/position = Vector2( 1140, 180 )
|
||||
node_connections = [ "output", 0, "TimeScale", "TimeScale", 0, "Animation" ]
|
||||
|
||||
[sub_resource type="AnimationNodeAnimation" id=8]
|
||||
animation = "cliimb1a"
|
||||
|
||||
[sub_resource type="AnimationNodeTimeScale" id=9]
|
||||
|
||||
[sub_resource type="AnimationNodeBlendTree" id=10]
|
||||
nodes/Animation/node = SubResource( 8 )
|
||||
nodes/Animation/position = Vector2( 470, 267 )
|
||||
nodes/TimeScale/node = SubResource( 9 )
|
||||
nodes/TimeScale/position = Vector2( 812, 292 )
|
||||
nodes/output/position = Vector2( 1120, 220 )
|
||||
node_connections = [ "output", 0, "TimeScale", "TimeScale", 0, "Animation" ]
|
||||
|
||||
[sub_resource type="AnimationNodeAnimation" id=11]
|
||||
animation = "drive-loop"
|
||||
|
||||
[sub_resource type="AnimationNodeTimeScale" id=12]
|
||||
|
||||
[sub_resource type="AnimationNodeBlendTree" id=13]
|
||||
nodes/Animation/node = SubResource( 11 )
|
||||
nodes/Animation/position = Vector2( 276, 122 )
|
||||
nodes/TimeScale/node = SubResource( 12 )
|
||||
nodes/TimeScale/position = Vector2( 520, 120 )
|
||||
nodes/output/position = Vector2( 740, 140 )
|
||||
node_connections = [ "output", 0, "TimeScale", "TimeScale", 0, "Animation" ]
|
||||
|
||||
[sub_resource type="AnimationNodeAnimation" id=14]
|
||||
animation = "start-grab"
|
||||
|
||||
[sub_resource type="AnimationNodeTimeScale" id=15]
|
||||
|
||||
[sub_resource type="AnimationNodeBlendTree" id=16]
|
||||
nodes/Animation/node = SubResource( 14 )
|
||||
nodes/Animation/position = Vector2( 573, 137 )
|
||||
nodes/TimeScale/node = SubResource( 15 )
|
||||
nodes/TimeScale/position = Vector2( 820, 100 )
|
||||
nodes/output/position = Vector2( 1160, 140 )
|
||||
node_connections = [ "output", 0, "TimeScale", "TimeScale", 0, "Animation" ]
|
||||
|
||||
[sub_resource type="AnimationNodeAnimation" id=17]
|
||||
animation = "stand1-loop"
|
||||
|
||||
[sub_resource type="AnimationNodeTimeScale" id=18]
|
||||
|
||||
[sub_resource type="AnimationNodeBlendTree" id=19]
|
||||
nodes/Animation/node = SubResource( 17 )
|
||||
nodes/Animation/position = Vector2( 320, 140 )
|
||||
nodes/TimeScale/node = SubResource( 18 )
|
||||
nodes/TimeScale/position = Vector2( 580, 140 )
|
||||
nodes/output/position = Vector2( 780, 160 )
|
||||
node_connections = [ "output", 0, "TimeScale", "TimeScale", 0, "Animation" ]
|
||||
|
||||
[sub_resource type="AnimationNodeAnimation" id=141]
|
||||
animation = "male-mx-run-loop"
|
||||
|
||||
[sub_resource type="AnimationNodeTimeScale" id=20]
|
||||
|
||||
[sub_resource type="AnimationNodeBlendTree" id=30]
|
||||
graph_offset = Vector2( 0, 116 )
|
||||
nodes/Animation/node = SubResource( 141 )
|
||||
nodes/Animation/position = Vector2( 287, 281 )
|
||||
nodes/TimeScale/node = SubResource( 20 )
|
||||
nodes/TimeScale/position = Vector2( 520, 140 )
|
||||
nodes/output/position = Vector2( 780, 160 )
|
||||
node_connections = [ "output", 0, "TimeScale", "TimeScale", 0, "Animation" ]
|
||||
|
||||
[sub_resource type="AnimationNodeAnimation" id=31]
|
||||
animation = "strafe-right-loop"
|
||||
|
||||
[sub_resource type="AnimationNodeTimeScale" id=32]
|
||||
|
||||
[sub_resource type="AnimationNodeBlendTree" id=33]
|
||||
nodes/Animation/node = SubResource( 31 )
|
||||
nodes/Animation/position = Vector2( 340, 140 )
|
||||
nodes/TimeScale/node = SubResource( 32 )
|
||||
nodes/TimeScale/position = Vector2( 580, 140 )
|
||||
nodes/output/position = Vector2( 780, 160 )
|
||||
node_connections = [ "output", 0, "TimeScale", "TimeScale", 0, "Animation" ]
|
||||
|
||||
[sub_resource type="AnimationNodeAnimation" id=34]
|
||||
animation = "strafe-left-loop"
|
||||
|
||||
[sub_resource type="AnimationNodeTimeScale" id=35]
|
||||
|
||||
[sub_resource type="AnimationNodeBlendTree" id=36]
|
||||
nodes/Animation/node = SubResource( 34 )
|
||||
nodes/Animation/position = Vector2( 200, 140 )
|
||||
nodes/TimeScale/node = SubResource( 35 )
|
||||
nodes/TimeScale/position = Vector2( 580, 140 )
|
||||
nodes/output/position = Vector2( 920, 160 )
|
||||
node_connections = [ "output", 0, "TimeScale", "TimeScale", 0, "Animation" ]
|
||||
|
||||
[sub_resource type="AnimationNodeAnimation" id=140]
|
||||
animation = "male-mx-walk-loop"
|
||||
|
||||
[sub_resource type="AnimationNodeTimeScale" id=37]
|
||||
|
||||
[sub_resource type="AnimationNodeBlendTree" id=39]
|
||||
nodes/Animation/node = SubResource( 140 )
|
||||
nodes/Animation/position = Vector2( 513, 239 )
|
||||
nodes/TimeScale/node = SubResource( 37 )
|
||||
nodes/TimeScale/position = Vector2( 940, 220 )
|
||||
nodes/output/position = Vector2( 1220, 120 )
|
||||
node_connections = [ "output", 0, "TimeScale", "TimeScale", 0, "Animation" ]
|
||||
|
||||
[sub_resource type="AnimationNodeBlendSpace2D" id=40]
|
||||
blend_point_0/node = SubResource( 19 )
|
||||
blend_point_0/pos = Vector2( 0, 0 )
|
||||
blend_point_1/node = SubResource( 30 )
|
||||
blend_point_1/pos = Vector2( 0.9, 0 )
|
||||
blend_point_2/node = SubResource( 33 )
|
||||
blend_point_2/pos = Vector2( 0, 1 )
|
||||
blend_point_3/node = SubResource( 36 )
|
||||
blend_point_3/pos = Vector2( 0, -1 )
|
||||
blend_point_4/node = SubResource( 39 )
|
||||
blend_point_4/pos = Vector2( 0.1, 0 )
|
||||
blend_mode = 1
|
||||
|
||||
[sub_resource type="AnimationNodeBlendTree" id=41]
|
||||
graph_offset = Vector2( -453, -230.5 )
|
||||
nodes/loc/node = SubResource( 40 )
|
||||
nodes/loc/position = Vector2( 180, -20 )
|
||||
nodes/output/position = Vector2( 580, 120 )
|
||||
node_connections = [ "output", 0, "loc" ]
|
||||
|
||||
[sub_resource type="AnimationNodeAnimation" id=42]
|
||||
animation = "car-passenger-loop"
|
||||
|
||||
[sub_resource type="AnimationNodeTimeScale" id=43]
|
||||
|
||||
[sub_resource type="AnimationNodeBlendTree" id=44]
|
||||
nodes/Animation/node = SubResource( 42 )
|
||||
nodes/Animation/position = Vector2( 300, 80 )
|
||||
nodes/TimeScale/node = SubResource( 43 )
|
||||
nodes/TimeScale/position = Vector2( 560, 80 )
|
||||
nodes/output/position = Vector2( 800, 80 )
|
||||
node_connections = [ "output", 0, "TimeScale", "TimeScale", 0, "Animation" ]
|
||||
|
||||
[sub_resource type="AnimationNodeAnimation" id=45]
|
||||
animation = "dagger-sacrifice-counter-a"
|
||||
|
||||
[sub_resource type="AnimationNodeTimeScale" id=46]
|
||||
|
||||
[sub_resource type="AnimationNodeTimeSeek" id=47]
|
||||
|
||||
[sub_resource type="AnimationNodeBlendTree" id=48]
|
||||
graph_offset = Vector2( 0, -262 )
|
||||
nodes/Animation/node = SubResource( 45 )
|
||||
nodes/Animation/position = Vector2( 520, 180 )
|
||||
nodes/TimeScale/node = SubResource( 46 )
|
||||
nodes/TimeScale/position = Vector2( 980, 200 )
|
||||
nodes/output/position = Vector2( 1480, 180 )
|
||||
nodes/seek/node = SubResource( 47 )
|
||||
nodes/seek/position = Vector2( 920, -20 )
|
||||
node_connections = [ "seek", 0, "Animation", "output", 0, "TimeScale", "TimeScale", 0, "seek" ]
|
||||
|
||||
[sub_resource type="AnimationNodeAnimation" id=49]
|
||||
animation = "sleeping1-loop"
|
||||
|
||||
[sub_resource type="AnimationNodeTimeScale" id=50]
|
||||
|
||||
[sub_resource type="AnimationNodeBlendTree" id=51]
|
||||
nodes/Animation/node = SubResource( 49 )
|
||||
nodes/Animation/position = Vector2( 220, 320 )
|
||||
nodes/TimeScale/node = SubResource( 50 )
|
||||
nodes/TimeScale/position = Vector2( 623, 370 )
|
||||
nodes/output/position = Vector2( 920, 180 )
|
||||
node_connections = [ "output", 0, "TimeScale", "TimeScale", 0, "Animation" ]
|
||||
|
||||
[sub_resource type="AnimationNodeAnimation" id=107]
|
||||
animation = "start-walking"
|
||||
|
||||
[sub_resource type="AnimationNodeTimeScale" id=108]
|
||||
|
||||
[sub_resource type="AnimationNodeBlendTree" id=102]
|
||||
nodes/Animation/node = SubResource( 107 )
|
||||
nodes/Animation/position = Vector2( 320, 260 )
|
||||
nodes/TimeScale/node = SubResource( 108 )
|
||||
nodes/TimeScale/position = Vector2( 580, 260 )
|
||||
nodes/output/position = Vector2( 920, 280 )
|
||||
node_connections = [ "output", 0, "TimeScale", "TimeScale", 0, "Animation" ]
|
||||
|
||||
[sub_resource type="AnimationNodeAnimation" id=105]
|
||||
animation = "stop-walking"
|
||||
|
||||
[sub_resource type="AnimationNodeTimeScale" id=106]
|
||||
|
||||
[sub_resource type="AnimationNodeBlendTree" id=99]
|
||||
nodes/Animation/node = SubResource( 105 )
|
||||
nodes/Animation/position = Vector2( 240, 140 )
|
||||
nodes/TimeScale/node = SubResource( 106 )
|
||||
nodes/TimeScale/position = Vector2( 500, 140 )
|
||||
nodes/output/position = Vector2( 800, 160 )
|
||||
node_connections = [ "output", 0, "TimeScale", "TimeScale", 0, "Animation" ]
|
||||
|
||||
[sub_resource type="AnimationNodeAnimation" id=117]
|
||||
animation = "turn-left"
|
||||
|
||||
[sub_resource type="AnimationNodeAnimation" id=115]
|
||||
animation = "turn-left"
|
||||
|
||||
[sub_resource type="AnimationNodeTimeScale" id=121]
|
||||
|
||||
[sub_resource type="AnimationNodeTransition" id=118]
|
||||
input_count = 2
|
||||
xfade_time = 0.3
|
||||
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=109]
|
||||
nodes/Animation/node = SubResource( 115 )
|
||||
nodes/Animation/position = Vector2( 160, 260 )
|
||||
"nodes/Animation 2/node" = SubResource( 117 )
|
||||
"nodes/Animation 2/position" = Vector2( 160, 400 )
|
||||
nodes/TimeScale/node = SubResource( 121 )
|
||||
nodes/TimeScale/position = Vector2( 780, 260 )
|
||||
nodes/Transition/node = SubResource( 118 )
|
||||
nodes/Transition/position = Vector2( 500, 280 )
|
||||
nodes/output/position = Vector2( 1000, 260 )
|
||||
node_connections = [ "output", 0, "TimeScale", "TimeScale", 0, "Transition", "Transition", 0, "Animation", "Transition", 1, "Animation 2" ]
|
||||
|
||||
[sub_resource type="AnimationNodeAnimation" id=119]
|
||||
animation = "turn-right"
|
||||
|
||||
[sub_resource type="AnimationNodeAnimation" id=116]
|
||||
animation = "turn-right"
|
||||
|
||||
[sub_resource type="AnimationNodeTimeScale" id=122]
|
||||
|
||||
[sub_resource type="AnimationNodeTransition" id=120]
|
||||
input_count = 2
|
||||
xfade_time = 0.3
|
||||
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=110]
|
||||
nodes/Animation/node = SubResource( 116 )
|
||||
nodes/Animation/position = Vector2( 238, 295 )
|
||||
"nodes/Animation 2/node" = SubResource( 119 )
|
||||
"nodes/Animation 2/position" = Vector2( 220, 440 )
|
||||
nodes/TimeScale/node = SubResource( 122 )
|
||||
nodes/TimeScale/position = Vector2( 840, 260 )
|
||||
nodes/Transition/node = SubResource( 120 )
|
||||
nodes/Transition/position = Vector2( 560, 260 )
|
||||
nodes/output/position = Vector2( 1060, 260 )
|
||||
node_connections = [ "output", 0, "TimeScale", "TimeScale", 0, "Transition", "Transition", 0, "Animation", "Transition", 1, "Animation 2" ]
|
||||
|
||||
[sub_resource type="AnimationNodeAnimation" id=123]
|
||||
animation = "dagger-sacrifice-counter-a"
|
||||
|
||||
[sub_resource type="AnimationNodeAnimation" id=52]
|
||||
animation = "dagger-sacrifice-counter-a"
|
||||
|
||||
[sub_resource type="AnimationNodeTimeScale" id=124]
|
||||
|
||||
[sub_resource type="AnimationNodeTimeScale" id=53]
|
||||
|
||||
[sub_resource type="AnimationNodeTransition" id=125]
|
||||
input_count = 2
|
||||
xfade_time = 0.1
|
||||
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=54]
|
||||
nodes/Animation/node = SubResource( 52 )
|
||||
nodes/Animation/position = Vector2( 196, 150 )
|
||||
"nodes/Animation 2/node" = SubResource( 123 )
|
||||
"nodes/Animation 2/position" = Vector2( 240, 320 )
|
||||
nodes/TimeScale/node = SubResource( 53 )
|
||||
nodes/TimeScale/position = Vector2( 700, 140 )
|
||||
"nodes/TimeScale 2/node" = SubResource( 124 )
|
||||
"nodes/TimeScale 2/position" = Vector2( 680, 300 )
|
||||
nodes/Transition/node = SubResource( 125 )
|
||||
nodes/Transition/position = Vector2( 940, 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" ]
|
||||
|
||||
[sub_resource type="AnimationNodeStateMachineTransition" id=55]
|
||||
|
||||
[sub_resource type="AnimationNodeStateMachineTransition" id=56]
|
||||
|
||||
[sub_resource type="AnimationNodeStateMachineTransition" id=57]
|
||||
|
||||
[sub_resource type="AnimationNodeStateMachineTransition" id=58]
|
||||
|
||||
[sub_resource type="AnimationNodeStateMachineTransition" id=59]
|
||||
|
||||
[sub_resource type="AnimationNodeStateMachineTransition" id=60]
|
||||
|
||||
[sub_resource type="AnimationNodeStateMachineTransition" id=61]
|
||||
|
||||
[sub_resource type="AnimationNodeStateMachineTransition" id=62]
|
||||
|
||||
[sub_resource type="AnimationNodeStateMachineTransition" id=63]
|
||||
|
||||
[sub_resource type="AnimationNodeStateMachineTransition" id=64]
|
||||
|
||||
[sub_resource type="AnimationNodeStateMachineTransition" id=65]
|
||||
switch_mode = 2
|
||||
auto_advance = true
|
||||
|
||||
[sub_resource type="AnimationNodeStateMachineTransition" id=66]
|
||||
|
||||
[sub_resource type="AnimationNodeStateMachineTransition" id=67]
|
||||
switch_mode = 2
|
||||
auto_advance = true
|
||||
|
||||
[sub_resource type="AnimationNodeStateMachineTransition" id=68]
|
||||
|
||||
[sub_resource type="AnimationNodeStateMachineTransition" id=69]
|
||||
switch_mode = 2
|
||||
|
||||
[sub_resource type="AnimationNodeStateMachineTransition" id=100]
|
||||
xfade_time = 0.1
|
||||
|
||||
[sub_resource type="AnimationNodeStateMachineTransition" id=101]
|
||||
switch_mode = 2
|
||||
auto_advance = true
|
||||
|
||||
[sub_resource type="AnimationNodeStateMachineTransition" id=103]
|
||||
xfade_time = 0.2
|
||||
|
||||
[sub_resource type="AnimationNodeStateMachineTransition" id=104]
|
||||
switch_mode = 2
|
||||
auto_advance = true
|
||||
|
||||
[sub_resource type="AnimationNodeStateMachineTransition" id=111]
|
||||
|
||||
[sub_resource type="AnimationNodeStateMachineTransition" id=112]
|
||||
switch_mode = 2
|
||||
xfade_time = 0.5
|
||||
|
||||
[sub_resource type="AnimationNodeStateMachineTransition" id=113]
|
||||
|
||||
[sub_resource type="AnimationNodeStateMachineTransition" id=114]
|
||||
switch_mode = 2
|
||||
xfade_time = 0.5
|
||||
|
||||
[sub_resource type="AnimationNodeStateMachine" id=70]
|
||||
states/climb1/node = SubResource( 7 )
|
||||
states/climb1/position = Vector2( 359.444, 656 )
|
||||
states/climb1a/node = SubResource( 10 )
|
||||
states/climb1a/position = Vector2( 659.444, 154 )
|
||||
states/drive/node = SubResource( 13 )
|
||||
states/drive/position = Vector2( 289, 430 )
|
||||
states/grab/node = SubResource( 16 )
|
||||
states/grab/position = Vector2( 739.444, 243 )
|
||||
states/locomotion/node = SubResource( 41 )
|
||||
states/locomotion/position = Vector2( 231, 174 )
|
||||
states/passenger/node = SubResource( 44 )
|
||||
states/passenger/position = Vector2( 555.444, 339 )
|
||||
states/sacrificed-a/node = SubResource( 48 )
|
||||
states/sacrificed-a/position = Vector2( 628.444, 464 )
|
||||
states/sleeping/node = SubResource( 51 )
|
||||
states/sleeping/position = Vector2( -112.556, 339 )
|
||||
states/start_walking/node = SubResource( 102 )
|
||||
states/start_walking/position = Vector2( -75.556, 574 )
|
||||
states/stop_walking/node = SubResource( 99 )
|
||||
states/stop_walking/position = Vector2( -131.556, 455 )
|
||||
states/turn_left/node = SubResource( 109 )
|
||||
states/turn_left/position = Vector2( -37.556, 676 )
|
||||
states/turn_right/node = SubResource( 110 )
|
||||
states/turn_right/position = Vector2( 177.444, 671 )
|
||||
states/use_tap/node = SubResource( 54 )
|
||||
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 ) ]
|
||||
start_node = "locomotion"
|
||||
graph_offset = Vector2( -470.556, -68 )
|
||||
|
||||
[sub_resource type="AnimationNodeBlendTree" id=71]
|
||||
graph_offset = Vector2( -499.98, 0 )
|
||||
nodes/Animation/node = SubResource( 2 )
|
||||
nodes/Animation/position = Vector2( -200, 260 )
|
||||
"nodes/Animation 2/node" = SubResource( 1 )
|
||||
"nodes/Animation 2/position" = Vector2( -280, 400 )
|
||||
nodes/blade_left/node = SubResource( 3 )
|
||||
nodes/blade_left/position = Vector2( 220, 180 )
|
||||
nodes/blade_right/node = SubResource( 4 )
|
||||
nodes/blade_right/position = Vector2( 680, 320 )
|
||||
nodes/output/position = Vector2( 1040, 120 )
|
||||
nodes/state/node = SubResource( 70 )
|
||||
nodes/state/position = Vector2( -179, 86 )
|
||||
node_connections = [ "output", 0, "blade_right", "blade_left", 0, "state", "blade_left", 1, "Animation", "blade_right", 0, "blade_left", "blade_right", 1, "Animation 2" ]
|
||||
|
||||
[sub_resource type="AnimationNodeStateMachinePlayback" id=72]
|
||||
|
||||
[node name="vroid1-man" instance=ExtResource( 1 )]
|
||||
|
||||
[node name="Skeleton" parent="." index="0"]
|
||||
bones/1/bound_children = [ NodePath("hips") ]
|
||||
bones/75/bound_children = [ NodePath("neck") ]
|
||||
bones/76/bound_children = [ NodePath("head") ]
|
||||
bones/80/bound_children = [ NodePath("penis_2") ]
|
||||
bones/94/bound_children = [ NodePath("wrist_r") ]
|
||||
bones/96/bound_children = [ NodePath("wrist_l") ]
|
||||
|
||||
[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 )
|
||||
bone_name = "wrist_ik_r"
|
||||
|
||||
[node name="marker_wrist_r_grab" type="Position3D" parent="Skeleton/wrist_r" index="0"]
|
||||
transform = Transform( 1, 2.23517e-08, 3.72529e-08, -2.6077e-08, 1, 1.13389e-07, -2.23517e-08, -1.32015e-07, 1, -0.0240285, 0.0591205, -0.0170733 )
|
||||
visible = false
|
||||
|
||||
[node name="weapon_right" type="Spatial" parent="Skeleton/wrist_r" index="1"]
|
||||
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"]
|
||||
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 )
|
||||
bone_name = "wrist_ik_l"
|
||||
|
||||
[node name="marker_wrist_l_grab" type="Position3D" parent="Skeleton/wrist_l" index="0"]
|
||||
transform = Transform( 1, -5.96046e-08, 1.19209e-07, -2.98023e-08, 1, 7.45058e-09, -9.68575e-08, 1.00583e-07, 1, -0.0303702, 0.0625808, -0.0433671 )
|
||||
visible = false
|
||||
|
||||
[node name="weapon_left" type="Spatial" parent="Skeleton/wrist_l" index="1"]
|
||||
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"]
|
||||
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 )
|
||||
bone_name = "J_Bip_C_Head"
|
||||
|
||||
[node name="marker_talk" type="Position3D" parent="Skeleton/head" index="0"]
|
||||
transform = Transform( 0.991494, 0.0477842, -0.121069, -0.0472599, 0.998856, 0.0071997, 0.121275, -0.00141716, 0.992618, 0.00322284, 0.224896, -0.137154 )
|
||||
visible = false
|
||||
|
||||
[node name="hair" type="Spatial" parent="Skeleton/head" index="1"]
|
||||
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0.011 )
|
||||
|
||||
[node name="male-hair1" parent="Skeleton/head/hair" index="0" instance=ExtResource( 2 )]
|
||||
|
||||
[node name="face" type="Spatial" parent="Skeleton/head" index="2"]
|
||||
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="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 )
|
||||
bone_name = "J_Bip_C_Hips"
|
||||
|
||||
[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 )
|
||||
visible = false
|
||||
|
||||
[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 )
|
||||
bone_name = "J_Bip_C_Neck"
|
||||
|
||||
[node name="marker_neck_grab" type="Position3D" parent="Skeleton/neck" index="0"]
|
||||
transform = Transform( 0.998758, -0.00781338, 0.0492147, 0.00787775, 0.999969, -0.001113, -0.0492044, 0.0014993, 0.998788, -0.00122673, 0.0275304, -0.0923626 )
|
||||
visible = false
|
||||
|
||||
[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 )
|
||||
bone_name = "penis2"
|
||||
|
||||
[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 )
|
||||
visible = false
|
||||
|
||||
[node name="AnimationTree" type="AnimationTree" parent="." index="2"]
|
||||
tree_root = SubResource( 71 )
|
||||
anim_player = NodePath("../AnimationPlayer")
|
||||
active = true
|
||||
process_mode = 0
|
||||
root_motion_track = NodePath("Skeleton:Root")
|
||||
parameters/blade_left/blend_amount = 0.0
|
||||
parameters/blade_right/blend_amount = 0.0
|
||||
parameters/state/playback = SubResource( 72 )
|
||||
parameters/state/climb1/TimeScale/scale = 2.0
|
||||
parameters/state/climb1a/TimeScale/scale = 2.0
|
||||
parameters/state/drive/TimeScale/scale = 1.0
|
||||
parameters/state/grab/TimeScale/scale = 1.0
|
||||
parameters/state/locomotion/loc/blend_position = Vector2( -0.00293946, -0.0151844 )
|
||||
parameters/state/locomotion/loc/0/TimeScale/scale = 1.0
|
||||
parameters/state/locomotion/loc/1/TimeScale/scale = 2.0
|
||||
parameters/state/locomotion/loc/2/TimeScale/scale = 2.0
|
||||
parameters/state/locomotion/loc/3/TimeScale/scale = 1.0
|
||||
parameters/state/locomotion/loc/4/TimeScale/scale = 1.0
|
||||
parameters/state/passenger/TimeScale/scale = 1.0
|
||||
parameters/state/sacrificed-a/TimeScale/scale = 1.0
|
||||
parameters/state/sacrificed-a/seek/seek_position = 1.0
|
||||
parameters/state/sleeping/TimeScale/scale = 1.0
|
||||
parameters/state/start_walking/TimeScale/scale = 2.0
|
||||
parameters/state/stop_walking/TimeScale/scale = 2.0
|
||||
parameters/state/turn_left/TimeScale/scale = 2.0
|
||||
parameters/state/turn_left/Transition/current = 0
|
||||
parameters/state/turn_right/TimeScale/scale = 1.0
|
||||
parameters/state/turn_right/Transition/current = 0
|
||||
parameters/state/use_tap/TimeScale/scale = 1.0
|
||||
"parameters/state/use_tap/TimeScale 2/scale" = 1.0
|
||||
parameters/state/use_tap/Transition/current = 1
|
||||
4
cleanup.sh
Normal file
4
cleanup.sh
Normal file
@@ -0,0 +1,4 @@
|
||||
#!/bin/sh
|
||||
rm -Rf .import
|
||||
find . -type f -name '*.mesh' -exec rm '{}' ';'
|
||||
|
||||
24
export_presets.cfg
Normal file
24
export_presets.cfg
Normal file
@@ -0,0 +1,24 @@
|
||||
[preset.0]
|
||||
|
||||
name="linux"
|
||||
platform="Linux/X11"
|
||||
runnable=true
|
||||
custom_features=""
|
||||
export_filter="all_resources"
|
||||
include_filter="*.json,*.txt"
|
||||
exclude_filter=""
|
||||
export_path="export/ac2.x86_64"
|
||||
script_export_mode=1
|
||||
script_encryption_key=""
|
||||
|
||||
[preset.0.options]
|
||||
|
||||
custom_template/debug="/home/slapin/godot-projects/small-game/src/godot/bin/godot.x11.opt.tools.64"
|
||||
custom_template/release="/home/slapin/godot-projects/small-game/src/godot/bin/godot.x11.opt.64"
|
||||
binary_format/64_bits=true
|
||||
binary_format/embed_pck=true
|
||||
texture_format/bptc=true
|
||||
texture_format/s3tc=true
|
||||
texture_format/etc=true
|
||||
texture_format/etc2=true
|
||||
texture_format/no_bptc_fallbacks=true
|
||||
BIN
objects/Material.material
Normal file
BIN
objects/Material.material
Normal file
Binary file not shown.
21
objects/foundation.tscn
Normal file
21
objects/foundation.tscn
Normal file
@@ -0,0 +1,21 @@
|
||||
[gd_scene load_steps=4 format=2]
|
||||
|
||||
[sub_resource type="SpatialMaterial" id=2]
|
||||
|
||||
[sub_resource type="CubeMesh" id=1]
|
||||
material = SubResource( 2 )
|
||||
|
||||
[sub_resource type="ConcavePolygonShape" id=3]
|
||||
data = PoolVector3Array( -1, 1, 1, 1, 1, 1, -1, -1, 1, 1, 1, 1, 1, -1, 1, -1, -1, 1, 1, 1, -1, -1, 1, -1, 1, -1, -1, -1, 1, -1, -1, -1, -1, 1, -1, -1, 1, 1, 1, 1, 1, -1, 1, -1, 1, 1, 1, -1, 1, -1, -1, 1, -1, 1, -1, 1, -1, -1, 1, 1, -1, -1, -1, -1, 1, 1, -1, -1, 1, -1, -1, -1, 1, 1, 1, -1, 1, 1, 1, 1, -1, -1, 1, 1, -1, 1, -1, 1, 1, -1, -1, -1, 1, 1, -1, 1, -1, -1, -1, 1, -1, 1, 1, -1, -1, -1, -1, -1 )
|
||||
|
||||
[node name="foundation" type="Spatial"]
|
||||
|
||||
[node name="MeshInstance" type="MeshInstance" parent="."]
|
||||
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0 )
|
||||
mesh = SubResource( 1 )
|
||||
material/0 = null
|
||||
|
||||
[node name="StaticBody" type="StaticBody" parent="MeshInstance"]
|
||||
|
||||
[node name="CollisionShape" type="CollisionShape" parent="MeshInstance/StaticBody"]
|
||||
shape = SubResource( 3 )
|
||||
15
objects/house.gd
Normal file
15
objects/house.gd
Normal file
@@ -0,0 +1,15 @@
|
||||
extends Spatial
|
||||
|
||||
|
||||
# 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():
|
||||
for g in get_children():
|
||||
if g.name.begins_with("spawn"):
|
||||
g.add_to_group("spawn")
|
||||
$spawn_npc1.add_to_group("keep")
|
||||
|
||||
BIN
objects/palace.bin
Normal file
BIN
objects/palace.bin
Normal file
Binary file not shown.
123
objects/palace.gd
Normal file
123
objects/palace.gd
Normal file
@@ -0,0 +1,123 @@
|
||||
extends Spatial
|
||||
|
||||
var courtyard_tile: PackedScene = load("res://objects/courtyard-tile.scn")
|
||||
var foundation_tile: PackedScene = load("res://objects/foundation.scn")
|
||||
var room_tile: PackedScene = load("res://objects/block-room-corridoor.scn")
|
||||
var tower_walls_tile: PackedScene = load("res://objects/tower-walls.scn")
|
||||
var tower_floor_tile: PackedScene = load("res://objects/tower_floor.scn")
|
||||
var stairs_tile: PackedScene = load("res://objects/stairs.scn")
|
||||
var gate_bottom_tile: PackedScene = load("res://objects/gate_bottom.scn")
|
||||
var gate_top_tile: PackedScene = load("res://objects/gate-top.scn")
|
||||
var entry_tile: PackedScene = load("res://objects/block-room-entry.scn")
|
||||
var roof_tile: PackedScene = load("res://objects/roof.scn")
|
||||
var tower_roof_tile: PackedScene = load("res://objects/tower-roof.scn")
|
||||
|
||||
const tile_size = 8
|
||||
const palace_size = 8
|
||||
const layers = 4
|
||||
|
||||
|
||||
func _ready():
|
||||
var voffset = 0.0
|
||||
for layer in range(layers):
|
||||
match layer:
|
||||
0:
|
||||
voffset += 0.0
|
||||
1:
|
||||
voffset += 1
|
||||
2:
|
||||
voffset += 4
|
||||
_:
|
||||
voffset += 4
|
||||
for i in range(palace_size):
|
||||
for j in range(palace_size):
|
||||
var x = i * tile_size - palace_size * tile_size / 2
|
||||
var z = j * tile_size - palace_size * tile_size / 2
|
||||
if layer == 0:
|
||||
var ct = courtyard_tile.instance()
|
||||
var xform = Transform(Basis(), Vector3(x, voffset, z))
|
||||
if i > 0 && i < palace_size - 1:
|
||||
if j > 0 && j < palace_size - 1:
|
||||
call_deferred("place", ct, xform)
|
||||
if i in [0, palace_size - 1] || j in [0, palace_size - 1]:
|
||||
call_deferred("place", ct, xform)
|
||||
else:
|
||||
var ct = room_tile.instance()
|
||||
var tower_angles = {
|
||||
0:
|
||||
{
|
||||
0: -PI / 2.0,
|
||||
palace_size - 1: 0
|
||||
},
|
||||
palace_size - 1:
|
||||
{
|
||||
0: PI,
|
||||
palace_size - 1: PI / 2.0
|
||||
}
|
||||
}
|
||||
var xform = Transform(Basis(), Vector3(x, voffset, z))
|
||||
if i == 0 && !j in [0, palace_size - 1]:
|
||||
xform.basis = Basis().rotated(Vector3.UP, -PI / 2.0)
|
||||
spawn_wall(layer, i, j, xform)
|
||||
elif i == palace_size - 1 && !j in [0, palace_size - 1]:
|
||||
xform.basis = Basis().rotated(Vector3.UP, PI / 2.0)
|
||||
spawn_wall(layer, i, j, xform)
|
||||
elif !i in [0, palace_size - 1] && j == 0:
|
||||
xform.basis = Basis().rotated(Vector3.UP, PI)
|
||||
spawn_wall(layer, i, j, xform)
|
||||
elif !i in [0, palace_size - 1] && j == palace_size - 1:
|
||||
xform.basis = Basis()
|
||||
spawn_wall(layer, i, j, xform)
|
||||
elif tower_angles.has(i) && tower_angles[i].has(j):
|
||||
xform.basis = Basis().rotated(Vector3.UP, tower_angles[i][j])
|
||||
if layer == layers - 1:
|
||||
var twr = tower_roof_tile.instance()
|
||||
call_deferred("place", twr, xform)
|
||||
else:
|
||||
var tw = tower_walls_tile.instance()
|
||||
call_deferred("place", tw, xform)
|
||||
var st = stairs_tile.instance()
|
||||
call_deferred("place", st, xform)
|
||||
if layer == 1:
|
||||
var tfl = tower_floor_tile.instance()
|
||||
call_deferred("place", tfl, xform)
|
||||
var car = Spatial.new()
|
||||
car.add_to_group("spawn")
|
||||
car.add_to_group("keep")
|
||||
car.add_to_group("car")
|
||||
add_child(car)
|
||||
for e in range(5):
|
||||
var major_f = Spatial.new()
|
||||
major_f.add_to_group("spawn")
|
||||
if e == 0:
|
||||
major_f.add_to_group("male")
|
||||
else:
|
||||
major_f.add_to_group("female")
|
||||
major_f.add_to_group("keep")
|
||||
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")
|
||||
func place(obj, where):
|
||||
add_child(obj)
|
||||
obj.transform = where
|
||||
print("placed at ", where.origin)
|
||||
|
||||
func spawn_wall(layer:int, i: int, j: int, xform: Transform):
|
||||
if layer == layers - 1:
|
||||
var rt = roof_tile.instance()
|
||||
call_deferred("place", rt, xform)
|
||||
elif (j != palace_size / 2.0 && i != palace_size / 2.0)|| layer > 2:
|
||||
var ct = room_tile.instance()
|
||||
call_deferred("place", ct, xform)
|
||||
elif (j == palace_size / 2.0 && i != palace_size / 2.0) && layer == 1:
|
||||
var ent = entry_tile.instance()
|
||||
call_deferred("place", ent, xform)
|
||||
elif (j != palace_size / 2.0 && i == palace_size / 2.0) && layer == 1:
|
||||
var gw = gate_bottom_tile.instance()
|
||||
call_deferred("place", gw, xform)
|
||||
elif (j != palace_size / 2.0 && i == palace_size / 2.0) && layer == 2:
|
||||
var gw = gate_top_tile.instance()
|
||||
call_deferred("place", gw, xform)
|
||||
elif (j == palace_size / 2.0 && i != palace_size / 2.0) && layer == 2:
|
||||
var ct = room_tile.instance()
|
||||
call_deferred("place", ct, xform)
|
||||
889
objects/palace.gltf
Normal file
889
objects/palace.gltf
Normal file
@@ -0,0 +1,889 @@
|
||||
{
|
||||
"asset" : {
|
||||
"generator" : "Khronos glTF Blender I/O v1.6.16",
|
||||
"version" : "2.0"
|
||||
},
|
||||
"scene" : 0,
|
||||
"scenes" : [
|
||||
{
|
||||
"name" : "Scene",
|
||||
"nodes" : [
|
||||
0,
|
||||
1,
|
||||
2,
|
||||
3,
|
||||
4,
|
||||
5,
|
||||
6,
|
||||
7,
|
||||
8,
|
||||
9,
|
||||
10
|
||||
]
|
||||
}
|
||||
],
|
||||
"nodes" : [
|
||||
{
|
||||
"mesh" : 0,
|
||||
"name" : "courtyard-tile-col",
|
||||
"translation" : [
|
||||
94,
|
||||
0,
|
||||
0
|
||||
]
|
||||
},
|
||||
{
|
||||
"mesh" : 1,
|
||||
"name" : "block-room-corridoor-col",
|
||||
"translation" : [
|
||||
83,
|
||||
0,
|
||||
0
|
||||
]
|
||||
},
|
||||
{
|
||||
"mesh" : 2,
|
||||
"name" : "foundation-col",
|
||||
"translation" : [
|
||||
104,
|
||||
0,
|
||||
0
|
||||
]
|
||||
},
|
||||
{
|
||||
"mesh" : 3,
|
||||
"name" : "tower-walls-col",
|
||||
"translation" : [
|
||||
56,
|
||||
0,
|
||||
0
|
||||
]
|
||||
},
|
||||
{
|
||||
"mesh" : 4,
|
||||
"name" : "stairs-col",
|
||||
"translation" : [
|
||||
73,
|
||||
0,
|
||||
0
|
||||
]
|
||||
},
|
||||
{
|
||||
"mesh" : 5,
|
||||
"name" : "gate_bottom-col",
|
||||
"translation" : [
|
||||
115,
|
||||
0,
|
||||
0
|
||||
]
|
||||
},
|
||||
{
|
||||
"mesh" : 6,
|
||||
"name" : "gate-top-col",
|
||||
"translation" : [
|
||||
115,
|
||||
4,
|
||||
0
|
||||
]
|
||||
},
|
||||
{
|
||||
"mesh" : 7,
|
||||
"name" : "tower_floor-col",
|
||||
"translation" : [
|
||||
66,
|
||||
0,
|
||||
0
|
||||
]
|
||||
},
|
||||
{
|
||||
"mesh" : 8,
|
||||
"name" : "block-room-entry-col",
|
||||
"translation" : [
|
||||
46,
|
||||
0,
|
||||
0
|
||||
]
|
||||
},
|
||||
{
|
||||
"mesh" : 9,
|
||||
"name" : "roof-col",
|
||||
"translation" : [
|
||||
36,
|
||||
0,
|
||||
0
|
||||
]
|
||||
},
|
||||
{
|
||||
"mesh" : 10,
|
||||
"name" : "tower-roof-col",
|
||||
"translation" : [
|
||||
26,
|
||||
0,
|
||||
0
|
||||
]
|
||||
}
|
||||
],
|
||||
"materials" : [
|
||||
{
|
||||
"name" : "palace",
|
||||
"pbrMetallicRoughness" : {
|
||||
"baseColorFactor" : [
|
||||
0.800000011920929,
|
||||
0.800000011920929,
|
||||
0.800000011920929,
|
||||
1
|
||||
],
|
||||
"metallicFactor" : 0,
|
||||
"roughnessFactor" : 0.5
|
||||
}
|
||||
}
|
||||
],
|
||||
"meshes" : [
|
||||
{
|
||||
"name" : "Cube",
|
||||
"primitives" : [
|
||||
{
|
||||
"attributes" : {
|
||||
"POSITION" : 0,
|
||||
"NORMAL" : 1,
|
||||
"TEXCOORD_0" : 2
|
||||
},
|
||||
"indices" : 3,
|
||||
"material" : 0
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name" : "Cube.351",
|
||||
"primitives" : [
|
||||
{
|
||||
"attributes" : {
|
||||
"POSITION" : 4,
|
||||
"NORMAL" : 5,
|
||||
"TEXCOORD_0" : 6
|
||||
},
|
||||
"indices" : 7,
|
||||
"material" : 0
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name" : "Cube.001",
|
||||
"primitives" : [
|
||||
{
|
||||
"attributes" : {
|
||||
"POSITION" : 8,
|
||||
"NORMAL" : 9,
|
||||
"TEXCOORD_0" : 10
|
||||
},
|
||||
"indices" : 3,
|
||||
"material" : 0
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name" : "Cube.003",
|
||||
"primitives" : [
|
||||
{
|
||||
"attributes" : {
|
||||
"POSITION" : 11,
|
||||
"NORMAL" : 12,
|
||||
"TEXCOORD_0" : 13
|
||||
},
|
||||
"indices" : 14,
|
||||
"material" : 0
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name" : "Cube.005",
|
||||
"primitives" : [
|
||||
{
|
||||
"attributes" : {
|
||||
"POSITION" : 15,
|
||||
"NORMAL" : 16,
|
||||
"TEXCOORD_0" : 17
|
||||
},
|
||||
"indices" : 18,
|
||||
"material" : 0
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name" : "Cube.007",
|
||||
"primitives" : [
|
||||
{
|
||||
"attributes" : {
|
||||
"POSITION" : 19,
|
||||
"NORMAL" : 20,
|
||||
"TEXCOORD_0" : 21
|
||||
},
|
||||
"indices" : 22,
|
||||
"material" : 0
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name" : "Cube.008",
|
||||
"primitives" : [
|
||||
{
|
||||
"attributes" : {
|
||||
"POSITION" : 23,
|
||||
"NORMAL" : 24,
|
||||
"TEXCOORD_0" : 25
|
||||
},
|
||||
"indices" : 26,
|
||||
"material" : 0
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name" : "Cube.009",
|
||||
"primitives" : [
|
||||
{
|
||||
"attributes" : {
|
||||
"POSITION" : 27,
|
||||
"NORMAL" : 28,
|
||||
"TEXCOORD_0" : 29
|
||||
},
|
||||
"indices" : 30,
|
||||
"material" : 0
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name" : "Cube.010",
|
||||
"primitives" : [
|
||||
{
|
||||
"attributes" : {
|
||||
"POSITION" : 31,
|
||||
"NORMAL" : 32,
|
||||
"TEXCOORD_0" : 33
|
||||
},
|
||||
"indices" : 34,
|
||||
"material" : 0
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name" : "Cube.011",
|
||||
"primitives" : [
|
||||
{
|
||||
"attributes" : {
|
||||
"POSITION" : 35,
|
||||
"NORMAL" : 36,
|
||||
"TEXCOORD_0" : 37
|
||||
},
|
||||
"indices" : 38,
|
||||
"material" : 0
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name" : "Cube.017",
|
||||
"primitives" : [
|
||||
{
|
||||
"attributes" : {
|
||||
"POSITION" : 39,
|
||||
"NORMAL" : 40,
|
||||
"TEXCOORD_0" : 41
|
||||
},
|
||||
"indices" : 42
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"accessors" : [
|
||||
{
|
||||
"bufferView" : 0,
|
||||
"componentType" : 5126,
|
||||
"count" : 24,
|
||||
"max" : [
|
||||
4,
|
||||
0,
|
||||
4
|
||||
],
|
||||
"min" : [
|
||||
-4,
|
||||
-1,
|
||||
-4
|
||||
],
|
||||
"type" : "VEC3"
|
||||
},
|
||||
{
|
||||
"bufferView" : 1,
|
||||
"componentType" : 5126,
|
||||
"count" : 24,
|
||||
"type" : "VEC3"
|
||||
},
|
||||
{
|
||||
"bufferView" : 2,
|
||||
"componentType" : 5126,
|
||||
"count" : 24,
|
||||
"type" : "VEC2"
|
||||
},
|
||||
{
|
||||
"bufferView" : 3,
|
||||
"componentType" : 5123,
|
||||
"count" : 36,
|
||||
"type" : "SCALAR"
|
||||
},
|
||||
{
|
||||
"bufferView" : 4,
|
||||
"componentType" : 5126,
|
||||
"count" : 1057,
|
||||
"max" : [
|
||||
4,
|
||||
3.799999952316284,
|
||||
4
|
||||
],
|
||||
"min" : [
|
||||
-4.000003337860107,
|
||||
-0.20000004768371582,
|
||||
-4.099991321563721
|
||||
],
|
||||
"type" : "VEC3"
|
||||
},
|
||||
{
|
||||
"bufferView" : 5,
|
||||
"componentType" : 5126,
|
||||
"count" : 1057,
|
||||
"type" : "VEC3"
|
||||
},
|
||||
{
|
||||
"bufferView" : 6,
|
||||
"componentType" : 5126,
|
||||
"count" : 1057,
|
||||
"type" : "VEC2"
|
||||
},
|
||||
{
|
||||
"bufferView" : 7,
|
||||
"componentType" : 5123,
|
||||
"count" : 2604,
|
||||
"type" : "SCALAR"
|
||||
},
|
||||
{
|
||||
"bufferView" : 8,
|
||||
"componentType" : 5126,
|
||||
"count" : 24,
|
||||
"max" : [
|
||||
4,
|
||||
0.800000011920929,
|
||||
4
|
||||
],
|
||||
"min" : [
|
||||
-4,
|
||||
-1,
|
||||
-4
|
||||
],
|
||||
"type" : "VEC3"
|
||||
},
|
||||
{
|
||||
"bufferView" : 9,
|
||||
"componentType" : 5126,
|
||||
"count" : 24,
|
||||
"type" : "VEC3"
|
||||
},
|
||||
{
|
||||
"bufferView" : 10,
|
||||
"componentType" : 5126,
|
||||
"count" : 24,
|
||||
"type" : "VEC2"
|
||||
},
|
||||
{
|
||||
"bufferView" : 11,
|
||||
"componentType" : 5126,
|
||||
"count" : 849,
|
||||
"max" : [
|
||||
4,
|
||||
3.799999952316284,
|
||||
4
|
||||
],
|
||||
"min" : [
|
||||
-4,
|
||||
-0.20000000298023224,
|
||||
-4
|
||||
],
|
||||
"type" : "VEC3"
|
||||
},
|
||||
{
|
||||
"bufferView" : 12,
|
||||
"componentType" : 5126,
|
||||
"count" : 849,
|
||||
"type" : "VEC3"
|
||||
},
|
||||
{
|
||||
"bufferView" : 13,
|
||||
"componentType" : 5126,
|
||||
"count" : 849,
|
||||
"type" : "VEC2"
|
||||
},
|
||||
{
|
||||
"bufferView" : 14,
|
||||
"componentType" : 5123,
|
||||
"count" : 2178,
|
||||
"type" : "SCALAR"
|
||||
},
|
||||
{
|
||||
"bufferView" : 15,
|
||||
"componentType" : 5126,
|
||||
"count" : 905,
|
||||
"max" : [
|
||||
4,
|
||||
5,
|
||||
3.9000000953674316
|
||||
],
|
||||
"min" : [
|
||||
-3.8999996185302734,
|
||||
0,
|
||||
-4
|
||||
],
|
||||
"type" : "VEC3"
|
||||
},
|
||||
{
|
||||
"bufferView" : 16,
|
||||
"componentType" : 5126,
|
||||
"count" : 905,
|
||||
"type" : "VEC3"
|
||||
},
|
||||
{
|
||||
"bufferView" : 17,
|
||||
"componentType" : 5126,
|
||||
"count" : 905,
|
||||
"type" : "VEC2"
|
||||
},
|
||||
{
|
||||
"bufferView" : 18,
|
||||
"componentType" : 5123,
|
||||
"count" : 1596,
|
||||
"type" : "SCALAR"
|
||||
},
|
||||
{
|
||||
"bufferView" : 19,
|
||||
"componentType" : 5126,
|
||||
"count" : 80,
|
||||
"max" : [
|
||||
4,
|
||||
3.799999952316284,
|
||||
4.5
|
||||
],
|
||||
"min" : [
|
||||
-4,
|
||||
-0.19999992847442627,
|
||||
-4.5
|
||||
],
|
||||
"type" : "VEC3"
|
||||
},
|
||||
{
|
||||
"bufferView" : 20,
|
||||
"componentType" : 5126,
|
||||
"count" : 80,
|
||||
"type" : "VEC3"
|
||||
},
|
||||
{
|
||||
"bufferView" : 21,
|
||||
"componentType" : 5126,
|
||||
"count" : 80,
|
||||
"type" : "VEC2"
|
||||
},
|
||||
{
|
||||
"bufferView" : 22,
|
||||
"componentType" : 5123,
|
||||
"count" : 156,
|
||||
"type" : "SCALAR"
|
||||
},
|
||||
{
|
||||
"bufferView" : 23,
|
||||
"componentType" : 5126,
|
||||
"count" : 504,
|
||||
"max" : [
|
||||
4,
|
||||
4,
|
||||
4.5
|
||||
],
|
||||
"min" : [
|
||||
-4,
|
||||
-0.19999992847442627,
|
||||
-4.5
|
||||
],
|
||||
"type" : "VEC3"
|
||||
},
|
||||
{
|
||||
"bufferView" : 24,
|
||||
"componentType" : 5126,
|
||||
"count" : 504,
|
||||
"type" : "VEC3"
|
||||
},
|
||||
{
|
||||
"bufferView" : 25,
|
||||
"componentType" : 5126,
|
||||
"count" : 504,
|
||||
"type" : "VEC2"
|
||||
},
|
||||
{
|
||||
"bufferView" : 26,
|
||||
"componentType" : 5123,
|
||||
"count" : 1332,
|
||||
"type" : "SCALAR"
|
||||
},
|
||||
{
|
||||
"bufferView" : 27,
|
||||
"componentType" : 5126,
|
||||
"count" : 4,
|
||||
"max" : [
|
||||
1.5,
|
||||
0,
|
||||
4
|
||||
],
|
||||
"min" : [
|
||||
-3.9000000953674316,
|
||||
0,
|
||||
-3.9000000953674316
|
||||
],
|
||||
"type" : "VEC3"
|
||||
},
|
||||
{
|
||||
"bufferView" : 28,
|
||||
"componentType" : 5126,
|
||||
"count" : 4,
|
||||
"type" : "VEC3"
|
||||
},
|
||||
{
|
||||
"bufferView" : 29,
|
||||
"componentType" : 5126,
|
||||
"count" : 4,
|
||||
"type" : "VEC2"
|
||||
},
|
||||
{
|
||||
"bufferView" : 30,
|
||||
"componentType" : 5123,
|
||||
"count" : 6,
|
||||
"type" : "SCALAR"
|
||||
},
|
||||
{
|
||||
"bufferView" : 31,
|
||||
"componentType" : 5126,
|
||||
"count" : 1143,
|
||||
"max" : [
|
||||
4,
|
||||
3.799999952316284,
|
||||
4
|
||||
],
|
||||
"min" : [
|
||||
-4,
|
||||
-0.9818469285964966,
|
||||
-5.357455253601074
|
||||
],
|
||||
"type" : "VEC3"
|
||||
},
|
||||
{
|
||||
"bufferView" : 32,
|
||||
"componentType" : 5126,
|
||||
"count" : 1143,
|
||||
"type" : "VEC3"
|
||||
},
|
||||
{
|
||||
"bufferView" : 33,
|
||||
"componentType" : 5126,
|
||||
"count" : 1143,
|
||||
"type" : "VEC2"
|
||||
},
|
||||
{
|
||||
"bufferView" : 34,
|
||||
"componentType" : 5123,
|
||||
"count" : 3180,
|
||||
"type" : "SCALAR"
|
||||
},
|
||||
{
|
||||
"bufferView" : 35,
|
||||
"componentType" : 5126,
|
||||
"count" : 36,
|
||||
"max" : [
|
||||
4,
|
||||
5,
|
||||
4
|
||||
],
|
||||
"min" : [
|
||||
-4,
|
||||
-0.20000000298023224,
|
||||
-4
|
||||
],
|
||||
"type" : "VEC3"
|
||||
},
|
||||
{
|
||||
"bufferView" : 36,
|
||||
"componentType" : 5126,
|
||||
"count" : 36,
|
||||
"type" : "VEC3"
|
||||
},
|
||||
{
|
||||
"bufferView" : 37,
|
||||
"componentType" : 5126,
|
||||
"count" : 36,
|
||||
"type" : "VEC2"
|
||||
},
|
||||
{
|
||||
"bufferView" : 38,
|
||||
"componentType" : 5123,
|
||||
"count" : 60,
|
||||
"type" : "SCALAR"
|
||||
},
|
||||
{
|
||||
"bufferView" : 39,
|
||||
"componentType" : 5126,
|
||||
"count" : 1832,
|
||||
"max" : [
|
||||
4,
|
||||
14,
|
||||
4
|
||||
],
|
||||
"min" : [
|
||||
-4,
|
||||
-0.30000001192092896,
|
||||
-4
|
||||
],
|
||||
"type" : "VEC3"
|
||||
},
|
||||
{
|
||||
"bufferView" : 40,
|
||||
"componentType" : 5126,
|
||||
"count" : 1832,
|
||||
"type" : "VEC3"
|
||||
},
|
||||
{
|
||||
"bufferView" : 41,
|
||||
"componentType" : 5126,
|
||||
"count" : 1832,
|
||||
"type" : "VEC2"
|
||||
},
|
||||
{
|
||||
"bufferView" : 42,
|
||||
"componentType" : 5123,
|
||||
"count" : 2964,
|
||||
"type" : "SCALAR"
|
||||
}
|
||||
],
|
||||
"bufferViews" : [
|
||||
{
|
||||
"buffer" : 0,
|
||||
"byteLength" : 288,
|
||||
"byteOffset" : 0
|
||||
},
|
||||
{
|
||||
"buffer" : 0,
|
||||
"byteLength" : 288,
|
||||
"byteOffset" : 288
|
||||
},
|
||||
{
|
||||
"buffer" : 0,
|
||||
"byteLength" : 192,
|
||||
"byteOffset" : 576
|
||||
},
|
||||
{
|
||||
"buffer" : 0,
|
||||
"byteLength" : 72,
|
||||
"byteOffset" : 768
|
||||
},
|
||||
{
|
||||
"buffer" : 0,
|
||||
"byteLength" : 12684,
|
||||
"byteOffset" : 840
|
||||
},
|
||||
{
|
||||
"buffer" : 0,
|
||||
"byteLength" : 12684,
|
||||
"byteOffset" : 13524
|
||||
},
|
||||
{
|
||||
"buffer" : 0,
|
||||
"byteLength" : 8456,
|
||||
"byteOffset" : 26208
|
||||
},
|
||||
{
|
||||
"buffer" : 0,
|
||||
"byteLength" : 5208,
|
||||
"byteOffset" : 34664
|
||||
},
|
||||
{
|
||||
"buffer" : 0,
|
||||
"byteLength" : 288,
|
||||
"byteOffset" : 39872
|
||||
},
|
||||
{
|
||||
"buffer" : 0,
|
||||
"byteLength" : 288,
|
||||
"byteOffset" : 40160
|
||||
},
|
||||
{
|
||||
"buffer" : 0,
|
||||
"byteLength" : 192,
|
||||
"byteOffset" : 40448
|
||||
},
|
||||
{
|
||||
"buffer" : 0,
|
||||
"byteLength" : 10188,
|
||||
"byteOffset" : 40640
|
||||
},
|
||||
{
|
||||
"buffer" : 0,
|
||||
"byteLength" : 10188,
|
||||
"byteOffset" : 50828
|
||||
},
|
||||
{
|
||||
"buffer" : 0,
|
||||
"byteLength" : 6792,
|
||||
"byteOffset" : 61016
|
||||
},
|
||||
{
|
||||
"buffer" : 0,
|
||||
"byteLength" : 4356,
|
||||
"byteOffset" : 67808
|
||||
},
|
||||
{
|
||||
"buffer" : 0,
|
||||
"byteLength" : 10860,
|
||||
"byteOffset" : 72164
|
||||
},
|
||||
{
|
||||
"buffer" : 0,
|
||||
"byteLength" : 10860,
|
||||
"byteOffset" : 83024
|
||||
},
|
||||
{
|
||||
"buffer" : 0,
|
||||
"byteLength" : 7240,
|
||||
"byteOffset" : 93884
|
||||
},
|
||||
{
|
||||
"buffer" : 0,
|
||||
"byteLength" : 3192,
|
||||
"byteOffset" : 101124
|
||||
},
|
||||
{
|
||||
"buffer" : 0,
|
||||
"byteLength" : 960,
|
||||
"byteOffset" : 104316
|
||||
},
|
||||
{
|
||||
"buffer" : 0,
|
||||
"byteLength" : 960,
|
||||
"byteOffset" : 105276
|
||||
},
|
||||
{
|
||||
"buffer" : 0,
|
||||
"byteLength" : 640,
|
||||
"byteOffset" : 106236
|
||||
},
|
||||
{
|
||||
"buffer" : 0,
|
||||
"byteLength" : 312,
|
||||
"byteOffset" : 106876
|
||||
},
|
||||
{
|
||||
"buffer" : 0,
|
||||
"byteLength" : 6048,
|
||||
"byteOffset" : 107188
|
||||
},
|
||||
{
|
||||
"buffer" : 0,
|
||||
"byteLength" : 6048,
|
||||
"byteOffset" : 113236
|
||||
},
|
||||
{
|
||||
"buffer" : 0,
|
||||
"byteLength" : 4032,
|
||||
"byteOffset" : 119284
|
||||
},
|
||||
{
|
||||
"buffer" : 0,
|
||||
"byteLength" : 2664,
|
||||
"byteOffset" : 123316
|
||||
},
|
||||
{
|
||||
"buffer" : 0,
|
||||
"byteLength" : 48,
|
||||
"byteOffset" : 125980
|
||||
},
|
||||
{
|
||||
"buffer" : 0,
|
||||
"byteLength" : 48,
|
||||
"byteOffset" : 126028
|
||||
},
|
||||
{
|
||||
"buffer" : 0,
|
||||
"byteLength" : 32,
|
||||
"byteOffset" : 126076
|
||||
},
|
||||
{
|
||||
"buffer" : 0,
|
||||
"byteLength" : 12,
|
||||
"byteOffset" : 126108
|
||||
},
|
||||
{
|
||||
"buffer" : 0,
|
||||
"byteLength" : 13716,
|
||||
"byteOffset" : 126120
|
||||
},
|
||||
{
|
||||
"buffer" : 0,
|
||||
"byteLength" : 13716,
|
||||
"byteOffset" : 139836
|
||||
},
|
||||
{
|
||||
"buffer" : 0,
|
||||
"byteLength" : 9144,
|
||||
"byteOffset" : 153552
|
||||
},
|
||||
{
|
||||
"buffer" : 0,
|
||||
"byteLength" : 6360,
|
||||
"byteOffset" : 162696
|
||||
},
|
||||
{
|
||||
"buffer" : 0,
|
||||
"byteLength" : 432,
|
||||
"byteOffset" : 169056
|
||||
},
|
||||
{
|
||||
"buffer" : 0,
|
||||
"byteLength" : 432,
|
||||
"byteOffset" : 169488
|
||||
},
|
||||
{
|
||||
"buffer" : 0,
|
||||
"byteLength" : 288,
|
||||
"byteOffset" : 169920
|
||||
},
|
||||
{
|
||||
"buffer" : 0,
|
||||
"byteLength" : 120,
|
||||
"byteOffset" : 170208
|
||||
},
|
||||
{
|
||||
"buffer" : 0,
|
||||
"byteLength" : 21984,
|
||||
"byteOffset" : 170328
|
||||
},
|
||||
{
|
||||
"buffer" : 0,
|
||||
"byteLength" : 21984,
|
||||
"byteOffset" : 192312
|
||||
},
|
||||
{
|
||||
"buffer" : 0,
|
||||
"byteLength" : 14656,
|
||||
"byteOffset" : 214296
|
||||
},
|
||||
{
|
||||
"buffer" : 0,
|
||||
"byteLength" : 5928,
|
||||
"byteOffset" : 228952
|
||||
}
|
||||
],
|
||||
"buffers" : [
|
||||
{
|
||||
"byteLength" : 234880,
|
||||
"uri" : "palace.bin"
|
||||
}
|
||||
]
|
||||
}
|
||||
1064
objects/palace.gltf.import
Normal file
1064
objects/palace.gltf.import
Normal file
File diff suppressed because it is too large
Load Diff
BIN
objects/palace.material
Normal file
BIN
objects/palace.material
Normal file
Binary file not shown.
6
objects/palace.tscn
Normal file
6
objects/palace.tscn
Normal file
@@ -0,0 +1,6 @@
|
||||
[gd_scene load_steps=2 format=2]
|
||||
|
||||
[ext_resource path="res://objects/palace.gd" type="Script" id=2]
|
||||
|
||||
[node name="palace" type="Spatial"]
|
||||
script = ExtResource( 2 )
|
||||
BIN
objects/palace_001.material
Normal file
BIN
objects/palace_001.material
Normal file
Binary file not shown.
BIN
objects/trailer-house.bin
Normal file
BIN
objects/trailer-house.bin
Normal file
Binary file not shown.
151
objects/trailer-house.gd
Normal file
151
objects/trailer-house.gd
Normal file
@@ -0,0 +1,151 @@
|
||||
extends Spatial
|
||||
|
||||
var side_wall: PackedScene = preload("res://objects/wall-side.scn")
|
||||
var bottom_side: PackedScene = preload("res://objects/bottom-side.scn")
|
||||
var bottom: PackedScene = preload("res://objects/bottom.scn")
|
||||
var bottom_wheels: PackedScene = preload("res://objects/bottom-wheels.scn")
|
||||
var entry: PackedScene = preload("res://objects/entry.scn")
|
||||
var roof_floor: PackedScene = preload("res://objects/roof-floor.scn")
|
||||
var roof_floor_range: PackedScene = preload("res://objects/roof-floor-range.scn")
|
||||
var wall_internal: PackedScene = preload("res://objects/wall-internal.scn")
|
||||
var window_narrow: PackedScene = preload("res://objects/window-narrow.scn")
|
||||
var window_wide: PackedScene = preload("res://objects/window-wide.scn")
|
||||
var wall_solid: PackedScene = preload("res://objects/wall-solid.scn")
|
||||
onready var rnd = RandomNumberGenerator.new()
|
||||
|
||||
|
||||
# Declare member variables here. Examples:
|
||||
# var a = 2
|
||||
# var b = "text"
|
||||
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
var thread: Thread
|
||||
func _ready():
|
||||
thread = Thread.new()
|
||||
# var parts = {
|
||||
# "side_wall": side_wall,
|
||||
# "bottom_side": bottom_side,
|
||||
# "bottom": bottom,
|
||||
# "bottom_wheels": bottom_wheels,
|
||||
# "entry": entry,
|
||||
# "roof_floor": roof_floor,
|
||||
# "roof_floor_range": roof_floor_range,
|
||||
# "wall_internal": wall_internal,
|
||||
# "window_narrow": window_narrow,
|
||||
# "window_wide": window_wide,
|
||||
# "wall_solid": wall_solid
|
||||
# }
|
||||
# for k in parts.keys():
|
||||
# Spawner.add_scene(k, parts[k])
|
||||
func _exit_tree():
|
||||
if thread.is_active():
|
||||
thread.wait_to_finish()
|
||||
func spawn_child(n, xform):
|
||||
add_child(n)
|
||||
n.transform = xform
|
||||
func build_house(userdata):
|
||||
var s = int(global_transform.origin.x + 100 * global_transform.origin.z * 2) % 0x1ffffff
|
||||
rnd.seed = s
|
||||
print(global_transform.origin, " seed = ", s)
|
||||
var l = 6 + 2 * rnd.randi() % 7 - 1
|
||||
var h = l - 1
|
||||
var d = 3 + rnd.randi() % (l - 5 + 1)
|
||||
var range_used = false
|
||||
for k in range(l + 1):
|
||||
var pos = Vector3(0, 0, k * 2)
|
||||
if k > 0:
|
||||
if k != d && rnd.randf() > 0.5 && !range_used:
|
||||
var r = roof_floor_range.instance()
|
||||
var xform = Transform(Basis(), pos)
|
||||
call_deferred("spawn_child", r, xform)
|
||||
range_used = true
|
||||
else:
|
||||
var r = roof_floor.instance()
|
||||
var xform = Transform(Basis(), pos)
|
||||
call_deferred("spawn_child", r, xform)
|
||||
var 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.instance()
|
||||
elif rnd.randf() > 0.5:
|
||||
what = window_narrow.instance()
|
||||
else:
|
||||
what = window_wide.instance()
|
||||
call_deferred("spawn_child", what, xt[x])
|
||||
|
||||
if k > 1 && k < l && rnd.randf() > 0.6:
|
||||
var r = wall_internal.instance()
|
||||
var xform = Transform(Basis(), pos)
|
||||
call_deferred("spawn_child", r, xform)
|
||||
match k:
|
||||
0:
|
||||
var b = side_wall.instance()
|
||||
var c = bottom_side.instance()
|
||||
var xform = Transform(Basis(), pos)
|
||||
call_deferred("spawn_child", b, xform)
|
||||
call_deferred("spawn_child", c, xform)
|
||||
1:
|
||||
var b = bottom.instance()
|
||||
var xform = Transform(Basis(), pos)
|
||||
call_deferred("spawn_child", b, xform)
|
||||
2:
|
||||
var b = bottom_wheels.instance()
|
||||
var xform = Transform(Basis(), pos)
|
||||
call_deferred("spawn_child", b, xform)
|
||||
d:
|
||||
var b = entry.instance()
|
||||
var c = bottom.instance()
|
||||
var xform = Transform(Basis(), pos)
|
||||
call_deferred("spawn_child", b, xform)
|
||||
call_deferred("spawn_child", c, xform)
|
||||
h:
|
||||
var b = bottom_wheels.instance()
|
||||
var xform = Transform(Basis(), pos)
|
||||
call_deferred("spawn_child", b, xform)
|
||||
l:
|
||||
var b = side_wall.instance()
|
||||
var c = bottom_side.instance()
|
||||
var a = bottom.instance()
|
||||
var xform = Transform(Basis().rotated(Vector3(0, 1, 0), PI), pos)
|
||||
var xform2 = Transform(Basis(), pos)
|
||||
call_deferred("spawn_child", b, xform)
|
||||
call_deferred("spawn_child", c, xform)
|
||||
call_deferred("spawn_child", a, xform2)
|
||||
_:
|
||||
var b = bottom.instance()
|
||||
var xform = Transform(Basis(), pos)
|
||||
call_deferred("spawn_child", b, xform)
|
||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
var state = 0
|
||||
func _process(delta):
|
||||
match state:
|
||||
0:
|
||||
state = 1
|
||||
1:
|
||||
build_house(self)
|
||||
state = 2
|
||||
|
||||
var prev = 3000000
|
||||
func _physics_process(delta):
|
||||
var cam = get_viewport().get_camera()
|
||||
var dst = cam.global_transform.origin.distance_to(global_transform.origin)
|
||||
match state:
|
||||
2:
|
||||
if abs(prev - dst) > 20:
|
||||
var space_state = get_viewport().get_world().direct_space_state
|
||||
var where = get_global_transform().origin
|
||||
var from = where
|
||||
var to = where
|
||||
from.y -= 8.0
|
||||
to.y += 8.0
|
||||
var result = space_state.intersect_ray(from, to)
|
||||
if result.empty() || !result.has("collider"):
|
||||
return
|
||||
else:
|
||||
global_transform.origin = result.position
|
||||
prev = dst
|
||||
|
||||
901
objects/trailer-house.gltf
Normal file
901
objects/trailer-house.gltf
Normal file
@@ -0,0 +1,901 @@
|
||||
{
|
||||
"asset" : {
|
||||
"generator" : "Khronos glTF Blender I/O v1.5.17",
|
||||
"version" : "2.0"
|
||||
},
|
||||
"scene" : 0,
|
||||
"scenes" : [
|
||||
{
|
||||
"name" : "Scene",
|
||||
"nodes" : [
|
||||
0,
|
||||
1,
|
||||
2,
|
||||
3,
|
||||
4,
|
||||
5,
|
||||
6,
|
||||
7,
|
||||
8,
|
||||
9,
|
||||
10
|
||||
]
|
||||
}
|
||||
],
|
||||
"nodes" : [
|
||||
{
|
||||
"mesh" : 0,
|
||||
"name" : "wall-side-col",
|
||||
"translation" : [
|
||||
0,
|
||||
0,
|
||||
23
|
||||
]
|
||||
},
|
||||
{
|
||||
"mesh" : 1,
|
||||
"name" : "roof-floor-col",
|
||||
"translation" : [
|
||||
0,
|
||||
0,
|
||||
22.700000762939453
|
||||
]
|
||||
},
|
||||
{
|
||||
"mesh" : 2,
|
||||
"name" : "wall-solid-col",
|
||||
"translation" : [
|
||||
0,
|
||||
0,
|
||||
22.700000762939453
|
||||
]
|
||||
},
|
||||
{
|
||||
"mesh" : 3,
|
||||
"name" : "window-wide-col",
|
||||
"translation" : [
|
||||
0,
|
||||
0,
|
||||
17
|
||||
]
|
||||
},
|
||||
{
|
||||
"mesh" : 4,
|
||||
"name" : "window-narrow-col",
|
||||
"translation" : [
|
||||
0,
|
||||
0,
|
||||
14
|
||||
]
|
||||
},
|
||||
{
|
||||
"mesh" : 5,
|
||||
"name" : "entry-col",
|
||||
"translation" : [
|
||||
0,
|
||||
0,
|
||||
11
|
||||
]
|
||||
},
|
||||
{
|
||||
"mesh" : 6,
|
||||
"name" : "bottom-side-col",
|
||||
"translation" : [
|
||||
0,
|
||||
0,
|
||||
23
|
||||
]
|
||||
},
|
||||
{
|
||||
"mesh" : 7,
|
||||
"name" : "bottom-col",
|
||||
"translation" : [
|
||||
0,
|
||||
0,
|
||||
22.700000762939453
|
||||
]
|
||||
},
|
||||
{
|
||||
"mesh" : 8,
|
||||
"name" : "bottom-wheels-col",
|
||||
"translation" : [
|
||||
0,
|
||||
0,
|
||||
17
|
||||
]
|
||||
},
|
||||
{
|
||||
"mesh" : 9,
|
||||
"name" : "wall-internal-col",
|
||||
"translation" : [
|
||||
0,
|
||||
0,
|
||||
17.299999237060547
|
||||
]
|
||||
},
|
||||
{
|
||||
"mesh" : 10,
|
||||
"name" : "roof-floor-range-col",
|
||||
"translation" : [
|
||||
0,
|
||||
0,
|
||||
19.700000762939453
|
||||
]
|
||||
}
|
||||
],
|
||||
"materials" : [
|
||||
{
|
||||
"name" : "Material",
|
||||
"pbrMetallicRoughness" : {
|
||||
"baseColorFactor" : [
|
||||
0.800000011920929,
|
||||
0.800000011920929,
|
||||
0.800000011920929,
|
||||
1
|
||||
],
|
||||
"metallicFactor" : 0,
|
||||
"roughnessFactor" : 0.4000000059604645
|
||||
}
|
||||
}
|
||||
],
|
||||
"meshes" : [
|
||||
{
|
||||
"name" : "Cube",
|
||||
"primitives" : [
|
||||
{
|
||||
"attributes" : {
|
||||
"POSITION" : 0,
|
||||
"NORMAL" : 1,
|
||||
"TEXCOORD_0" : 2
|
||||
},
|
||||
"indices" : 3,
|
||||
"material" : 0
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name" : "Cube.003",
|
||||
"primitives" : [
|
||||
{
|
||||
"attributes" : {
|
||||
"POSITION" : 4,
|
||||
"NORMAL" : 5,
|
||||
"TEXCOORD_0" : 6
|
||||
},
|
||||
"indices" : 7,
|
||||
"material" : 0
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name" : "Cube.004",
|
||||
"primitives" : [
|
||||
{
|
||||
"attributes" : {
|
||||
"POSITION" : 8,
|
||||
"NORMAL" : 9,
|
||||
"TEXCOORD_0" : 10
|
||||
},
|
||||
"indices" : 11,
|
||||
"material" : 0
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name" : "Cube.006",
|
||||
"primitives" : [
|
||||
{
|
||||
"attributes" : {
|
||||
"POSITION" : 12,
|
||||
"NORMAL" : 13,
|
||||
"TEXCOORD_0" : 14
|
||||
},
|
||||
"indices" : 15,
|
||||
"material" : 0
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name" : "Cube.007",
|
||||
"primitives" : [
|
||||
{
|
||||
"attributes" : {
|
||||
"POSITION" : 16,
|
||||
"NORMAL" : 17,
|
||||
"TEXCOORD_0" : 18
|
||||
},
|
||||
"indices" : 19,
|
||||
"material" : 0
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name" : "Cube.008",
|
||||
"primitives" : [
|
||||
{
|
||||
"attributes" : {
|
||||
"POSITION" : 20,
|
||||
"NORMAL" : 21,
|
||||
"TEXCOORD_0" : 22
|
||||
},
|
||||
"indices" : 23,
|
||||
"material" : 0
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name" : "Cube.009",
|
||||
"primitives" : [
|
||||
{
|
||||
"attributes" : {
|
||||
"POSITION" : 24,
|
||||
"NORMAL" : 25,
|
||||
"TEXCOORD_0" : 26
|
||||
},
|
||||
"indices" : 27,
|
||||
"material" : 0
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name" : "Cube.010",
|
||||
"primitives" : [
|
||||
{
|
||||
"attributes" : {
|
||||
"POSITION" : 28,
|
||||
"NORMAL" : 29,
|
||||
"TEXCOORD_0" : 30
|
||||
},
|
||||
"indices" : 31,
|
||||
"material" : 0
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name" : "Cube.011",
|
||||
"primitives" : [
|
||||
{
|
||||
"attributes" : {
|
||||
"POSITION" : 32,
|
||||
"NORMAL" : 33,
|
||||
"TEXCOORD_0" : 34
|
||||
},
|
||||
"indices" : 35,
|
||||
"material" : 0
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name" : "Cube.012",
|
||||
"primitives" : [
|
||||
{
|
||||
"attributes" : {
|
||||
"POSITION" : 36,
|
||||
"NORMAL" : 37,
|
||||
"TEXCOORD_0" : 38
|
||||
},
|
||||
"indices" : 39,
|
||||
"material" : 0
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name" : "Cube.013",
|
||||
"primitives" : [
|
||||
{
|
||||
"attributes" : {
|
||||
"POSITION" : 40,
|
||||
"NORMAL" : 41,
|
||||
"TEXCOORD_0" : 42
|
||||
},
|
||||
"indices" : 43,
|
||||
"material" : 0
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"accessors" : [
|
||||
{
|
||||
"bufferView" : 0,
|
||||
"componentType" : 5126,
|
||||
"count" : 64,
|
||||
"max" : [
|
||||
1.7999999523162842,
|
||||
4.5,
|
||||
0.09999996423721313
|
||||
],
|
||||
"min" : [
|
||||
-1.8000000715255737,
|
||||
0.800000011920929,
|
||||
5.960464477539063e-08
|
||||
],
|
||||
"type" : "VEC3"
|
||||
},
|
||||
{
|
||||
"bufferView" : 1,
|
||||
"componentType" : 5126,
|
||||
"count" : 64,
|
||||
"type" : "VEC3"
|
||||
},
|
||||
{
|
||||
"bufferView" : 2,
|
||||
"componentType" : 5126,
|
||||
"count" : 64,
|
||||
"type" : "VEC2"
|
||||
},
|
||||
{
|
||||
"bufferView" : 3,
|
||||
"componentType" : 5123,
|
||||
"count" : 108,
|
||||
"type" : "SCALAR"
|
||||
},
|
||||
{
|
||||
"bufferView" : 4,
|
||||
"componentType" : 5126,
|
||||
"count" : 56,
|
||||
"max" : [
|
||||
1.8000000715255737,
|
||||
4.5,
|
||||
0
|
||||
],
|
||||
"min" : [
|
||||
-1.8000000715255737,
|
||||
0.800000011920929,
|
||||
-2
|
||||
],
|
||||
"type" : "VEC3"
|
||||
},
|
||||
{
|
||||
"bufferView" : 5,
|
||||
"componentType" : 5126,
|
||||
"count" : 56,
|
||||
"type" : "VEC3"
|
||||
},
|
||||
{
|
||||
"bufferView" : 6,
|
||||
"componentType" : 5126,
|
||||
"count" : 56,
|
||||
"type" : "VEC2"
|
||||
},
|
||||
{
|
||||
"bufferView" : 7,
|
||||
"componentType" : 5123,
|
||||
"count" : 84,
|
||||
"type" : "SCALAR"
|
||||
},
|
||||
{
|
||||
"bufferView" : 8,
|
||||
"componentType" : 5126,
|
||||
"count" : 20,
|
||||
"max" : [
|
||||
1.8000000715255737,
|
||||
3.6000001430511475,
|
||||
0
|
||||
],
|
||||
"min" : [
|
||||
1.7000000476837158,
|
||||
0.800000011920929,
|
||||
-2
|
||||
],
|
||||
"type" : "VEC3"
|
||||
},
|
||||
{
|
||||
"bufferView" : 9,
|
||||
"componentType" : 5126,
|
||||
"count" : 20,
|
||||
"type" : "VEC3"
|
||||
},
|
||||
{
|
||||
"bufferView" : 10,
|
||||
"componentType" : 5126,
|
||||
"count" : 20,
|
||||
"type" : "VEC2"
|
||||
},
|
||||
{
|
||||
"bufferView" : 11,
|
||||
"componentType" : 5123,
|
||||
"count" : 36,
|
||||
"type" : "SCALAR"
|
||||
},
|
||||
{
|
||||
"bufferView" : 12,
|
||||
"componentType" : 5126,
|
||||
"count" : 84,
|
||||
"max" : [
|
||||
1.8000000715255737,
|
||||
3.6000001430511475,
|
||||
0
|
||||
],
|
||||
"min" : [
|
||||
1.7000000476837158,
|
||||
0.800000011920929,
|
||||
-2
|
||||
],
|
||||
"type" : "VEC3"
|
||||
},
|
||||
{
|
||||
"bufferView" : 13,
|
||||
"componentType" : 5126,
|
||||
"count" : 84,
|
||||
"type" : "VEC3"
|
||||
},
|
||||
{
|
||||
"bufferView" : 14,
|
||||
"componentType" : 5126,
|
||||
"count" : 84,
|
||||
"type" : "VEC2"
|
||||
},
|
||||
{
|
||||
"bufferView" : 15,
|
||||
"componentType" : 5123,
|
||||
"count" : 192,
|
||||
"type" : "SCALAR"
|
||||
},
|
||||
{
|
||||
"bufferView" : 16,
|
||||
"componentType" : 5126,
|
||||
"count" : 76,
|
||||
"max" : [
|
||||
1.8000000715255737,
|
||||
3.6000001430511475,
|
||||
0
|
||||
],
|
||||
"min" : [
|
||||
1.7000000476837158,
|
||||
0.800000011920929,
|
||||
-2
|
||||
],
|
||||
"type" : "VEC3"
|
||||
},
|
||||
{
|
||||
"bufferView" : 17,
|
||||
"componentType" : 5126,
|
||||
"count" : 76,
|
||||
"type" : "VEC3"
|
||||
},
|
||||
{
|
||||
"bufferView" : 18,
|
||||
"componentType" : 5126,
|
||||
"count" : 76,
|
||||
"type" : "VEC2"
|
||||
},
|
||||
{
|
||||
"bufferView" : 19,
|
||||
"componentType" : 5123,
|
||||
"count" : 192,
|
||||
"type" : "SCALAR"
|
||||
},
|
||||
{
|
||||
"bufferView" : 20,
|
||||
"componentType" : 5126,
|
||||
"count" : 609,
|
||||
"max" : [
|
||||
5.500000476837158,
|
||||
3.6000001430511475,
|
||||
0
|
||||
],
|
||||
"min" : [
|
||||
1.7000000476837158,
|
||||
-0.20000000298023224,
|
||||
-2
|
||||
],
|
||||
"type" : "VEC3"
|
||||
},
|
||||
{
|
||||
"bufferView" : 21,
|
||||
"componentType" : 5126,
|
||||
"count" : 609,
|
||||
"type" : "VEC3"
|
||||
},
|
||||
{
|
||||
"bufferView" : 22,
|
||||
"componentType" : 5126,
|
||||
"count" : 609,
|
||||
"type" : "VEC2"
|
||||
},
|
||||
{
|
||||
"bufferView" : 23,
|
||||
"componentType" : 5123,
|
||||
"count" : 1650,
|
||||
"type" : "SCALAR"
|
||||
},
|
||||
{
|
||||
"bufferView" : 24,
|
||||
"componentType" : 5126,
|
||||
"count" : 20,
|
||||
"max" : [
|
||||
1.7999999523162842,
|
||||
0.800000011920929,
|
||||
0.10000001639127731
|
||||
],
|
||||
"min" : [
|
||||
-1.7999999523162842,
|
||||
0,
|
||||
-2.2351741790771484e-08
|
||||
],
|
||||
"type" : "VEC3"
|
||||
},
|
||||
{
|
||||
"bufferView" : 25,
|
||||
"componentType" : 5126,
|
||||
"count" : 20,
|
||||
"type" : "VEC3"
|
||||
},
|
||||
{
|
||||
"bufferView" : 26,
|
||||
"componentType" : 5126,
|
||||
"count" : 20,
|
||||
"type" : "VEC2"
|
||||
},
|
||||
{
|
||||
"bufferView" : 27,
|
||||
"componentType" : 5123,
|
||||
"count" : 30,
|
||||
"type" : "SCALAR"
|
||||
},
|
||||
{
|
||||
"bufferView" : 28,
|
||||
"componentType" : 5126,
|
||||
"count" : 12,
|
||||
"max" : [
|
||||
1.7999999523162842,
|
||||
0.800000011920929,
|
||||
1.4901161193847656e-08
|
||||
],
|
||||
"min" : [
|
||||
-1.7999999523162842,
|
||||
0,
|
||||
-2
|
||||
],
|
||||
"type" : "VEC3"
|
||||
},
|
||||
{
|
||||
"bufferView" : 29,
|
||||
"componentType" : 5126,
|
||||
"count" : 12,
|
||||
"type" : "VEC3"
|
||||
},
|
||||
{
|
||||
"bufferView" : 30,
|
||||
"componentType" : 5126,
|
||||
"count" : 12,
|
||||
"type" : "VEC2"
|
||||
},
|
||||
{
|
||||
"bufferView" : 31,
|
||||
"componentType" : 5123,
|
||||
"count" : 18,
|
||||
"type" : "SCALAR"
|
||||
},
|
||||
{
|
||||
"bufferView" : 32,
|
||||
"componentType" : 5126,
|
||||
"count" : 20928,
|
||||
"max" : [
|
||||
1.8000000715255737,
|
||||
0.800000011920929,
|
||||
1.1473894119262695e-06
|
||||
],
|
||||
"min" : [
|
||||
-1.8000000715255737,
|
||||
-0.058527711778879166,
|
||||
-2.000000238418579
|
||||
],
|
||||
"type" : "VEC3"
|
||||
},
|
||||
{
|
||||
"bufferView" : 33,
|
||||
"componentType" : 5126,
|
||||
"count" : 20928,
|
||||
"type" : "VEC3"
|
||||
},
|
||||
{
|
||||
"bufferView" : 34,
|
||||
"componentType" : 5126,
|
||||
"count" : 20928,
|
||||
"type" : "VEC2"
|
||||
},
|
||||
{
|
||||
"bufferView" : 35,
|
||||
"componentType" : 5123,
|
||||
"count" : 31008,
|
||||
"type" : "SCALAR"
|
||||
},
|
||||
{
|
||||
"bufferView" : 36,
|
||||
"componentType" : 5126,
|
||||
"count" : 114,
|
||||
"max" : [
|
||||
1.7000000476837158,
|
||||
4.300000190734863,
|
||||
0.10000038146972656
|
||||
],
|
||||
"min" : [
|
||||
-1.7000000476837158,
|
||||
0.9000000357627869,
|
||||
0
|
||||
],
|
||||
"type" : "VEC3"
|
||||
},
|
||||
{
|
||||
"bufferView" : 37,
|
||||
"componentType" : 5126,
|
||||
"count" : 114,
|
||||
"type" : "VEC3"
|
||||
},
|
||||
{
|
||||
"bufferView" : 38,
|
||||
"componentType" : 5126,
|
||||
"count" : 114,
|
||||
"type" : "VEC2"
|
||||
},
|
||||
{
|
||||
"bufferView" : 39,
|
||||
"componentType" : 5123,
|
||||
"count" : 276,
|
||||
"type" : "SCALAR"
|
||||
},
|
||||
{
|
||||
"bufferView" : 40,
|
||||
"componentType" : 5126,
|
||||
"count" : 180,
|
||||
"max" : [
|
||||
1.8000000715255737,
|
||||
4.800000190734863,
|
||||
0
|
||||
],
|
||||
"min" : [
|
||||
-1.8000000715255737,
|
||||
0.800000011920929,
|
||||
-2
|
||||
],
|
||||
"type" : "VEC3"
|
||||
},
|
||||
{
|
||||
"bufferView" : 41,
|
||||
"componentType" : 5126,
|
||||
"count" : 180,
|
||||
"type" : "VEC3"
|
||||
},
|
||||
{
|
||||
"bufferView" : 42,
|
||||
"componentType" : 5126,
|
||||
"count" : 180,
|
||||
"type" : "VEC2"
|
||||
},
|
||||
{
|
||||
"bufferView" : 43,
|
||||
"componentType" : 5123,
|
||||
"count" : 312,
|
||||
"type" : "SCALAR"
|
||||
}
|
||||
],
|
||||
"bufferViews" : [
|
||||
{
|
||||
"buffer" : 0,
|
||||
"byteLength" : 768,
|
||||
"byteOffset" : 0
|
||||
},
|
||||
{
|
||||
"buffer" : 0,
|
||||
"byteLength" : 768,
|
||||
"byteOffset" : 768
|
||||
},
|
||||
{
|
||||
"buffer" : 0,
|
||||
"byteLength" : 512,
|
||||
"byteOffset" : 1536
|
||||
},
|
||||
{
|
||||
"buffer" : 0,
|
||||
"byteLength" : 216,
|
||||
"byteOffset" : 2048
|
||||
},
|
||||
{
|
||||
"buffer" : 0,
|
||||
"byteLength" : 672,
|
||||
"byteOffset" : 2264
|
||||
},
|
||||
{
|
||||
"buffer" : 0,
|
||||
"byteLength" : 672,
|
||||
"byteOffset" : 2936
|
||||
},
|
||||
{
|
||||
"buffer" : 0,
|
||||
"byteLength" : 448,
|
||||
"byteOffset" : 3608
|
||||
},
|
||||
{
|
||||
"buffer" : 0,
|
||||
"byteLength" : 168,
|
||||
"byteOffset" : 4056
|
||||
},
|
||||
{
|
||||
"buffer" : 0,
|
||||
"byteLength" : 240,
|
||||
"byteOffset" : 4224
|
||||
},
|
||||
{
|
||||
"buffer" : 0,
|
||||
"byteLength" : 240,
|
||||
"byteOffset" : 4464
|
||||
},
|
||||
{
|
||||
"buffer" : 0,
|
||||
"byteLength" : 160,
|
||||
"byteOffset" : 4704
|
||||
},
|
||||
{
|
||||
"buffer" : 0,
|
||||
"byteLength" : 72,
|
||||
"byteOffset" : 4864
|
||||
},
|
||||
{
|
||||
"buffer" : 0,
|
||||
"byteLength" : 1008,
|
||||
"byteOffset" : 4936
|
||||
},
|
||||
{
|
||||
"buffer" : 0,
|
||||
"byteLength" : 1008,
|
||||
"byteOffset" : 5944
|
||||
},
|
||||
{
|
||||
"buffer" : 0,
|
||||
"byteLength" : 672,
|
||||
"byteOffset" : 6952
|
||||
},
|
||||
{
|
||||
"buffer" : 0,
|
||||
"byteLength" : 384,
|
||||
"byteOffset" : 7624
|
||||
},
|
||||
{
|
||||
"buffer" : 0,
|
||||
"byteLength" : 912,
|
||||
"byteOffset" : 8008
|
||||
},
|
||||
{
|
||||
"buffer" : 0,
|
||||
"byteLength" : 912,
|
||||
"byteOffset" : 8920
|
||||
},
|
||||
{
|
||||
"buffer" : 0,
|
||||
"byteLength" : 608,
|
||||
"byteOffset" : 9832
|
||||
},
|
||||
{
|
||||
"buffer" : 0,
|
||||
"byteLength" : 384,
|
||||
"byteOffset" : 10440
|
||||
},
|
||||
{
|
||||
"buffer" : 0,
|
||||
"byteLength" : 7308,
|
||||
"byteOffset" : 10824
|
||||
},
|
||||
{
|
||||
"buffer" : 0,
|
||||
"byteLength" : 7308,
|
||||
"byteOffset" : 18132
|
||||
},
|
||||
{
|
||||
"buffer" : 0,
|
||||
"byteLength" : 4872,
|
||||
"byteOffset" : 25440
|
||||
},
|
||||
{
|
||||
"buffer" : 0,
|
||||
"byteLength" : 3300,
|
||||
"byteOffset" : 30312
|
||||
},
|
||||
{
|
||||
"buffer" : 0,
|
||||
"byteLength" : 240,
|
||||
"byteOffset" : 33612
|
||||
},
|
||||
{
|
||||
"buffer" : 0,
|
||||
"byteLength" : 240,
|
||||
"byteOffset" : 33852
|
||||
},
|
||||
{
|
||||
"buffer" : 0,
|
||||
"byteLength" : 160,
|
||||
"byteOffset" : 34092
|
||||
},
|
||||
{
|
||||
"buffer" : 0,
|
||||
"byteLength" : 60,
|
||||
"byteOffset" : 34252
|
||||
},
|
||||
{
|
||||
"buffer" : 0,
|
||||
"byteLength" : 144,
|
||||
"byteOffset" : 34312
|
||||
},
|
||||
{
|
||||
"buffer" : 0,
|
||||
"byteLength" : 144,
|
||||
"byteOffset" : 34456
|
||||
},
|
||||
{
|
||||
"buffer" : 0,
|
||||
"byteLength" : 96,
|
||||
"byteOffset" : 34600
|
||||
},
|
||||
{
|
||||
"buffer" : 0,
|
||||
"byteLength" : 36,
|
||||
"byteOffset" : 34696
|
||||
},
|
||||
{
|
||||
"buffer" : 0,
|
||||
"byteLength" : 251136,
|
||||
"byteOffset" : 34732
|
||||
},
|
||||
{
|
||||
"buffer" : 0,
|
||||
"byteLength" : 251136,
|
||||
"byteOffset" : 285868
|
||||
},
|
||||
{
|
||||
"buffer" : 0,
|
||||
"byteLength" : 167424,
|
||||
"byteOffset" : 537004
|
||||
},
|
||||
{
|
||||
"buffer" : 0,
|
||||
"byteLength" : 62016,
|
||||
"byteOffset" : 704428
|
||||
},
|
||||
{
|
||||
"buffer" : 0,
|
||||
"byteLength" : 1368,
|
||||
"byteOffset" : 766444
|
||||
},
|
||||
{
|
||||
"buffer" : 0,
|
||||
"byteLength" : 1368,
|
||||
"byteOffset" : 767812
|
||||
},
|
||||
{
|
||||
"buffer" : 0,
|
||||
"byteLength" : 912,
|
||||
"byteOffset" : 769180
|
||||
},
|
||||
{
|
||||
"buffer" : 0,
|
||||
"byteLength" : 552,
|
||||
"byteOffset" : 770092
|
||||
},
|
||||
{
|
||||
"buffer" : 0,
|
||||
"byteLength" : 2160,
|
||||
"byteOffset" : 770644
|
||||
},
|
||||
{
|
||||
"buffer" : 0,
|
||||
"byteLength" : 2160,
|
||||
"byteOffset" : 772804
|
||||
},
|
||||
{
|
||||
"buffer" : 0,
|
||||
"byteLength" : 1440,
|
||||
"byteOffset" : 774964
|
||||
},
|
||||
{
|
||||
"buffer" : 0,
|
||||
"byteLength" : 624,
|
||||
"byteOffset" : 776404
|
||||
}
|
||||
],
|
||||
"buffers" : [
|
||||
{
|
||||
"byteLength" : 777028,
|
||||
"uri" : "trailer-house.bin"
|
||||
}
|
||||
]
|
||||
}
|
||||
1064
objects/trailer-house.gltf.import
Normal file
1064
objects/trailer-house.gltf.import
Normal file
File diff suppressed because it is too large
Load Diff
6
objects/trailer-house.tscn
Normal file
6
objects/trailer-house.tscn
Normal file
@@ -0,0 +1,6 @@
|
||||
[gd_scene load_steps=2 format=2]
|
||||
|
||||
[ext_resource path="res://objects/trailer-house.gd" type="Script" id=1]
|
||||
|
||||
[node name="trailer-house" type="Spatial"]
|
||||
script = ExtResource( 1 )
|
||||
BIN
road/road.material
Normal file
BIN
road/road.material
Normal file
Binary file not shown.
BIN
road/road.png
Normal file
BIN
road/road.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 26 KiB |
37
road/road.png.import
Normal file
37
road/road.png.import
Normal file
@@ -0,0 +1,37 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path.s3tc="res://.import/road.png-e38b879061cdfd560f1fe665b2e0de1f.s3tc.stex"
|
||||
path.etc2="res://.import/road.png-e38b879061cdfd560f1fe665b2e0de1f.etc2.stex"
|
||||
metadata={
|
||||
"imported_formats": [ "s3tc", "etc2" ],
|
||||
"vram_texture": true
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://road/road.png"
|
||||
dest_files=[ "res://.import/road.png-e38b879061cdfd560f1fe665b2e0de1f.s3tc.stex", "res://.import/road.png-e38b879061cdfd560f1fe665b2e0de1f.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
|
||||
BIN
road/road_elements.bin
Normal file
BIN
road/road_elements.bin
Normal file
Binary file not shown.
600
road/road_elements.gltf
Normal file
600
road/road_elements.gltf
Normal file
@@ -0,0 +1,600 @@
|
||||
{
|
||||
"asset" : {
|
||||
"generator" : "Khronos glTF Blender I/O v1.5.17",
|
||||
"version" : "2.0"
|
||||
},
|
||||
"scene" : 0,
|
||||
"scenes" : [
|
||||
{
|
||||
"name" : "Scene",
|
||||
"nodes" : [
|
||||
0,
|
||||
1,
|
||||
2,
|
||||
3,
|
||||
4,
|
||||
5,
|
||||
6
|
||||
]
|
||||
}
|
||||
],
|
||||
"nodes" : [
|
||||
{
|
||||
"mesh" : 0,
|
||||
"name" : "road_main"
|
||||
},
|
||||
{
|
||||
"mesh" : 1,
|
||||
"name" : "sidewalk_start",
|
||||
"translation" : [
|
||||
3,
|
||||
0,
|
||||
0
|
||||
]
|
||||
},
|
||||
{
|
||||
"mesh" : 2,
|
||||
"name" : "sidewalk",
|
||||
"translation" : [
|
||||
4,
|
||||
0,
|
||||
0
|
||||
]
|
||||
},
|
||||
{
|
||||
"mesh" : 3,
|
||||
"name" : "sidewalk_end2",
|
||||
"translation" : [
|
||||
7.100000381469727,
|
||||
0,
|
||||
0
|
||||
]
|
||||
},
|
||||
{
|
||||
"mesh" : 4,
|
||||
"name" : "sidewalk_end",
|
||||
"translation" : [
|
||||
7.600000381469727,
|
||||
0,
|
||||
0
|
||||
]
|
||||
},
|
||||
{
|
||||
"mesh" : 5,
|
||||
"name" : "road_main.001",
|
||||
"translation" : [
|
||||
9.899999618530273,
|
||||
0,
|
||||
0
|
||||
]
|
||||
},
|
||||
{
|
||||
"mesh" : 6,
|
||||
"name" : "wall",
|
||||
"translation" : [
|
||||
13,
|
||||
0,
|
||||
0
|
||||
]
|
||||
}
|
||||
],
|
||||
"materials" : [
|
||||
{
|
||||
"doubleSided" : true,
|
||||
"name" : "road",
|
||||
"pbrMetallicRoughness" : {
|
||||
"baseColorTexture" : {
|
||||
"index" : 0
|
||||
},
|
||||
"metallicFactor" : 0.03030303120613098
|
||||
}
|
||||
}
|
||||
],
|
||||
"meshes" : [
|
||||
{
|
||||
"name" : "Cube",
|
||||
"primitives" : [
|
||||
{
|
||||
"attributes" : {
|
||||
"POSITION" : 0,
|
||||
"NORMAL" : 1,
|
||||
"TEXCOORD_0" : 2
|
||||
},
|
||||
"indices" : 3,
|
||||
"material" : 0
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name" : "Cube.001",
|
||||
"primitives" : [
|
||||
{
|
||||
"attributes" : {
|
||||
"POSITION" : 4,
|
||||
"NORMAL" : 5,
|
||||
"TEXCOORD_0" : 6
|
||||
},
|
||||
"indices" : 7,
|
||||
"material" : 0
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name" : "Cube.002",
|
||||
"primitives" : [
|
||||
{
|
||||
"attributes" : {
|
||||
"POSITION" : 8,
|
||||
"NORMAL" : 9,
|
||||
"TEXCOORD_0" : 10
|
||||
},
|
||||
"indices" : 11,
|
||||
"material" : 0
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name" : "Cube.004",
|
||||
"primitives" : [
|
||||
{
|
||||
"attributes" : {
|
||||
"POSITION" : 12,
|
||||
"NORMAL" : 13,
|
||||
"TEXCOORD_0" : 14
|
||||
},
|
||||
"indices" : 15,
|
||||
"material" : 0
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name" : "Cube.005",
|
||||
"primitives" : [
|
||||
{
|
||||
"attributes" : {
|
||||
"POSITION" : 16,
|
||||
"NORMAL" : 17,
|
||||
"TEXCOORD_0" : 18
|
||||
},
|
||||
"indices" : 19,
|
||||
"material" : 0
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name" : "Cube.003",
|
||||
"primitives" : [
|
||||
{
|
||||
"attributes" : {
|
||||
"POSITION" : 20,
|
||||
"NORMAL" : 21,
|
||||
"TEXCOORD_0" : 22
|
||||
},
|
||||
"indices" : 23,
|
||||
"material" : 0
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name" : "Cube.006",
|
||||
"primitives" : [
|
||||
{
|
||||
"attributes" : {
|
||||
"POSITION" : 24,
|
||||
"NORMAL" : 25,
|
||||
"TEXCOORD_0" : 26
|
||||
},
|
||||
"indices" : 27,
|
||||
"material" : 0
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"textures" : [
|
||||
{
|
||||
"sampler" : 0,
|
||||
"source" : 0
|
||||
}
|
||||
],
|
||||
"images" : [
|
||||
{
|
||||
"mimeType" : "image/png",
|
||||
"name" : "road",
|
||||
"uri" : "road.png"
|
||||
}
|
||||
],
|
||||
"accessors" : [
|
||||
{
|
||||
"bufferView" : 0,
|
||||
"componentType" : 5126,
|
||||
"count" : 36,
|
||||
"max" : [
|
||||
3,
|
||||
0.025044016540050507,
|
||||
0
|
||||
],
|
||||
"min" : [
|
||||
0,
|
||||
-1,
|
||||
-2
|
||||
],
|
||||
"type" : "VEC3"
|
||||
},
|
||||
{
|
||||
"bufferView" : 1,
|
||||
"componentType" : 5126,
|
||||
"count" : 36,
|
||||
"type" : "VEC3"
|
||||
},
|
||||
{
|
||||
"bufferView" : 2,
|
||||
"componentType" : 5126,
|
||||
"count" : 36,
|
||||
"type" : "VEC2"
|
||||
},
|
||||
{
|
||||
"bufferView" : 3,
|
||||
"componentType" : 5123,
|
||||
"count" : 60,
|
||||
"type" : "SCALAR"
|
||||
},
|
||||
{
|
||||
"bufferView" : 4,
|
||||
"componentType" : 5126,
|
||||
"count" : 32,
|
||||
"max" : [
|
||||
0.40047407150268555,
|
||||
0.20047391951084137,
|
||||
0
|
||||
],
|
||||
"min" : [
|
||||
0,
|
||||
-1,
|
||||
-2
|
||||
],
|
||||
"type" : "VEC3"
|
||||
},
|
||||
{
|
||||
"bufferView" : 5,
|
||||
"componentType" : 5126,
|
||||
"count" : 32,
|
||||
"type" : "VEC3"
|
||||
},
|
||||
{
|
||||
"bufferView" : 6,
|
||||
"componentType" : 5126,
|
||||
"count" : 32,
|
||||
"type" : "VEC2"
|
||||
},
|
||||
{
|
||||
"bufferView" : 7,
|
||||
"componentType" : 5123,
|
||||
"count" : 48,
|
||||
"type" : "SCALAR"
|
||||
},
|
||||
{
|
||||
"bufferView" : 8,
|
||||
"componentType" : 5126,
|
||||
"count" : 20,
|
||||
"max" : [
|
||||
2,
|
||||
0.21363025903701782,
|
||||
0
|
||||
],
|
||||
"min" : [
|
||||
0,
|
||||
-1,
|
||||
-2
|
||||
],
|
||||
"type" : "VEC3"
|
||||
},
|
||||
{
|
||||
"bufferView" : 9,
|
||||
"componentType" : 5126,
|
||||
"count" : 20,
|
||||
"type" : "VEC3"
|
||||
},
|
||||
{
|
||||
"bufferView" : 10,
|
||||
"componentType" : 5126,
|
||||
"count" : 20,
|
||||
"type" : "VEC2"
|
||||
},
|
||||
{
|
||||
"bufferView" : 11,
|
||||
"componentType" : 5123,
|
||||
"count" : 30,
|
||||
"type" : "SCALAR"
|
||||
},
|
||||
{
|
||||
"bufferView" : 12,
|
||||
"componentType" : 5126,
|
||||
"count" : 42,
|
||||
"max" : [
|
||||
0.405000776052475,
|
||||
0.20000000298023224,
|
||||
0
|
||||
],
|
||||
"min" : [
|
||||
-2.477318048477173e-07,
|
||||
-1,
|
||||
-2
|
||||
],
|
||||
"type" : "VEC3"
|
||||
},
|
||||
{
|
||||
"bufferView" : 13,
|
||||
"componentType" : 5126,
|
||||
"count" : 42,
|
||||
"type" : "VEC3"
|
||||
},
|
||||
{
|
||||
"bufferView" : 14,
|
||||
"componentType" : 5126,
|
||||
"count" : 42,
|
||||
"type" : "VEC2"
|
||||
},
|
||||
{
|
||||
"bufferView" : 15,
|
||||
"componentType" : 5123,
|
||||
"count" : 66,
|
||||
"type" : "SCALAR"
|
||||
},
|
||||
{
|
||||
"bufferView" : 16,
|
||||
"componentType" : 5126,
|
||||
"count" : 46,
|
||||
"max" : [
|
||||
2.205000877380371,
|
||||
0.19999998807907104,
|
||||
0
|
||||
],
|
||||
"min" : [
|
||||
-2.477318048477173e-07,
|
||||
-1,
|
||||
-2
|
||||
],
|
||||
"type" : "VEC3"
|
||||
},
|
||||
{
|
||||
"bufferView" : 17,
|
||||
"componentType" : 5126,
|
||||
"count" : 46,
|
||||
"type" : "VEC3"
|
||||
},
|
||||
{
|
||||
"bufferView" : 18,
|
||||
"componentType" : 5126,
|
||||
"count" : 46,
|
||||
"type" : "VEC2"
|
||||
},
|
||||
{
|
||||
"bufferView" : 19,
|
||||
"componentType" : 5123,
|
||||
"count" : 72,
|
||||
"type" : "SCALAR"
|
||||
},
|
||||
{
|
||||
"bufferView" : 20,
|
||||
"componentType" : 5126,
|
||||
"count" : 26,
|
||||
"max" : [
|
||||
3,
|
||||
0.025044016540050507,
|
||||
0
|
||||
],
|
||||
"min" : [
|
||||
0,
|
||||
-1,
|
||||
-2
|
||||
],
|
||||
"type" : "VEC3"
|
||||
},
|
||||
{
|
||||
"bufferView" : 21,
|
||||
"componentType" : 5126,
|
||||
"count" : 26,
|
||||
"type" : "VEC3"
|
||||
},
|
||||
{
|
||||
"bufferView" : 22,
|
||||
"componentType" : 5126,
|
||||
"count" : 26,
|
||||
"type" : "VEC2"
|
||||
},
|
||||
{
|
||||
"bufferView" : 23,
|
||||
"componentType" : 5123,
|
||||
"count" : 42,
|
||||
"type" : "SCALAR"
|
||||
},
|
||||
{
|
||||
"bufferView" : 24,
|
||||
"componentType" : 5126,
|
||||
"count" : 326,
|
||||
"max" : [
|
||||
1.4000005722045898,
|
||||
3,
|
||||
0
|
||||
],
|
||||
"min" : [
|
||||
0,
|
||||
-1,
|
||||
-2
|
||||
],
|
||||
"type" : "VEC3"
|
||||
},
|
||||
{
|
||||
"bufferView" : 25,
|
||||
"componentType" : 5126,
|
||||
"count" : 326,
|
||||
"type" : "VEC3"
|
||||
},
|
||||
{
|
||||
"bufferView" : 26,
|
||||
"componentType" : 5126,
|
||||
"count" : 326,
|
||||
"type" : "VEC2"
|
||||
},
|
||||
{
|
||||
"bufferView" : 27,
|
||||
"componentType" : 5123,
|
||||
"count" : 600,
|
||||
"type" : "SCALAR"
|
||||
}
|
||||
],
|
||||
"bufferViews" : [
|
||||
{
|
||||
"buffer" : 0,
|
||||
"byteLength" : 432,
|
||||
"byteOffset" : 0
|
||||
},
|
||||
{
|
||||
"buffer" : 0,
|
||||
"byteLength" : 432,
|
||||
"byteOffset" : 432
|
||||
},
|
||||
{
|
||||
"buffer" : 0,
|
||||
"byteLength" : 288,
|
||||
"byteOffset" : 864
|
||||
},
|
||||
{
|
||||
"buffer" : 0,
|
||||
"byteLength" : 120,
|
||||
"byteOffset" : 1152
|
||||
},
|
||||
{
|
||||
"buffer" : 0,
|
||||
"byteLength" : 384,
|
||||
"byteOffset" : 1272
|
||||
},
|
||||
{
|
||||
"buffer" : 0,
|
||||
"byteLength" : 384,
|
||||
"byteOffset" : 1656
|
||||
},
|
||||
{
|
||||
"buffer" : 0,
|
||||
"byteLength" : 256,
|
||||
"byteOffset" : 2040
|
||||
},
|
||||
{
|
||||
"buffer" : 0,
|
||||
"byteLength" : 96,
|
||||
"byteOffset" : 2296
|
||||
},
|
||||
{
|
||||
"buffer" : 0,
|
||||
"byteLength" : 240,
|
||||
"byteOffset" : 2392
|
||||
},
|
||||
{
|
||||
"buffer" : 0,
|
||||
"byteLength" : 240,
|
||||
"byteOffset" : 2632
|
||||
},
|
||||
{
|
||||
"buffer" : 0,
|
||||
"byteLength" : 160,
|
||||
"byteOffset" : 2872
|
||||
},
|
||||
{
|
||||
"buffer" : 0,
|
||||
"byteLength" : 60,
|
||||
"byteOffset" : 3032
|
||||
},
|
||||
{
|
||||
"buffer" : 0,
|
||||
"byteLength" : 504,
|
||||
"byteOffset" : 3092
|
||||
},
|
||||
{
|
||||
"buffer" : 0,
|
||||
"byteLength" : 504,
|
||||
"byteOffset" : 3596
|
||||
},
|
||||
{
|
||||
"buffer" : 0,
|
||||
"byteLength" : 336,
|
||||
"byteOffset" : 4100
|
||||
},
|
||||
{
|
||||
"buffer" : 0,
|
||||
"byteLength" : 132,
|
||||
"byteOffset" : 4436
|
||||
},
|
||||
{
|
||||
"buffer" : 0,
|
||||
"byteLength" : 552,
|
||||
"byteOffset" : 4568
|
||||
},
|
||||
{
|
||||
"buffer" : 0,
|
||||
"byteLength" : 552,
|
||||
"byteOffset" : 5120
|
||||
},
|
||||
{
|
||||
"buffer" : 0,
|
||||
"byteLength" : 368,
|
||||
"byteOffset" : 5672
|
||||
},
|
||||
{
|
||||
"buffer" : 0,
|
||||
"byteLength" : 144,
|
||||
"byteOffset" : 6040
|
||||
},
|
||||
{
|
||||
"buffer" : 0,
|
||||
"byteLength" : 312,
|
||||
"byteOffset" : 6184
|
||||
},
|
||||
{
|
||||
"buffer" : 0,
|
||||
"byteLength" : 312,
|
||||
"byteOffset" : 6496
|
||||
},
|
||||
{
|
||||
"buffer" : 0,
|
||||
"byteLength" : 208,
|
||||
"byteOffset" : 6808
|
||||
},
|
||||
{
|
||||
"buffer" : 0,
|
||||
"byteLength" : 84,
|
||||
"byteOffset" : 7016
|
||||
},
|
||||
{
|
||||
"buffer" : 0,
|
||||
"byteLength" : 3912,
|
||||
"byteOffset" : 7100
|
||||
},
|
||||
{
|
||||
"buffer" : 0,
|
||||
"byteLength" : 3912,
|
||||
"byteOffset" : 11012
|
||||
},
|
||||
{
|
||||
"buffer" : 0,
|
||||
"byteLength" : 2608,
|
||||
"byteOffset" : 14924
|
||||
},
|
||||
{
|
||||
"buffer" : 0,
|
||||
"byteLength" : 1200,
|
||||
"byteOffset" : 17532
|
||||
}
|
||||
],
|
||||
"samplers" : [
|
||||
{
|
||||
"magFilter" : 9729,
|
||||
"minFilter" : 9987
|
||||
}
|
||||
],
|
||||
"buffers" : [
|
||||
{
|
||||
"byteLength" : 18732,
|
||||
"uri" : "road_elements.bin"
|
||||
}
|
||||
]
|
||||
}
|
||||
1064
road/road_elements.gltf.import
Normal file
1064
road/road_elements.gltf.import
Normal file
File diff suppressed because it is too large
Load Diff
20
scripts/import/car_import.gd
Normal file
20
scripts/import/car_import.gd
Normal file
@@ -0,0 +1,20 @@
|
||||
tool
|
||||
extends EditorScenePostImport
|
||||
|
||||
func post_import(scene):
|
||||
var queue = [scene]
|
||||
while queue.size() > 0:
|
||||
var item = queue.pop_front()
|
||||
if item is MeshInstance:
|
||||
if item.name == "car_base":
|
||||
var shape = item.mesh.create_convex_shape()
|
||||
var cs = CollisionShape.new()
|
||||
cs.shape = shape
|
||||
cs.name = item.name + "_shape"
|
||||
scene.add_child(cs)
|
||||
cs.owner = scene
|
||||
print("generated collision shape")
|
||||
break
|
||||
for e in item.get_children():
|
||||
queue.push_back(e)
|
||||
return scene
|
||||
14
scripts/import/import_clothes.gd
Normal file
14
scripts/import/import_clothes.gd
Normal file
@@ -0,0 +1,14 @@
|
||||
tool
|
||||
extends EditorScenePostImport
|
||||
|
||||
func post_import(scene):
|
||||
var queue = [scene]
|
||||
var d = "res://scenes/clothes/"
|
||||
while queue.size() > 0:
|
||||
var g = queue.pop_front()
|
||||
if g is MeshInstance:
|
||||
ResourceSaver.save(d + g.name + ".mesh", g.mesh)
|
||||
print("Saving " + d + g.name + ".mesh")
|
||||
for e in g.get_children():
|
||||
queue.push_back(e)
|
||||
return scene
|
||||
74
scripts/modules/character_hurtboxes.gd
Normal file
74
scripts/modules/character_hurtboxes.gd
Normal file
@@ -0,0 +1,74 @@
|
||||
extends Node
|
||||
|
||||
var raycast_queue = []
|
||||
var blood = preload("res://scenes/decals/blood.tscn")
|
||||
var blood_decal = preload("res://scenes/decals/blood1-decal.gltf")
|
||||
var rnd
|
||||
func _ready():
|
||||
var root = get_parent()
|
||||
var queue = [root]
|
||||
var hurtboxes = []
|
||||
while queue.size() > 0:
|
||||
var item = queue.pop_front()
|
||||
if item is Area && item.name.ends_with("_hurt"):
|
||||
hurtboxes.push_back(item)
|
||||
for e in item.get_children():
|
||||
queue.push_back(e)
|
||||
root.set_meta("hurtboxes", hurtboxes)
|
||||
for e in hurtboxes:
|
||||
e.connect("area_entered", self, "area_hit", [e])
|
||||
rnd = RandomNumberGenerator.new()
|
||||
rnd.randomize()
|
||||
func area_hit(area, e):
|
||||
if area.is_in_group("weapon_hit"):
|
||||
print("HIT")
|
||||
var bi = blood.instance()
|
||||
var d = area.global_transform.origin.linear_interpolate(e.global_transform.origin, 0.5)
|
||||
e.add_child(bi)
|
||||
bi.global_transform.origin = d
|
||||
bi.emitting = true
|
||||
var dcount = 2 + rnd.randi() % 5
|
||||
var org = d
|
||||
raycast_queue.push_back(d)
|
||||
print(dcount)
|
||||
for rd in range(dcount):
|
||||
var offt = Vector3()
|
||||
while offt.length() < 0.05:
|
||||
offt += Vector3(rnd.randf() * 0.3, 0, rnd.randf() * 0.3)
|
||||
var xoff = offt.normalized() * 0.04
|
||||
xoff.y = 0
|
||||
offt.y = 0
|
||||
org += xoff + offt
|
||||
raycast_queue.push_back(org)
|
||||
yield(get_tree().create_timer(8), "timeout")
|
||||
bi.queue_free()
|
||||
|
||||
func _physics_process(delta):
|
||||
var root = get_parent()
|
||||
var space_state: PhysicsDirectSpaceState = root.get_world().direct_space_state
|
||||
var offsets = [Vector3(0, -2, 0)]
|
||||
var cam = get_viewport().get_camera()
|
||||
if !cam.has_meta("player"):
|
||||
return
|
||||
var player = cam.get_meta("player")
|
||||
while raycast_queue.size() > 0:
|
||||
var item = raycast_queue.pop_front()
|
||||
var a = item
|
||||
for boff in offsets:
|
||||
var b = a + boff
|
||||
var result = {}
|
||||
if root is PhysicsBody:
|
||||
result = space_state.intersect_ray(a, b, [root, player])
|
||||
else:
|
||||
result = space_state.intersect_ray(a, b)
|
||||
if result.has("collider"):
|
||||
var body = result.collider
|
||||
var normal = result.normal
|
||||
var position = result.position
|
||||
var decal = blood_decal.instance()
|
||||
decal.add_to_group("blood")
|
||||
body.add_child(decal)
|
||||
decal.global_transform.origin = position
|
||||
var scale = 0.5 + rnd.randf() * 2.0
|
||||
var rot = PI * 2.0 * rnd.randf()
|
||||
decal.global_transform.basis = Basis(normal).scaled(Vector3(scale, 1.0, scale)).rotated(normal, rot)
|
||||
236
scripts/modules/cmdq.gd
Normal file
236
scripts/modules/cmdq.gd
Normal file
@@ -0,0 +1,236 @@
|
||||
extends Node
|
||||
|
||||
|
||||
# Declare member variables here. Examples:
|
||||
# var a = 2
|
||||
# var b = "text"
|
||||
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
|
||||
var animtree: AnimationTree
|
||||
var root_motion_track
|
||||
func _ready():
|
||||
process_priority = 0
|
||||
|
||||
func _physics_process(delta):
|
||||
var root = get_parent()
|
||||
var orientation: Transform
|
||||
if root.has_meta("orientation"):
|
||||
orientation = root.get_meta("orientation")
|
||||
if !animtree:
|
||||
animtree = root.get_meta("animation_tree")
|
||||
if animtree:
|
||||
root_motion_track = animtree.root_motion_track
|
||||
else:
|
||||
return
|
||||
if characters.handle_cmdq(root):
|
||||
return
|
||||
var skel = root.get_meta("skeleton")
|
||||
if !skel:
|
||||
return
|
||||
if root.has_meta("cmdqueue"):
|
||||
var cmds = root.get_meta("cmdqueue")
|
||||
var cmd = cmds.pop_front()
|
||||
match cmd[0]:
|
||||
# "disable_physics":
|
||||
# var owners = get_shape_owners()
|
||||
# for e in owners:
|
||||
# shape_owner_set_disabled(e, true)
|
||||
# $CollisionShape.disabled = true
|
||||
"vehicle_mode_on":
|
||||
if root.has_meta("vehicle"):
|
||||
var v = root.get_meta("vehicle")
|
||||
assert(v is VehicleBody)
|
||||
if root is PhysicsBody:
|
||||
root.add_collision_exception_with(v)
|
||||
if v is PhysicsBody:
|
||||
v.add_collision_exception_with(root)
|
||||
"vehicle_mode_off":
|
||||
if root.has_meta("vehicle"):
|
||||
var v = root.get_meta("vehicle")
|
||||
assert(v is VehicleBody)
|
||||
if root is PhysicsBody:
|
||||
root.remove_collision_exception_with(v)
|
||||
if v is PhysicsBody:
|
||||
v.remove_collision_exception_with(root)
|
||||
root.remove_meta("seat")
|
||||
root.remove_meta("vehicle")
|
||||
root.remove_meta("orig_parent")
|
||||
v.remove_meta("driver")
|
||||
|
||||
"jumpto":
|
||||
root.global_transform = cmd[1]
|
||||
orientation.basis = root.global_transform.basis
|
||||
if root.has_meta("vehicle"):
|
||||
var v = root.get_meta("vehicle")
|
||||
var et = root.global_transform
|
||||
var vt = v.global_transform
|
||||
var offset = vt.affine_inverse() * et
|
||||
root.set_meta("vehicle_offset", offset)
|
||||
root.set_meta("orientation", orientation)
|
||||
# "jump_to_obj":
|
||||
# var obj = cmd[1]
|
||||
# root.global_transform = obj.global_transform
|
||||
# orientation.basis = root.global_transform.basis
|
||||
# root.set_meta("orientation", orientation)
|
||||
# "jump_to_obj_rot":
|
||||
# var obj = cmd[1]
|
||||
# var xform = Transform()
|
||||
# xform.origin = obj.global_transform.origin
|
||||
# xform.basis = obj.global_transform.basis.rotated(Vector3(0, 1, 0), PI)
|
||||
# root.global_transform = xform
|
||||
# orientation.basis = root.global_transform.basis
|
||||
# root.set_meta("orientation", orientation)
|
||||
|
||||
# "anim_state":
|
||||
# characters.animation_node_travel(root, cmd[1])
|
||||
"parent_to_vehicle":
|
||||
pass
|
||||
# if has_meta("vehicle"):
|
||||
# var v = get_meta("vehicle")
|
||||
# var et = global_transform.origin
|
||||
# var vt = v.global_transform.origin
|
||||
# var offset = et - vt
|
||||
# set_meta("vehicle_offset", offset)
|
||||
"col_ex_add", "add_col_exception":
|
||||
root.add_collision_exception_with(cmd[1])
|
||||
"col_ex_rm", "remove_col_exception":
|
||||
root.remove_collision_exception_with(cmd[1])
|
||||
"until_end":
|
||||
var check = cmd[1]
|
||||
var cur = characters.get_animation_node(root)
|
||||
var p = animtree["parameters/state/playback"].get_current_play_position()
|
||||
var l = animtree["parameters/state/playback"].get_current_length()
|
||||
if check == cur && p < l - 0.05:
|
||||
cmds.push_front(["until_end", cmd[1]])
|
||||
# "delay":
|
||||
# var d = cmd[1]
|
||||
# if d > 0:
|
||||
# d = d - 1
|
||||
# cmds.push_front(["delay", d])
|
||||
"disable_collision":
|
||||
if root is PhysicsBody:
|
||||
var mask = root.collision_mask
|
||||
root.set_meta("orig_mask", mask)
|
||||
root.collision_mask = 0
|
||||
root.set_meta("physics", false)
|
||||
animtree.root_motion_track = ""
|
||||
"enable_collision":
|
||||
if root is PhysicsBody:
|
||||
var mask = root.get_meta("orig_mask")
|
||||
root.collision_mask = mask
|
||||
root.remove_meta("orig_mask")
|
||||
root.set_meta("physics", true)
|
||||
animtree.root_motion_track = root_motion_track
|
||||
"show_marker":
|
||||
if skel.has_node(cmd[1]):
|
||||
skel.get_node(cmd[1]).show()
|
||||
"hide_marker":
|
||||
if skel.has_node(cmd[1]):
|
||||
skel.get_node(cmd[1]).hide()
|
||||
"register_marker":
|
||||
if skel.has_node(cmd[2]):
|
||||
markers.init_marker(cmd[1], skel.get_node(cmd[2]), cmd[3])
|
||||
# "anim_param":
|
||||
# animtree["parameters/" + cmd[1]] = cmd[2]
|
||||
"equip":
|
||||
inventory.equip(skel.get_node(cmd[1]), cmd[2])
|
||||
"walkto":
|
||||
if !root.has_meta("cmdq_walk"):
|
||||
root.set_meta("cmdq_walk", true)
|
||||
var fwd_probe = characters.forward_probe(root, 0.5, 0.05, 1.9, 0.2)
|
||||
var climb = false
|
||||
if fwd_probe < 0.1:
|
||||
if !characters.get_animation_node(root) == "climb1":
|
||||
characters.animation_node_travel(root, "locomotion");
|
||||
climb = false
|
||||
# print("NO climb!!!")
|
||||
elif fwd_probe < 1.2:
|
||||
# print("trying climb!!!")
|
||||
climb = true
|
||||
characters.set_walk_speed(root, 0.5, 0)
|
||||
# animtree["parameters/state/locomotion/loc/blend_position"].x = 0.5
|
||||
# animtree["parameters/state/locomotion/loc/blend_position"].y = 0
|
||||
var gt: Transform = root.global_transform
|
||||
var target: = Vector3()
|
||||
if cmd[1] is Spatial:
|
||||
target = cmd[1].global_transform.origin
|
||||
else:
|
||||
target = cmd[1]
|
||||
target.y = root.global_transform.origin.y
|
||||
if gt.origin != target:
|
||||
gt = gt.looking_at(target, Vector3.UP)
|
||||
gt.origin = Vector3()
|
||||
# print("target: ", target)
|
||||
var timeout = cmd[3]
|
||||
timeout -= delta
|
||||
orientation.basis = gt.basis
|
||||
root.set_meta("orientation", orientation)
|
||||
root.global_transform.basis = gt.basis
|
||||
var d = root.global_transform.origin.distance_to(target)
|
||||
if climb:
|
||||
var cmd_new = ["walkto", cmd[1], cmd[2], timeout + delta]
|
||||
cmds.push_front(cmd_new)
|
||||
cmd_new = ["climb", "1"]
|
||||
cmds.push_front(cmd_new)
|
||||
elif timeout >= 0.0 && d > cmd[2]:
|
||||
var cmd_new = ["walkto", cmd[1], cmd[2], timeout]
|
||||
cmds.push_front(cmd_new)
|
||||
elif d > cmd[2]:
|
||||
var dir = target - root.global_transform.origin
|
||||
dir = dir.normalized() * (d - cmd[2])
|
||||
root.global_transform.origin += dir
|
||||
characters.set_walk_speed(root, 0.0, 0.0)
|
||||
# animtree["parameters/state/locomotion/loc/blend_position"].x = 0.0
|
||||
root.remove_meta("cmdq_walk")
|
||||
else:
|
||||
characters.set_walk_speed(root, 0.0, 0.0)
|
||||
# animtree["parameters/state/locomotion/loc/blend_position"].x = 0.0
|
||||
root.remove_meta("cmdq_walk")
|
||||
# print(d, " ", timeout, " ", gt)
|
||||
"set_other":
|
||||
var cmdq_other = []
|
||||
if cmd[1].has_meta("cmdqueue"):
|
||||
cmdq_other = cmd[1].get_meta("cmdqueue")
|
||||
cmdq_other.push_back(cmd[2])
|
||||
cmd[1].set_meta("cmdqueue", cmdq_other)
|
||||
"wait_for_completion":
|
||||
if !cmd[1].has_meta("complete_" + cmd[2]):
|
||||
cmds.push_front([cmd[0], cmd[1], cmd[2]])
|
||||
cmd[1].remove_meta("complete_" + cmd[2])
|
||||
"complete":
|
||||
root.set_meta("complete_" + cmd[1], true)
|
||||
|
||||
"set_transforms":
|
||||
var master_xform: Transform = cmd[1].global_transform
|
||||
var slave_xform = master_xform
|
||||
slave_xform.basis = master_xform.basis.rotated(Vector3.UP, PI)
|
||||
slave_xform.origin = master_xform.origin - master_xform.basis[2] * 0.375
|
||||
var slave_orientation = slave_xform
|
||||
slave_orientation.origin = Vector3()
|
||||
cmd[2].set_meta("orientation", slave_orientation)
|
||||
cmd[2].global_transform = slave_xform
|
||||
"climb":
|
||||
if !root.has_meta("last_climb"):
|
||||
characters.animation_node_travel(root, "climb" + cmd[1])
|
||||
root.set_meta("last_climb", "climb" + cmd[1])
|
||||
elif root.get_meta("last_climb") == "climb" + cmd[1]:
|
||||
characters.animation_node_travel(root, "climb" + cmd[1] + "a")
|
||||
root.set_meta("last_climb", "climb" + cmd[1] + "a")
|
||||
else:
|
||||
characters.animation_node_travel(root, "climb" + cmd[1])
|
||||
root.set_meta("last_climb", "climb" + cmd[1])
|
||||
cmds.push_front(["climb_wait", cmd[1]])
|
||||
root.set_meta("climb", true)
|
||||
"climb_wait":
|
||||
var cur = characters.get_animation_node(root)
|
||||
if cur.begins_with("climb" + cmd[1]):
|
||||
cmds.push_front(["climb_wait", cmd[1]])
|
||||
else:
|
||||
root.remove_meta("climb")
|
||||
|
||||
if cmds.size() > 0:
|
||||
root.set_meta("cmdqueue", cmds)
|
||||
else:
|
||||
root.remove_meta("cmdqueue")
|
||||
38
scripts/modules/npc_marker.gd
Normal file
38
scripts/modules/npc_marker.gd
Normal file
@@ -0,0 +1,38 @@
|
||||
extends Node
|
||||
|
||||
# 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():
|
||||
var root = get_parent()
|
||||
var cmdq = []
|
||||
if root.has_meta("cmdqueue"):
|
||||
cmdq = root.get_meta("cmdqueue")
|
||||
cmdq.push_back(["register_marker", self, "head/marker_talk", {"method": "talk"}])
|
||||
cmdq.push_back(["register_marker", self, "head/marker_hips_action", {"method": "action", "action": "hips_action"}])
|
||||
cmdq.push_back(["show_marker", "head/marker_talk"])
|
||||
cmdq.push_back(["show_marker", "head/marker_hips_action"])
|
||||
root.set_meta("cmdqueue", cmdq)
|
||||
|
||||
func talk(data):
|
||||
print("TALK")
|
||||
# var root = get_parent()
|
||||
# root.set_meta("req_state", "TALK")
|
||||
# scenario.emit_signal("talk", root)
|
||||
|
||||
func marker_hips_action(data):
|
||||
print("ACTION")
|
||||
|
||||
func action(data):
|
||||
return
|
||||
# var root = get_parent()
|
||||
# root.set_meta("req_state", "ACTION")
|
||||
# if root.is_in_group("nuns"):
|
||||
# scenario.nun_action(root)
|
||||
# else:
|
||||
# if data.action == "hips_action":
|
||||
# print(data)
|
||||
# marker_hips_action(data)
|
||||
142
scripts/modules/npc_nun.gd
Normal file
142
scripts/modules/npc_nun.gd
Normal file
@@ -0,0 +1,142 @@
|
||||
extends Node
|
||||
|
||||
|
||||
# Declare member variables here. Examples:
|
||||
# var a = 2
|
||||
# var b = "text"
|
||||
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
var root
|
||||
var skel
|
||||
var hair_skel
|
||||
|
||||
var garments = ["female-panties1", "female-bra1", "female-shirt1"]
|
||||
var garments_head = ["female-cap"]
|
||||
var basedir = "res://scenes/clothes/"
|
||||
var material = preload("res://scenes/clothes/nun-clothes.material")
|
||||
#var tween: Tween
|
||||
#enum {
|
||||
# IDLE,
|
||||
# WALKING
|
||||
# PRAYING,
|
||||
# PRAYING_STARTLED,
|
||||
# ACTION
|
||||
#}
|
||||
#var state = PRAYING
|
||||
func _ready():
|
||||
root = get_parent()
|
||||
root.add_to_group("nuns")
|
||||
# tween = Tween.new()
|
||||
# tween.playback_process_mode = Tween.TWEEN_PROCESS_PHYSICS
|
||||
# tween.process_priority = 30
|
||||
# add_child(tween)
|
||||
# call_deferred("setup_markers")
|
||||
characters.call_deferred("setup_garments", root, garments, garments_head, material)
|
||||
#func setup_markers():
|
||||
# var cmdq = []
|
||||
# if root.has_meta("cmdqueue"):
|
||||
# cmdq = root.get_meta("cmdqueue")
|
||||
# cmdq.push_back(["hide_marker", "head/marker_talk"])
|
||||
# cmdq.push_back(["hide_marker", "head/marker_hips_action"])
|
||||
# cmdq.push_back(["register_marker", self, "hips/marker_dagger_sacrifice",
|
||||
# {
|
||||
# "method": "dagger_sacrifice"
|
||||
# }
|
||||
# ])
|
||||
# cmdq.push_back(["hide_marker", "hips/marker_dagger_sacrifice"])
|
||||
# cmdq.push_back(["anim_state", "pray"])
|
||||
# root.set_meta("cmdqueue", cmdq)
|
||||
# state = PRAYING
|
||||
#var state_changed = 0.0
|
||||
#func set_orientation(v: Transform):
|
||||
# root.set_meta("orientation", v)
|
||||
#func set_basis_dir(dir: Vector3):
|
||||
# var xdir: Vector3 = dir
|
||||
# xdir.y = 0
|
||||
# var d0 = xdir.cross(Vector3.UP)
|
||||
# var d1 = Vector3.UP
|
||||
# var d2 = xdir
|
||||
# var basis = Basis(d0, d1, -d2)
|
||||
# var orientation = root.get_meta("orientation")
|
||||
# orientation.basis = basis
|
||||
# root.set_meta("orientation", orientation)
|
||||
#func _process(delta):
|
||||
# if !skel:
|
||||
# skel = root.get_meta("skeleton")
|
||||
# var space: PhysicsDirectSpaceState = root.getworld().get_direct_space_state()
|
||||
# var p = get_viewport().get_camera().get_meta("player").global_transform
|
||||
# var d = p.origin.distance_to(root.global_transform.origin)
|
||||
# var px = p.origin
|
||||
# px.y = root.global_transform.origin.y
|
||||
# var pdir = px - root.global_transform.origin
|
||||
# var fdir = -root.global_transform.basis[2]
|
||||
# fdir.y = 0
|
||||
# pdir.y = 0
|
||||
# pdir = pdir.normalized()
|
||||
# fdir = fdir.normalized()
|
||||
# var cmdq = []
|
||||
# if root.has_meta("cmdqueue"):
|
||||
# cmdq = root.get_meta("cmdqueue")
|
||||
# state_changed -= delta
|
||||
# state_changed = clamp(state_changed, 0.0, 10.0)
|
||||
# match state:
|
||||
# PRAYING:
|
||||
# if root.has_meta("req_state") && root.get_meta("req_state") in ["TALK", "ACTION"]:
|
||||
# state = ACTION
|
||||
# cmdq.push_back(["anim_state", "locomotion"])
|
||||
# root.set_meta("cmdqueue", cmdq)
|
||||
# elif d < 2.0 && state_changed <= 0.0:
|
||||
# if pdir.angle_to(fdir) > PI / 8.0:
|
||||
# tween.interpolate_method(self, "set_basis_dir", fdir, pdir, 0.3 + randf() * 0.6, Tween.TRANS_CUBIC)
|
||||
# tween.start()
|
||||
# state_changed = 0.5
|
||||
# else:
|
||||
# cmdq.push_back(["anim_state", "pray-startled"])
|
||||
## cmdq.push_back(["anim_state", "locomotion"])
|
||||
## cmdq.push_back(["anim_param", "state/locomotion/loc/blend_position", Vector2(0.5, 0)])
|
||||
# root.set_meta("cmdqueue", cmdq)
|
||||
# state = PRAYING_STARTLED
|
||||
# state_changed = 3.0
|
||||
# PRAYING_STARTLED:
|
||||
# if root.get_meta("req_state") in ["TALK", "ACTION"]:
|
||||
# state = ACTION
|
||||
# cmdq.push_back(["anim_state", "locomotion"])
|
||||
# root.set_meta("cmdqueue", cmdq)
|
||||
# elif d > 4.0 && state_changed <= 0.0:
|
||||
# cmdq.push_back(["anim_state", "pray"])
|
||||
# root.set_meta("cmdqueue", cmdq)
|
||||
# state = PRAYING
|
||||
# state_changed = 4.0
|
||||
# else:
|
||||
# var f = root.global_transform.origin + Vector3.UP * 0.5
|
||||
# var t = f + root.global_transform.basis[2] * 0.22
|
||||
# var result = space.intersect_ray(f, t, [root])
|
||||
# if result.has("collider"):
|
||||
# cmdq.push_back(["anim_state", "pray"])
|
||||
# root.set_meta("cmdqueue", cmdq)
|
||||
# state = PRAYING
|
||||
# state_changed = 2.0
|
||||
# ACTION:
|
||||
# if !root.has_meta("req_state"):
|
||||
# state = PRAYING
|
||||
#
|
||||
## elif d <= 4.0 || state_changed > 0.0:
|
||||
## tween.interpolate_method(self, "set_orientation", root.get_meta("orientation"), root.get_meta("orientation").looking_at(px, Vector3(0, 1, 0)), 0.3 + randf() * 0.6, Tween.TRANS_CUBIC)
|
||||
## tween.start()
|
||||
## var sacrifice_marker = skel.get_node("hips/marker_dagger_sacrifice")
|
||||
## if sacrifice_marker.visible && !inventory.items.s_dagger:
|
||||
## sacrifice_marker.hide()
|
||||
## elif !sacrifice_marker.visible && inventory.items.s_dagger:
|
||||
## sacrifice_marker.show()
|
||||
#
|
||||
##func dagger_sacrifice(data):
|
||||
## print("dagger sacrifice")
|
||||
## var cmdq = []
|
||||
## var other = group_manager.player
|
||||
## if other.has_meta("cmdqueue"):
|
||||
## cmdq = other.get_meta("cmdqueue")
|
||||
## cmdq.push_back(["anim_param", "blade_right/blend_amount", 1.0])
|
||||
## cmdq.push_back(["equip", "wrist_r/weapon_right", "s_dagger"])
|
||||
## other.set_meta("cmdqueue", cmdq)
|
||||
## group_manager.submit_player_npc_event_arot(root, "sacrificed-a", root, "sacrificed", root)
|
||||
53
scripts/modules/npc_sacrifice.gd
Normal file
53
scripts/modules/npc_sacrifice.gd
Normal file
@@ -0,0 +1,53 @@
|
||||
extends Node
|
||||
|
||||
|
||||
# Declare member variables here. Examples:
|
||||
# var a = 2
|
||||
# var b = "text"
|
||||
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
var root
|
||||
var skel
|
||||
var garments = ["female-panties1", "female-bra1"]
|
||||
var basedir = "res://scenes/clothes/"
|
||||
var material = preload("res://scenes/clothes/cloth.material")
|
||||
func _ready():
|
||||
root = get_parent()
|
||||
root.add_to_group("sacrifice")
|
||||
call_deferred("setup_markers")
|
||||
characters.call_deferred("setup_garments", root, garments, [], material)
|
||||
|
||||
func setup_markers():
|
||||
var cmdq = []
|
||||
if root.has_meta("cmdqueue"):
|
||||
cmdq = root.get_meta("cmdqueue")
|
||||
cmdq.push_back(["hide_marker", "head/marker_talk"])
|
||||
cmdq.push_back(["hide_marker", "head/marker_hips_action"])
|
||||
# cmdq.push_back(["register_marker", self, "hips/marker_dagger_sacrifice",
|
||||
# {
|
||||
# "method": "dagger_sacrifice"
|
||||
# }
|
||||
# ])
|
||||
# cmdq.push_back(["hide_marker", "hips/marker_dagger_sacrifice"])
|
||||
cmdq.push_back(["anim_state", "sacrifice"])
|
||||
root.set_meta("cmdqueue", cmdq)
|
||||
func _process(delta):
|
||||
if !skel:
|
||||
skel = root.get_meta("skeleton")
|
||||
# var sacrifice_marker = skel.get_node("hips/marker_dagger_sacrifice")
|
||||
# if sacrifice_marker.visible && !inventory.items.s_dagger:
|
||||
# sacrifice_marker.hide()
|
||||
# elif !sacrifice_marker.visible && inventory.items.s_dagger:
|
||||
# sacrifice_marker.show()
|
||||
|
||||
#func dagger_sacrifice(data):
|
||||
# print("dagger sacrifice")
|
||||
# var cmdq = []
|
||||
# var other = get_viewport().get_camera().get_meta("player")
|
||||
# if other.has_meta("cmdqueue"):
|
||||
# cmdq = other.get_meta("cmdqueue")
|
||||
# cmdq.push_back(["anim_param", "blade_right/blend_amount", 1.0])
|
||||
# cmdq.push_back(["equip", "wrist_r/weapon_right", "s_dagger"])
|
||||
# other.set_meta("cmdqueue", cmdq)
|
||||
# group_manager.submit_player_npc_event_arot(root, "sacrificed-a", root, "sacrificed", root)
|
||||
145
scripts/modules/npc_student.gd
Normal file
145
scripts/modules/npc_student.gd
Normal file
@@ -0,0 +1,145 @@
|
||||
extends Node
|
||||
|
||||
|
||||
# Declare member variables here. Examples:
|
||||
# var a = 2
|
||||
# var b = "text"
|
||||
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
var root
|
||||
var skel
|
||||
var hair_skel
|
||||
|
||||
var garments_female_lingerie = ["female-panties1", "female-bra1"]
|
||||
var garments_head_female = []
|
||||
var garments_male_lingerie = ["male-panties1"]
|
||||
var garments_head_male = []
|
||||
var garments_female_main = ["female-shirt_skirt1", "female-skirt1"]
|
||||
var garments_male_main = ["male-pants1", "male-shirt1", "male-shoes1"]
|
||||
var basedir = "res://scenes/clothes/"
|
||||
var material_female = preload("res://scenes/clothes/nun-clothes.material")
|
||||
var material_male = preload("res://scenes/clothes/clothes-male.material")
|
||||
#var tween: Tween
|
||||
#enum {
|
||||
# IDLE,
|
||||
# WALKING,
|
||||
# SLEEPING
|
||||
#}
|
||||
#var state = SLEEPING
|
||||
func _ready():
|
||||
name = "student_ai"
|
||||
root = get_parent()
|
||||
root.add_to_group("students")
|
||||
root.add_to_group("student")
|
||||
# tween = Tween.new()
|
||||
# tween.playback_process_mode = Tween.TWEEN_PROCESS_PHYSICS
|
||||
# tween.process_priority = 30
|
||||
# add_child(tween)
|
||||
# call_deferred("setup_markers")
|
||||
var character_data = root.get_meta("character_data")
|
||||
if character_data.sex == "female":
|
||||
var g = garments_female_lingerie
|
||||
var h = []
|
||||
g += garments_female_main
|
||||
h += garments_head_female
|
||||
characters.call_deferred("setup_garments", root, g, h, material_female)
|
||||
else:
|
||||
var g = garments_male_lingerie
|
||||
var h = []
|
||||
g += garments_male_main
|
||||
h += garments_head_male
|
||||
characters.call_deferred("setup_garments", root, g, h, material_male)
|
||||
|
||||
#func setup_markers():
|
||||
# var cmdq = []
|
||||
# if root.has_meta("cmdqueue"):
|
||||
# cmdq = root.get_meta("cmdqueue")
|
||||
# if root.has_meta("saved_anim_state"):
|
||||
# var st = root.get_meta("saved_anim_state")
|
||||
# cmdq.push_back(["anim_state", st])
|
||||
# root.set_meta("cmdqueue", cmdq)
|
||||
# root.remove_meta("saved_anim_state")
|
||||
# if st == "sleeping":
|
||||
# state = SLEEPING
|
||||
# else:
|
||||
# state = IDLE
|
||||
# elif scenario.period > scenario.EARLY_MORNING:
|
||||
# cmdq.push_back(["anim_state", "locomotion"])
|
||||
# root.set_meta("cmdqueue", cmdq)
|
||||
# else:
|
||||
# cmdq.push_back(["anim_state", "sleeping"])
|
||||
# root.set_meta("cmdqueue", cmdq)
|
||||
# state = SLEEPING
|
||||
#var state_changed = 0.0
|
||||
#func set_basis_dir(dir: Vector3):
|
||||
# var xdir: Vector3 = dir
|
||||
# xdir.y = 0
|
||||
# var d0 = xdir.cross(Vector3.UP)
|
||||
# var d1 = Vector3.UP
|
||||
# var d2 = xdir
|
||||
# var basis = Basis(d0, d1, -d2)
|
||||
# var orientation = root.get_meta("orientation")
|
||||
# orientation.basis = basis
|
||||
# root.set_meta("orientation", orientation)
|
||||
#func _process(delta):
|
||||
# if !skel:
|
||||
# skel = root.get_meta("skeleton")
|
||||
# var space: PhysicsDirectSpaceState = root.get_world().get_direct_space_state()
|
||||
# var p = get_viewport().get_camera().get_meta("player").global_transform
|
||||
# var d = p.origin.distance_to(root.global_transform.origin)
|
||||
# var px = p.origin
|
||||
# px.y = root.global_transform.origin.y
|
||||
# var pdir = px - root.global_transform.origin
|
||||
# var fdir = -root.global_transform.basis[2]
|
||||
# fdir.y = 0
|
||||
# pdir.y = 0
|
||||
# pdir = pdir.normalized()
|
||||
# fdir = fdir.normalized()
|
||||
# var cmdq = []
|
||||
# if root.has_meta("cmdqueue"):
|
||||
# cmdq = root.get_meta("cmdqueue")
|
||||
# state_changed -= delta
|
||||
# state_changed = clamp(state_changed, 0.0, 10.0)
|
||||
# match state:
|
||||
# SLEEPING:
|
||||
# if scenario.period > scenario.EARLY_MORNING:
|
||||
# state = WALKING
|
||||
# cmdq.push_back(["anim_state", "locomotion"])
|
||||
# else:
|
||||
# cmdq.push_back(["anim_state", "sleeping"])
|
||||
# root.set_meta("cmdqueue", cmdq)
|
||||
# WALKING:
|
||||
# pass
|
||||
# IDLE:
|
||||
# pass
|
||||
## cmdq.push_back(["anim_state", "locomotion"])
|
||||
## root.set_meta("cmdqueue", cmdq)
|
||||
#func switch_state(root, st):
|
||||
# print("seitch state: ", state, " ", st)
|
||||
# var cmdq = []
|
||||
# if state == st:
|
||||
# return
|
||||
# if root.has_meta("cmdqueue"):
|
||||
# cmdq = root.get_meta("cmdqueue")
|
||||
# match state:
|
||||
# IDLE:
|
||||
# pass
|
||||
# SLEEPING:
|
||||
# pass
|
||||
# WALKING:
|
||||
# pass
|
||||
# match st:
|
||||
# IDLE:
|
||||
# cmdq.push_back(["anim_state", "locomotion"])
|
||||
# SLEEPING:
|
||||
# cmdq.push_back(["anim_state", "sleeping"])
|
||||
# WALKING:
|
||||
# cmdq.push_back(["anim_state", "locomotion"])
|
||||
# root.set_meta("cmdqueue", cmdq)
|
||||
# state = st
|
||||
#func command(cmd):
|
||||
# print(name, " command: ", cmd)
|
||||
# match cmd[0]:
|
||||
# "wakeup":
|
||||
# switch_state(get_parent(), WALKING)
|
||||
81
scripts/modules/player_clothes.gd
Normal file
81
scripts/modules/player_clothes.gd
Normal file
@@ -0,0 +1,81 @@
|
||||
extends Node
|
||||
|
||||
|
||||
# Declare member variables here. Examples:
|
||||
# var a = 2
|
||||
# var b = "text"
|
||||
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
var root
|
||||
var skel
|
||||
var hair_skel
|
||||
|
||||
var garments = ["male-panties1", "male-shirt1"]
|
||||
var garments_head = []
|
||||
var basedir = "res://scenes/clothes/"
|
||||
var material = preload("res://scenes/clothes/clothes-male.material")
|
||||
func _ready():
|
||||
root = get_parent()
|
||||
call_deferred("setup_markers")
|
||||
call_deferred("setup_garments")
|
||||
func setup_markers():
|
||||
var cmdq = []
|
||||
if root.has_meta("cmdqueue"):
|
||||
cmdq = root.get_meta("cmdqueue")
|
||||
# cmdq.push_back(["hide_marker", "head/marker_talk"])
|
||||
# cmdq.push_back(["hide_marker", "head/marker_hips_action"])
|
||||
# cmdq.push_back(["register_marker", self, "hips/marker_dagger_sacrifice",
|
||||
# {
|
||||
# "method": "dagger_sacrifice"
|
||||
# }
|
||||
# ])
|
||||
# cmdq.push_back(["hide_marker", "hips/marker_dagger_sacrifice"])
|
||||
cmdq.push_back(["anim_state", "locomotion"])
|
||||
root.set_meta("cmdqueue", cmdq)
|
||||
func setup_garments():
|
||||
skel = root.get_meta("skeleton")
|
||||
hair_skel = root.get_meta("hair_skeleton")
|
||||
|
||||
print("garments for player")
|
||||
for g in garments:
|
||||
var m: MeshInstance = MeshInstance.new()
|
||||
m.name = g
|
||||
var geo: ArrayMesh = load(basedir + g + ".mesh")
|
||||
print(g, " mesh: ", geo, "mat: ", material)
|
||||
geo.surface_set_material(0, material)
|
||||
m.mesh = geo
|
||||
# m.skeleton = m.get_path_to(root.get_meta("skeleton"))
|
||||
# = root.get_meta("skeleton")
|
||||
skel.add_child(m)
|
||||
m.transform = Transform()
|
||||
for g in garments_head:
|
||||
var m: MeshInstance = MeshInstance.new()
|
||||
m.name = g
|
||||
var geo: ArrayMesh = load(basedir + g + ".mesh")
|
||||
print("mesh: ", geo, "mat: ", material)
|
||||
geo.surface_set_material(0, material)
|
||||
m.mesh = geo
|
||||
# m.skeleton = m.get_path_to(root.get_meta("skeleton"))
|
||||
# = root.get_meta("skeleton")
|
||||
hair_skel.add_child(m)
|
||||
m.transform = Transform()
|
||||
#func _process(delta):
|
||||
# if !skel:
|
||||
# skel = root.get_meta("skeleton")
|
||||
# var sacrifice_marker = skel.get_node("hips/marker_dagger_sacrifice")
|
||||
# if sacrifice_marker.visible && !inventory.items.s_dagger:
|
||||
# sacrifice_marker.hide()
|
||||
# elif !sacrifice_marker.visible && inventory.items.s_dagger:
|
||||
# sacrifice_marker.show()
|
||||
|
||||
#func dagger_sacrifice(data):
|
||||
# print("dagger sacrifice")
|
||||
# var cmdq = []
|
||||
# var other = group_manager.player
|
||||
# if other.has_meta("cmdqueue"):
|
||||
# cmdq = other.get_meta("cmdqueue")
|
||||
# cmdq.push_back(["anim_param", "blade_right/blend_amount", 1.0])
|
||||
# cmdq.push_back(["equip", "wrist_r/weapon_right", "s_dagger"])
|
||||
# other.set_meta("cmdqueue", cmdq)
|
||||
# group_manager.submit_player_npc_event_arot(root, "sacrificed-a", root, "sacrificed", root)
|
||||
108
scripts/modules/player_controls.gd
Normal file
108
scripts/modules/player_controls.gd
Normal file
@@ -0,0 +1,108 @@
|
||||
extends Node
|
||||
|
||||
|
||||
# Declare member variables here. Examples:
|
||||
# var a = 2
|
||||
# var b = "text"
|
||||
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
var cam
|
||||
var fps_cam
|
||||
var motion = Vector2()
|
||||
func _ready():
|
||||
var root = get_parent()
|
||||
process_priority = 200
|
||||
|
||||
|
||||
|
||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
#func _process(delta):
|
||||
# pass
|
||||
func _physics_process(delta):
|
||||
var orientation: Transform
|
||||
var root = get_parent()
|
||||
if !root.has_meta("cam"):
|
||||
return
|
||||
cam = root.get_meta("cam")
|
||||
assert(cam)
|
||||
fps_cam = root.get_meta("fps_cam")
|
||||
assert(fps_cam)
|
||||
var animtree = root.get_meta("animation_tree")
|
||||
if !animtree:
|
||||
return
|
||||
if root.has_meta("orientation"):
|
||||
orientation = root.get_meta("orientation")
|
||||
if !orientation:
|
||||
return
|
||||
var running = false
|
||||
assert(cam)
|
||||
assert(fps_cam)
|
||||
|
||||
var motion_target = Vector2(Input.get_action_strength("walk_right") - Input.get_action_strength("walk_left"),
|
||||
Input.get_action_strength("walk_front") - Input.get_action_strength("walk_back"))
|
||||
motion = motion.linear_interpolate(motion_target, 10.0 * delta)
|
||||
var xmotion = motion
|
||||
xmotion.x = clamp(xmotion.x, -0.4, 0.4)
|
||||
# if root.has_meta("group_behavior"):
|
||||
# if motion_target.y < 0:
|
||||
# behavior.destroy_group_behavior(root.get_meta("group_behavior"))
|
||||
if !root.has_meta("vehicle") && !root.has_meta("cmdqueue") && !root.has_meta("group_behavior"):
|
||||
if Input.is_action_just_pressed("activate"):
|
||||
markers.activate_marker()
|
||||
if Input.is_action_pressed("run"):
|
||||
running = true
|
||||
var cam_z = Vector3()
|
||||
var cam_x = Vector3()
|
||||
if cam.current:
|
||||
cam_z = cam.global_transform.basis.z
|
||||
cam_x = cam.global_transform.basis.x
|
||||
cam_z.y = 0
|
||||
cam_z = cam_z.normalized()
|
||||
cam_x.y = 0
|
||||
cam_x = cam_x.normalized()
|
||||
var target = cam_x * motion.x - cam_z * motion.y
|
||||
if target.length() > 0.001 && cam.current:
|
||||
var q_from = Quat(orientation.basis)
|
||||
var q_to = Quat(Transform().looking_at(target, Vector3.UP).basis)
|
||||
orientation.basis = Basis(q_from.slerp(q_to, delta * 10.0))
|
||||
root.set_meta("orientation", orientation)
|
||||
var fwd_probe = characters.forward_probe(root, 0.5, 0.05, 1.0, 0.1)
|
||||
if fwd_probe > 0.1 && fwd_probe < 0.7:
|
||||
var cmdq = []
|
||||
if root.has_meta("cmdqueue"):
|
||||
cmdq = root.get_meta("cmdqueue")
|
||||
cmdq.push_back(["climb", "1"])
|
||||
root.set_meta("cmdqueue", cmdq)
|
||||
|
||||
animtree["parameters/state/playback"].travel("locomotion")
|
||||
var strafing = 0
|
||||
var linear = 0
|
||||
if fps_cam.current:
|
||||
strafing = motion.x
|
||||
linear = motion.y
|
||||
else:
|
||||
strafing = 0
|
||||
linear = motion.length()
|
||||
if running:
|
||||
animtree["parameters/state/locomotion/loc/blend_position"] = Vector2(linear * 3.0, strafing * 2.0)
|
||||
else:
|
||||
animtree["parameters/state/locomotion/loc/blend_position"] = Vector2(linear * 0.5, strafing)
|
||||
elif root.has_meta("vehicle"):
|
||||
if Input.is_action_just_pressed("activate"):
|
||||
markers.activate_marker()
|
||||
var vehicle: VehicleBody = root.get_meta("vehicle")
|
||||
var driver = vehicle.get_meta("driver")
|
||||
if driver == root:
|
||||
if vehicle.parked:
|
||||
vehicle.parked = false
|
||||
vehicle.mode = vehicle.MODE_RIGID
|
||||
if abs(xmotion.y) < 0.001:
|
||||
vehicle.brake = 1000
|
||||
vehicle.steering = -xmotion.x * 0.7
|
||||
else:
|
||||
vehicle.brake = 0
|
||||
vehicle.engine_force = 4000 * xmotion.y
|
||||
var accel = vehicle.angular_velocity * 350.0 * delta
|
||||
vehicle.steering = -xmotion.x * 0.7
|
||||
|
||||
110
world.gd
Normal file
110
world.gd
Normal file
@@ -0,0 +1,110 @@
|
||||
extends Spatial
|
||||
|
||||
export var camera_path: NodePath
|
||||
export var camera_pos_path: NodePath
|
||||
export var camera_rot_y_path: NodePath
|
||||
export var camera_rot_x_path: NodePath
|
||||
export var camera_offset_path: NodePath
|
||||
export var camera_arm_path: NodePath
|
||||
export var fps_camera_scene: PackedScene
|
||||
export var fps_camera_rot_y_node: String = "fps_cam_rot_y"
|
||||
export var fps_camera_rot_x_node: String = "fps_cam_rot_x"
|
||||
export var fps_camera_node: String = "fps_camera"
|
||||
var door_sc = preload("res://scenes/door_control.tscn")
|
||||
|
||||
# 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():
|
||||
$waiting.show()
|
||||
characters.set_navmesh(null, Transform())
|
||||
var start_delay0 = 8.0
|
||||
var start_delay1 = 2.0
|
||||
var start_delay2 = 2.0
|
||||
var start_delay3 = 2.0
|
||||
var state = 0
|
||||
var viewer
|
||||
|
||||
func _process(delta):
|
||||
match state:
|
||||
0:
|
||||
state = 1
|
||||
1:
|
||||
start_delay1 -= delta
|
||||
if start_delay1 < 0:
|
||||
var player
|
||||
var cam: Camera
|
||||
var fps_cam: Camera
|
||||
var cam_pos
|
||||
var cam_rot_y
|
||||
var cam_rot_x
|
||||
var cam_offset
|
||||
var cam_arm
|
||||
var fps_cam_rot_y
|
||||
var fps_cam_rot_x
|
||||
var default_offset
|
||||
if has_node("Roads") && get_node("Roads") is Roads:
|
||||
for site in range(RoadsData.get_site_count()):
|
||||
if site == 0:
|
||||
streaming.setup_first_town()
|
||||
var v = RoadsData.get_site_pos(0)
|
||||
var sdf = RoadsData.get_sdf(v.x, 300, v.y)
|
||||
var d = 300 - sdf
|
||||
$player.global_transform.origin.x = v.x
|
||||
$player.global_transform.origin.y = d + 12
|
||||
$player.global_transform.origin.z = v.y
|
||||
else:
|
||||
streaming.setup_town(site)
|
||||
if streaming.towns > 30:
|
||||
break
|
||||
print("towns done: ", streaming.towns)
|
||||
player = characters.replace_character($player, "male", ["player", "cmdq", "player_clothes"])
|
||||
player.add_child(VoxelViewer.new())
|
||||
player.set_script(load("res://characters/character.gd"))
|
||||
var fps_cam_pos = fps_camera_scene.instance()
|
||||
player.add_child(fps_cam_pos)
|
||||
fps_cam = fps_cam_pos.find_node(fps_camera_node, true, false)
|
||||
|
||||
cam = get_node(camera_path)
|
||||
cam.current = true
|
||||
cam_pos = get_node(camera_pos_path)
|
||||
cam_rot_y = get_node(camera_rot_y_path)
|
||||
cam_rot_x = get_node(camera_rot_x_path)
|
||||
cam_offset = get_node(camera_offset_path)
|
||||
cam_arm = get_node(camera_arm_path)
|
||||
fps_cam_rot_y = fps_cam_pos.find_node(fps_camera_rot_y_node, true, false)
|
||||
fps_cam_rot_x = fps_cam_pos.find_node(fps_camera_rot_x_node, true, false)
|
||||
default_offset = cam_offset.translation
|
||||
cam.set_meta("cam_pos", cam_pos)
|
||||
cam.set_meta("cam_rot_y", cam_rot_y)
|
||||
cam.set_meta("cam_rot_x", cam_rot_x)
|
||||
cam.set_meta("cam_offset", cam_offset)
|
||||
cam.set_meta("cam_arm", cam_arm)
|
||||
cam.set_meta("default_offset", default_offset)
|
||||
fps_cam.set_meta("fps_cam_rot_y", fps_cam_rot_y)
|
||||
fps_cam.set_meta("fps_cam_rot_x", fps_cam_rot_x)
|
||||
|
||||
cam_arm.add_excluded_object(player.get_rid())
|
||||
cam.set_meta("player", player)
|
||||
fps_cam.set_meta("player", player)
|
||||
player.set_meta("cam", cam)
|
||||
player.set_meta("fps_cam", fps_cam)
|
||||
print(player)
|
||||
controls.switch_fps_mode(false)
|
||||
state = 2
|
||||
2:
|
||||
start_delay2 -= delta
|
||||
if start_delay2 < 0:
|
||||
state = 3
|
||||
3:
|
||||
start_delay2 -= delta
|
||||
if start_delay2 < 0:
|
||||
$waiting.hide()
|
||||
state = 4
|
||||
4:
|
||||
RoadsData.save_json("user://world-gen.json")
|
||||
state = 5
|
||||
|
||||
103
world.tscn
Normal file
103
world.tscn
Normal file
@@ -0,0 +1,103 @@
|
||||
[gd_scene load_steps=13 format=2]
|
||||
|
||||
[ext_resource path="res://world.gd" type="Script" id=1]
|
||||
[ext_resource path="res://terrain.gdshader" type="Shader" id=2]
|
||||
[ext_resource path="res://road/road_elements.gltf" type="PackedScene" id=3]
|
||||
[ext_resource path="res://camera/camera_pos.tscn" type="PackedScene" id=4]
|
||||
[ext_resource path="res://scenes/waiting.gd" type="Script" id=5]
|
||||
[ext_resource path="res://camera/fps_cam_pos.tscn" type="PackedScene" id=6]
|
||||
|
||||
[sub_resource type="WorldGenerator" id=7]
|
||||
iso_scale = 0.01
|
||||
|
||||
[sub_resource type="VoxelMesherTransvoxel" id=4]
|
||||
|
||||
[sub_resource type="ShaderMaterial" id=6]
|
||||
shader = ExtResource( 2 )
|
||||
shader_param/u_transition_mask = null
|
||||
|
||||
[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.291262, -300 ), 0.0, 0.0, 0, 0, Vector2( 0.339806, -63.4615 ), 0.0, 0.0, 0, 0, Vector2( 0.466019, 0 ), 0.0, 0.0, 0, 0, Vector2( 0.466019, 11.5385 ), 0.0, 0.0, 0, 0, Vector2( 0.723301, 75 ), 311.264, 311.264, 0, 0, Vector2( 0.902913, 184.615 ), 976.237, 976.237, 0, 0, Vector2( 0.975728, 300 ), 0.0, 0.0, 0, 0 ]
|
||||
|
||||
[sub_resource type="FastNoiseLite" id=8]
|
||||
seed = 36800
|
||||
period = 256.0
|
||||
|
||||
[sub_resource type="DetourNavigationMesh" id=9]
|
||||
cell_size = 0.15
|
||||
cell_height = 0.15
|
||||
agent_height = 1.5
|
||||
agent_radius = 0.15
|
||||
agent_max_climb = 0.6
|
||||
region_min_size = 0.5
|
||||
region_merge_size = 10.0
|
||||
edge_max_length = 0.4
|
||||
edge_max_error = 0.2
|
||||
detail_sample_max_error = 0.5
|
||||
group = "navigation"
|
||||
partition_type = -1082130432
|
||||
data = {
|
||||
}
|
||||
|
||||
[node name="world" type="Spatial"]
|
||||
script = ExtResource( 1 )
|
||||
camera_path = NodePath("camera_pos/rot_y/rot_x/SpringArm/camera_offset/Camera")
|
||||
camera_pos_path = NodePath("camera_pos")
|
||||
camera_rot_y_path = NodePath("camera_pos/rot_y")
|
||||
camera_rot_x_path = NodePath("camera_pos/rot_y/rot_x")
|
||||
camera_offset_path = NodePath("camera_pos/rot_y/rot_x/SpringArm/camera_offset")
|
||||
camera_arm_path = NodePath("camera_pos/rot_y/rot_x/SpringArm")
|
||||
fps_camera_scene = ExtResource( 6 )
|
||||
|
||||
[node name="VoxelLodTerrain" type="VoxelLodTerrain" parent="." groups=["navigation"]]
|
||||
generator = SubResource( 7 )
|
||||
mesher = SubResource( 4 )
|
||||
lod_count = 5
|
||||
lod_distance = 64.0
|
||||
lod_fade_duration = 1.0
|
||||
material = SubResource( 6 )
|
||||
run_stream_in_editor = false
|
||||
|
||||
[node name="DirectionalLight" type="DirectionalLight" parent="."]
|
||||
transform = Transform( 1, 0, 0, 0, -4.37114e-08, 1, 0, -1, -4.37114e-08, 0, 100, 0 )
|
||||
|
||||
[node name="Camera" type="Camera" parent="."]
|
||||
transform = Transform( 0.819152, 0.40558, -0.40558, 0, 0.707107, 0.707107, 0.573577, -0.579228, 0.579228, 0, 150, 0 )
|
||||
far = 600.0
|
||||
|
||||
[node name="Roads" type="Roads" parent="."]
|
||||
road_data = ExtResource( 3 )
|
||||
curve = SubResource( 1 )
|
||||
noise = SubResource( 8 )
|
||||
|
||||
[node name="camera_pos" parent="." instance=ExtResource( 4 )]
|
||||
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 150, 0 )
|
||||
|
||||
[node name="waiting" type="ColorRect" parent="."]
|
||||
visible = false
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
color = Color( 0, 0, 0, 1 )
|
||||
script = ExtResource( 5 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="player" type="Spatial" parent="."]
|
||||
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 150, 0 )
|
||||
|
||||
[node name="DetourNavigation" type="DetourNavigation" parent="."]
|
||||
|
||||
[node name="DetourNavigationMeshInstance" type="DetourNavigationMeshInstance" parent="."]
|
||||
navmesh = SubResource( 9 )
|
||||
|
||||
[node name="DetourCrowdManager" type="DetourCrowdManager" parent="."]
|
||||
|
||||
[node name="nav_pos" type="Spatial" parent="." groups=["navigation"]]
|
||||
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -4e+07, 0, -4e+07 )
|
||||
|
||||
[node name="nav_pos2" type="Spatial" parent="." groups=["navigation"]]
|
||||
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 4e+07, 0, 4e+07 )
|
||||
Reference in New Issue
Block a user