NPCs
This commit is contained in:
parent
842d58ad22
commit
f7e82a2741
26 changed files with 1180 additions and 28 deletions
BIN
blends/npcs.blend
(Stored with Git LFS)
BIN
blends/npcs.blend
(Stored with Git LFS)
Binary file not shown.
|
@ -0,0 +1,3 @@
|
||||||
|
source_md5="e4c021a5c719802449e788b1aa927b24"
|
||||||
|
dest_md5="85388a6e684c44ca809c7b25703a2f89"
|
||||||
|
|
Binary file not shown.
BIN
godot/assets/meat_bore/PlatformDialogue.material
(Stored with Git LFS)
Normal file
BIN
godot/assets/meat_bore/PlatformDialogue.material
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
godot/assets/meat_bore/dialogue_platform.glb
(Stored with Git LFS)
Normal file
BIN
godot/assets/meat_bore/dialogue_platform.glb
(Stored with Git LFS)
Normal file
Binary file not shown.
1065
godot/assets/meat_bore/dialogue_platform.glb.import
Normal file
1065
godot/assets/meat_bore/dialogue_platform.glb.import
Normal file
File diff suppressed because it is too large
Load diff
13
godot/assets/meat_bore/dialogue_platform.tscn
Normal file
13
godot/assets/meat_bore/dialogue_platform.tscn
Normal file
File diff suppressed because one or more lines are too long
|
@ -1,11 +1,10 @@
|
||||||
[gd_scene load_steps=15 format=2]
|
[gd_scene load_steps=13 format=2]
|
||||||
|
|
||||||
[ext_resource path="res://assets/meat_bore/meat_tunnel_top.tscn" type="PackedScene" id=1]
|
[ext_resource path="res://assets/meat_bore/meat_tunnel_top.tscn" type="PackedScene" id=1]
|
||||||
[ext_resource path="res://assets/meat_bore/meat_module/level_wally.tscn" type="PackedScene" id=2]
|
[ext_resource path="res://assets/meat_bore/meat_module/level_wally.tscn" type="PackedScene" id=2]
|
||||||
[ext_resource path="res://player/player.tscn" type="PackedScene" id=3]
|
[ext_resource path="res://player/player.tscn" type="PackedScene" id=3]
|
||||||
[ext_resource path="res://effects/WorldEnvironment.tscn" type="PackedScene" id=4]
|
[ext_resource path="res://effects/WorldEnvironment.tscn" type="PackedScene" id=4]
|
||||||
[ext_resource path="res://effects/grainy_shader.tscn" type="PackedScene" id=5]
|
[ext_resource path="res://effects/grainy_shader.tscn" type="PackedScene" id=5]
|
||||||
[ext_resource path="res://assets/Starbox3.png" type="Texture" id=6]
|
|
||||||
[ext_resource path="res://assets/meat_bore/meat_module/level_clark.tscn" type="PackedScene" id=7]
|
[ext_resource path="res://assets/meat_bore/meat_module/level_clark.tscn" type="PackedScene" id=7]
|
||||||
[ext_resource path="res://assets/meat_bore/meat_module/level_alexis.tscn" type="PackedScene" id=8]
|
[ext_resource path="res://assets/meat_bore/meat_module/level_alexis.tscn" type="PackedScene" id=8]
|
||||||
[ext_resource path="res://assets/meat_bore/meat_module/level_lee.tscn" type="PackedScene" id=9]
|
[ext_resource path="res://assets/meat_bore/meat_module/level_lee.tscn" type="PackedScene" id=9]
|
||||||
|
@ -13,12 +12,8 @@
|
||||||
[ext_resource path="res://assets/models/meat_tentacle_small.tscn" type="PackedScene" id=12]
|
[ext_resource path="res://assets/models/meat_tentacle_small.tscn" type="PackedScene" id=12]
|
||||||
[ext_resource path="res://assets/models/meat_tentacle.tscn" type="PackedScene" id=13]
|
[ext_resource path="res://assets/models/meat_tentacle.tscn" type="PackedScene" id=13]
|
||||||
|
|
||||||
[sub_resource type="PanoramaSky" id=4]
|
|
||||||
panorama = ExtResource( 6 )
|
|
||||||
|
|
||||||
[sub_resource type="Environment" id=3]
|
[sub_resource type="Environment" id=3]
|
||||||
background_mode = 2
|
background_mode = 2
|
||||||
background_sky = SubResource( 4 )
|
|
||||||
ambient_light_color = Color( 0.329412, 0.231373, 0.231373, 1 )
|
ambient_light_color = Color( 0.329412, 0.231373, 0.231373, 1 )
|
||||||
ambient_light_energy = 1.5
|
ambient_light_energy = 1.5
|
||||||
ambient_light_sky_contribution = 0.0
|
ambient_light_sky_contribution = 0.0
|
||||||
|
|
|
@ -1,12 +1,21 @@
|
||||||
[gd_scene load_steps=4 format=2]
|
[gd_scene load_steps=5 format=2]
|
||||||
|
|
||||||
[ext_resource path="res://assets/meat_bore/meat_module/meat_module.tscn" type="PackedScene" id=1]
|
[ext_resource path="res://assets/meat_bore/meat_module/meat_module.tscn" type="PackedScene" id=1]
|
||||||
[ext_resource path="res://assets/meat_bore/meat_module/meat_module_outside_walls_5.png" type="Texture" id=2]
|
[ext_resource path="res://assets/meat_bore/meat_module/meat_module_outside_walls_5.png" type="Texture" id=2]
|
||||||
[ext_resource path="res://assets/meat_bore/meat_module/meat_module.gd" type="Script" id=3]
|
[ext_resource path="res://assets/meat_bore/npcs/inherited/jackie.tscn" type="PackedScene" id=3]
|
||||||
|
[ext_resource path="res://assets/meat_bore/dialogue_platform.tscn" type="PackedScene" id=4]
|
||||||
|
|
||||||
[node name="level_jackie" type="Spatial"]
|
[node name="level_jackie" type="Spatial"]
|
||||||
|
|
||||||
[node name="meat_module_5" type="Spatial" parent="." instance=ExtResource( 1 )]
|
[node name="meat_module_5" parent="." instance=ExtResource( 1 )]
|
||||||
transform = Transform( -0.968942, 0, 0.247287, 0, 1, 0, -0.247287, 0, -0.968942, 0, -459.244, 0 )
|
transform = Transform( -0.968942, 0, 0.247287, 0, 1, 0, -0.247287, 0, -0.968942, 0, -459.244, 0 )
|
||||||
script = ExtResource( 3 )
|
|
||||||
texture = ExtResource( 2 )
|
texture = ExtResource( 2 )
|
||||||
|
|
||||||
|
[node name="jackie" parent="meat_module_5" instance=ExtResource( 3 )]
|
||||||
|
transform = Transform( 0.222672, 0, -0.974894, 0, 1, 0, 0.974894, 0, 0.222672, 35.8107, -60.7196, 0.261785 )
|
||||||
|
|
||||||
|
[node name="dialogue_platform" parent="." instance=ExtResource( 4 )]
|
||||||
|
transform = Transform( 0.293757, 0, 0.95588, 0, 1, 0, -0.95588, 0, 0.293757, -33.8926, -520.031, -8.76617 )
|
||||||
|
|
||||||
|
[node name="dialogue_platform2" parent="." instance=ExtResource( 4 )]
|
||||||
|
transform = Transform( 0.957214, 0.289383, 0, -0.289383, 0.957214, 0, 0, 0, 1, -30.7244, -520.836, -8.76617 )
|
||||||
|
|
|
@ -1,2 +1,7 @@
|
||||||
extends NPC
|
extends NPC
|
||||||
|
|
||||||
|
func timeline_signal(what: String):
|
||||||
|
.timeline_signal(what)
|
||||||
|
if what == "alexis_awaken":
|
||||||
|
animation_fsm.travel("awaken")
|
||||||
|
|
||||||
|
|
|
@ -1,2 +1,5 @@
|
||||||
extends NPC
|
extends NPC
|
||||||
|
|
||||||
|
func timeline_signal(what: String):
|
||||||
|
.timeline_signal(what)
|
||||||
|
|
||||||
|
|
|
@ -1,2 +1,5 @@
|
||||||
extends NPC
|
extends NPC
|
||||||
|
|
||||||
|
func timeline_signal(what: String):
|
||||||
|
.timeline_signal(what)
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,7 @@ start_node = "idle"
|
||||||
script = ExtResource( 3 )
|
script = ExtResource( 3 )
|
||||||
who = 1
|
who = 1
|
||||||
body_texture = ExtResource( 2 )
|
body_texture = ExtResource( 2 )
|
||||||
initial_dialogic_timeline = "guy"
|
initial_dialogic_timeline = "guy_bore"
|
||||||
|
|
||||||
[node name="AnimationTree" type="AnimationTree" parent="." index="2"]
|
[node name="AnimationTree" type="AnimationTree" parent="." index="2"]
|
||||||
tree_root = SubResource( 2 )
|
tree_root = SubResource( 2 )
|
||||||
|
|
|
@ -1 +1,5 @@
|
||||||
extends NPC
|
extends NPC
|
||||||
|
|
||||||
|
func timeline_signal(what: String):
|
||||||
|
.timeline_signal(what)
|
||||||
|
|
||||||
|
|
|
@ -1,2 +1,5 @@
|
||||||
extends NPC
|
extends NPC
|
||||||
|
|
||||||
|
func timeline_signal(what: String):
|
||||||
|
.timeline_signal(what)
|
||||||
|
|
||||||
|
|
|
@ -1,2 +1,5 @@
|
||||||
extends NPC
|
extends NPC
|
||||||
|
|
||||||
|
func timeline_signal(what: String):
|
||||||
|
.timeline_signal(what)
|
||||||
|
|
||||||
|
|
|
@ -8,6 +8,10 @@ export(Name) var who
|
||||||
export var body_texture: StreamTexture
|
export var body_texture: StreamTexture
|
||||||
export var face_texture: StreamTexture
|
export var face_texture: StreamTexture
|
||||||
export var initial_dialogic_timeline: String
|
export var initial_dialogic_timeline: String
|
||||||
|
export var animation_tree: NodePath = "AnimationTree"
|
||||||
|
onready var animation_tree_node: AnimationTree = get_node(animation_tree)
|
||||||
|
onready var animation_fsm_node: AnimationNodeStateMachine = animation_tree_node.tree_root
|
||||||
|
onready var animation_fsm: AnimationNodeStateMachinePlayback = animation_tree_node.get("parameters/playback")
|
||||||
|
|
||||||
func is_male() -> bool:
|
func is_male() -> bool:
|
||||||
return not (who == Name.Jackie or who == Name.Alexis)
|
return not (who == Name.Jackie or who == Name.Alexis)
|
||||||
|
@ -32,6 +36,12 @@ func _ready():
|
||||||
var _err = $npc_common/Area.connect("body_entered", self, "body_entered")
|
var _err = $npc_common/Area.connect("body_entered", self, "body_entered")
|
||||||
_err = $npc_common/Area.connect("body_exited", self, "body_exited")
|
_err = $npc_common/Area.connect("body_exited", self, "body_exited")
|
||||||
|
|
||||||
|
var is_alive = true
|
||||||
|
func death():
|
||||||
|
is_alive = false
|
||||||
|
if animation_fsm_node.has_node("death"):
|
||||||
|
animation_fsm.travel("death")
|
||||||
|
|
||||||
func body_entered(body):
|
func body_entered(body):
|
||||||
if body.get_parent() == Util.player:
|
if body.get_parent() == Util.player:
|
||||||
player_entered()
|
player_entered()
|
||||||
|
@ -42,14 +52,26 @@ func body_exited(body):
|
||||||
|
|
||||||
var dialog = weakref(null)
|
var dialog = weakref(null)
|
||||||
|
|
||||||
func player_entered():
|
func create_dialog(timeline: String):
|
||||||
if dialog.get_ref() == null:
|
if dialog.get_ref() == null:
|
||||||
dialog = weakref(Dialogic.start(initial_dialogic_timeline))
|
dialog = weakref(Dialogic.start(timeline))
|
||||||
|
dialog.get_ref().connect("dialogic_signal", self, "timeline_signal")
|
||||||
add_child(dialog.get_ref())
|
add_child(dialog.get_ref())
|
||||||
|
|
||||||
func player_exited():
|
func close_dialog():
|
||||||
if dialog.get_ref() == null:
|
if dialog.get_ref() == null:
|
||||||
return
|
return
|
||||||
if is_a_parent_of(dialog.get_ref()):
|
if is_a_parent_of(dialog.get_ref()):
|
||||||
call_deferred("remove_child", dialog.get_ref())
|
call_deferred("remove_child", dialog.get_ref())
|
||||||
|
|
||||||
|
func player_entered():
|
||||||
|
create_dialog(initial_dialogic_timeline)
|
||||||
|
|
||||||
|
func player_exited():
|
||||||
|
close_dialog()
|
||||||
|
|
||||||
|
func timeline_signal(what: String):
|
||||||
|
if what == "death":
|
||||||
|
print("guy died")
|
||||||
|
death()
|
||||||
|
|
||||||
|
|
|
@ -1,16 +1,19 @@
|
||||||
[gd_scene load_steps=2 format=2]
|
[gd_scene load_steps=3 format=2]
|
||||||
|
|
||||||
[sub_resource type="SphereShape" id=1]
|
[sub_resource type="SphereShape" id=1]
|
||||||
|
|
||||||
|
[sub_resource type="BoxShape" id=2]
|
||||||
|
|
||||||
[node name="npc_common" type="Spatial"]
|
[node name="npc_common" type="Spatial"]
|
||||||
|
|
||||||
[node name="Area" type="Area" parent="."]
|
[node name="Area" type="Area" parent="."]
|
||||||
|
|
||||||
[node name="CollisionShape" type="CollisionShape" parent="Area"]
|
[node name="CollisionShape" type="CollisionShape" parent="Area"]
|
||||||
|
transform = Transform( 1.533, 0, 0, 0, 1.533, 0, 0, 0, 1.533, 0, 0, 0 )
|
||||||
shape = SubResource( 1 )
|
shape = SubResource( 1 )
|
||||||
|
|
||||||
[node name="StaticBody" type="StaticBody" parent="."]
|
[node name="StaticBody" type="StaticBody" parent="."]
|
||||||
|
|
||||||
[node name="CollisionShape" type="CollisionShape" parent="StaticBody"]
|
[node name="CollisionShape" type="CollisionShape" parent="StaticBody"]
|
||||||
transform = Transform( 1, 0, 0, 0, 9.98379, 0, 0, 0, 1, 0, 0, 0 )
|
transform = Transform( 1, 0, 0, 0, 9.98379, 0, 0, 0, 1, 0, 0, 0 )
|
||||||
shape = SubResource( 1 )
|
shape = SubResource( 2 )
|
||||||
|
|
|
@ -139,7 +139,7 @@
|
||||||
"text": "[color=red][wave amp=50 freq=2]Naughty naughty... [/wave][/color]"
|
"text": "[color=red][wave amp=50 freq=2]Naughty naughty... [/wave][/color]"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"emit_signal": "lee_death",
|
"emit_signal": "death",
|
||||||
"event_id": "dialogic_040"
|
"event_id": "dialogic_040"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
|
@ -109,7 +109,7 @@
|
||||||
"value": ""
|
"value": ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"emit_signal": "clark_death",
|
"emit_signal": "death",
|
||||||
"event_id": "dialogic_040"
|
"event_id": "dialogic_040"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
|
@ -102,6 +102,10 @@
|
||||||
"event_id": "dialogic_011",
|
"event_id": "dialogic_011",
|
||||||
"value": ""
|
"value": ""
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"emit_signal": "death",
|
||||||
|
"event_id": "dialogic_040"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"character": "character-1667667693.json",
|
"character": "character-1667667693.json",
|
||||||
"event_id": "dialogic_001",
|
"event_id": "dialogic_001",
|
||||||
|
|
|
@ -191,16 +191,16 @@
|
||||||
"event_id": "dialogic_011",
|
"event_id": "dialogic_011",
|
||||||
"value": ""
|
"value": ""
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"emit_signal": "death",
|
||||||
|
"event_id": "dialogic_040"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"character": "character-1667667711.json",
|
"character": "character-1667667711.json",
|
||||||
"event_id": "dialogic_001",
|
"event_id": "dialogic_001",
|
||||||
"portrait": "",
|
"portrait": "",
|
||||||
"text": "(You move forward to destroy what is left of Voss. The meat roils and shakes as you finish the job)"
|
"text": "(You move forward to destroy what is left of Voss. The meat roils and shakes as you finish the job)"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"emit_signal": "jackie_die",
|
|
||||||
"event_id": "dialogic_040"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"character": "character-1667667711.json",
|
"character": "character-1667667711.json",
|
||||||
"event_id": "dialogic_001",
|
"event_id": "dialogic_001",
|
||||||
|
|
|
@ -12,7 +12,7 @@ func _ready():
|
||||||
|
|
||||||
func on_timer_timeout():
|
func on_timer_timeout():
|
||||||
timer.wait_time = rand_range(0.05, 0.15)
|
timer.wait_time = rand_range(0.05, 0.15)
|
||||||
self.light_energy = rand_range(1.25, 1.5)
|
light_energy = rand_range(1.25, 1.5)
|
||||||
|
|
||||||
func _input(_event):
|
func _input(_event):
|
||||||
if Input.is_action_just_pressed("toggle_flashlight"):
|
if Input.is_action_just_pressed("toggle_flashlight"):
|
||||||
|
|
|
@ -22,7 +22,7 @@ func _input(event):
|
||||||
if Input.is_action_just_pressed("ui_cancel"):
|
if Input.is_action_just_pressed("ui_cancel"):
|
||||||
Input.set_mouse_mode(Input.MOUSE_MODE_VISIBLE)
|
Input.set_mouse_mode(Input.MOUSE_MODE_VISIBLE)
|
||||||
else:
|
else:
|
||||||
if event is InputEventMouseButton:
|
if event is InputEventMouseButton and Input.is_action_just_pressed("ui_cancel"):
|
||||||
Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED)
|
Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED)
|
||||||
|
|
||||||
var look_relative = Vector2(
|
var look_relative = Vector2(
|
||||||
|
|
|
@ -170,7 +170,6 @@ shader_param/texture_albedo = ExtResource( 22 )
|
||||||
[node name="Player" type="Spatial"]
|
[node name="Player" type="Spatial"]
|
||||||
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.750395, 0 )
|
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.750395, 0 )
|
||||||
script = ExtResource( 3 )
|
script = ExtResource( 3 )
|
||||||
can_glide = true
|
|
||||||
|
|
||||||
[node name="Smoothing" type="Spatial" parent="."]
|
[node name="Smoothing" type="Spatial" parent="."]
|
||||||
script = ExtResource( 5 )
|
script = ExtResource( 5 )
|
||||||
|
|
12
godot/tests/bore_hole/test_level_jackie.tscn
Normal file
12
godot/tests/bore_hole/test_level_jackie.tscn
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
[gd_scene load_steps=3 format=2]
|
||||||
|
|
||||||
|
[ext_resource path="res://assets/meat_bore/meat_module/level_jackie.tscn" type="PackedScene" id=1]
|
||||||
|
[ext_resource path="res://player/player.tscn" type="PackedScene" id=2]
|
||||||
|
|
||||||
|
[node name="Spatial" type="Spatial"]
|
||||||
|
|
||||||
|
[node name="level_jackie" parent="." instance=ExtResource( 1 )]
|
||||||
|
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 500, 0 )
|
||||||
|
|
||||||
|
[node name="Player" parent="." instance=ExtResource( 2 )]
|
||||||
|
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -27.5821, -21.1078, -5.13576 )
|
Loading…
Add table
Reference in a new issue