Attempt to fix dialogs "finish_fast" action.

This commit is contained in:
Julian Murgia
2021-01-30 14:00:23 +01:00
parent e6f4af74a8
commit b789490f63
45 changed files with 491 additions and 1114 deletions

4
.gitignore vendored
View File

@@ -1 +1,3 @@
bin/*
bin
*.import
.import

View File

@@ -1,3 +1,3 @@
source_md5="c41f0c34e36727378a31f94cb08b3c09"
dest_md5="57f6e185db633c7fef3b3e6b9024e016"
dest_md5="682fa20bd5923efda380ed7b269203fc"

View File

@@ -20,7 +20,7 @@ compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/filter=false
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2

View File

@@ -407,8 +407,10 @@ func repeat(command_params : Array):
"""
say speaker_id "text_to_say" [dialog_ui_name]
Make a character say one line.
Usage: say object_id line [dialog_ui_name]
- dialog_ui_name String if set, uses the dialog UI by its name as defined
in game.tscn/dialog_layer/dialog_player
"""
func say(command_params : Array) -> esctypes:
current_context.waiting = true

View File

@@ -190,8 +190,8 @@ func do(action : String, params : Array = []) -> void:
_:
# $esc_runner.activate(action, params[0])
report_warnings("escoria.gd:do()", ["Action received:", action, "with params ", params])
elif current_state == GAME_STATE.DIALOG:
dialog_player.finish_fast()
# elif current_state == GAME_STATE.DIALOG:
# dialog_player.finish_fast()
elif current_state == GAME_STATE.WAIT:
pass

View File

@@ -11,7 +11,7 @@ onready var tween = text_node.get_node("Tween")
export(float, 0.0, 0.3) var text_speed_per_character = 0.1
export(float) var fast_text_speed_per_character = 0.25
export(float) var max_time_to_text_disappear = 2.0
export(float) var max_time_to_text_disappear = 1.0
func _ready():
var centered_position_on_screen = Vector2(
@@ -70,7 +70,10 @@ func _on_dialog_line_typed(object, key):
$Timer.connect("timeout", self, "_on_dialog_finished")
func _on_dialog_finished():
emit_signal("dialog_line_finished")
escoria.esc_level_runner.finished()
escoria.dialog_player.is_speaking = false
escoria.current_state = escoria.GAME_STATE.DEFAULT
# emit_signal("dialog_line_finished")
queue_free()

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

View File

@@ -1,34 +0,0 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/favicon.png-6bf42f281f237811e41d92b65e7fc58a.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://bin/html5/favicon.png"
dest_files=[ "res://.import/favicon.png-6bf42f281f237811e41d92b65e7fc58a.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

View File

@@ -1,186 +0,0 @@
/*************************************************************************/
/* audio.worklet.js */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
/* https://godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
/* "Software"), to deal in the Software without restriction, including */
/* without limitation the rights to use, copy, modify, merge, publish, */
/* distribute, sublicense, and/or sell copies of the Software, and to */
/* permit persons to whom the Software is furnished to do so, subject to */
/* the following conditions: */
/* */
/* The above copyright notice and this permission notice shall be */
/* included in all copies or substantial portions of the Software. */
/* */
/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
class RingBuffer {
constructor(p_buffer, p_state) {
this.buffer = p_buffer;
this.avail = p_state;
this.rpos = 0;
this.wpos = 0;
}
data_left() {
return Atomics.load(this.avail, 0);
}
space_left() {
return this.buffer.length - this.data_left();
}
read(output) {
const size = this.buffer.length;
let from = 0;
let to_write = output.length;
if (this.rpos + to_write > size) {
const high = size - this.rpos;
output.set(this.buffer.subarray(this.rpos, size));
from = high;
to_write -= high;
this.rpos = 0;
}
output.set(this.buffer.subarray(this.rpos, this.rpos + to_write), from);
this.rpos += to_write;
Atomics.add(this.avail, 0, -output.length);
Atomics.notify(this.avail, 0);
}
write(p_buffer) {
const to_write = p_buffer.length;
const mw = this.buffer.length - this.wpos;
if (mw >= to_write) {
this.buffer.set(p_buffer, this.wpos);
} else {
const high = p_buffer.subarray(0, to_write - mw);
const low = p_buffer.subarray(to_write - mw);
this.buffer.set(high, this.wpos);
this.buffer.set(low);
}
let diff = to_write;
if (this.wpos + diff >= this.buffer.length) {
diff -= this.buffer.length;
}
this.wpos += diff;
Atomics.add(this.avail, 0, to_write);
Atomics.notify(this.avail, 0);
}
}
class GodotProcessor extends AudioWorkletProcessor {
constructor() {
super();
this.running = true;
this.lock = null;
this.notifier = null;
this.output = null;
this.output_buffer = new Float32Array();
this.input = null;
this.input_buffer = new Float32Array();
this.port.onmessage = (event) => {
const cmd = event.data['cmd'];
const data = event.data['data'];
this.parse_message(cmd, data);
};
}
process_notify() {
Atomics.add(this.notifier, 0, 1);
Atomics.notify(this.notifier, 0);
}
parse_message(p_cmd, p_data) {
if (p_cmd === 'start' && p_data) {
const state = p_data[0];
let idx = 0;
this.lock = state.subarray(idx, ++idx);
this.notifier = state.subarray(idx, ++idx);
const avail_in = state.subarray(idx, ++idx);
const avail_out = state.subarray(idx, ++idx);
this.input = new RingBuffer(p_data[1], avail_in);
this.output = new RingBuffer(p_data[2], avail_out);
} else if (p_cmd === 'stop') {
this.runing = false;
this.output = null;
this.input = null;
}
}
static array_has_data(arr) {
return arr.length && arr[0].length && arr[0][0].length;
}
process(inputs, outputs, parameters) {
if (!this.running) {
return false; // Stop processing.
}
if (this.output === null) {
return true; // Not ready yet, keep processing.
}
const process_input = GodotProcessor.array_has_data(inputs);
if (process_input) {
const input = inputs[0];
const chunk = input[0].length * input.length;
if (this.input_buffer.length !== chunk) {
this.input_buffer = new Float32Array(chunk);
}
if (this.input.space_left() >= chunk) {
GodotProcessor.write_input(this.input_buffer, input);
this.input.write(this.input_buffer);
} else {
this.port.postMessage('Input buffer is full! Skipping input frame.');
}
}
const process_output = GodotProcessor.array_has_data(outputs);
if (process_output) {
const output = outputs[0];
const chunk = output[0].length * output.length;
if (this.output_buffer.length !== chunk) {
this.output_buffer = new Float32Array(chunk);
}
if (this.output.data_left() >= chunk) {
this.output.read(this.output_buffer);
GodotProcessor.write_output(output, this.output_buffer);
} else {
this.port.postMessage('Output buffer has not enough frames! Skipping output frame.');
}
}
this.process_notify();
return true;
}
static write_output(dest, source) {
const channels = dest.length;
for (let ch = 0; ch < channels; ch++) {
for (let sample = 0; sample < dest[ch].length; sample++) {
dest[ch][sample] = source[sample * channels + ch];
}
}
}
static write_input(dest, source) {
const channels = source.length;
for (let ch = 0; ch < channels; ch++) {
for (let sample = 0; sample < source[ch].length; sample++) {
dest[sample * channels + ch] = source[ch][sample];
}
}
}
}
registerProcessor('godot-processor', GodotProcessor);

View File

@@ -1,281 +0,0 @@
<!DOCTYPE html>
<html xmlns='http://www.w3.org/1999/xhtml' lang='' xml:lang=''>
<head>
<meta charset='utf-8' />
<meta name='viewport' content='width=device-width, user-scalable=no' />
<link id='-gd-engine-icon' rel='icon' type='image/png' href='favicon.png' />
<title>Escoria-reloaded</title>
<style type='text/css'>
body {
touch-action: none;
margin: 0;
border: 0 none;
padding: 0;
text-align: center;
background-color: black;
}
#canvas {
display: block;
margin: 0;
color: white;
}
#canvas:focus {
outline: none;
}
.godot {
font-family: 'Noto Sans', 'Droid Sans', Arial, sans-serif;
color: #e0e0e0;
background-color: #3b3943;
background-image: linear-gradient(to bottom, #403e48, #35333c);
border: 1px solid #45434e;
box-shadow: 0 0 1px 1px #2f2d35;
}
/* Status display
* ============== */
#status {
position: absolute;
left: 0;
top: 0;
right: 0;
bottom: 0;
display: flex;
justify-content: center;
align-items: center;
/* don't consume click events - make children visible explicitly */
visibility: hidden;
}
#status-progress {
width: 366px;
height: 7px;
background-color: #38363A;
border: 1px solid #444246;
padding: 1px;
box-shadow: 0 0 2px 1px #1B1C22;
border-radius: 2px;
visibility: visible;
}
@media only screen and (orientation:portrait) {
#status-progress {
width: 61.8%;
}
}
#status-progress-inner {
height: 100%;
width: 0;
box-sizing: border-box;
transition: width 0.5s linear;
background-color: #202020;
border: 1px solid #222223;
box-shadow: 0 0 1px 1px #27282E;
border-radius: 3px;
}
#status-indeterminate {
visibility: visible;
position: relative;
}
#status-indeterminate > div {
width: 4.5px;
height: 0;
border-style: solid;
border-width: 9px 3px 0 3px;
border-color: #2b2b2b transparent transparent transparent;
transform-origin: center 21px;
position: absolute;
}
#status-indeterminate > div:nth-child(1) { transform: rotate( 22.5deg); }
#status-indeterminate > div:nth-child(2) { transform: rotate( 67.5deg); }
#status-indeterminate > div:nth-child(3) { transform: rotate(112.5deg); }
#status-indeterminate > div:nth-child(4) { transform: rotate(157.5deg); }
#status-indeterminate > div:nth-child(5) { transform: rotate(202.5deg); }
#status-indeterminate > div:nth-child(6) { transform: rotate(247.5deg); }
#status-indeterminate > div:nth-child(7) { transform: rotate(292.5deg); }
#status-indeterminate > div:nth-child(8) { transform: rotate(337.5deg); }
#status-notice {
margin: 0 100px;
line-height: 1.3;
visibility: visible;
padding: 4px 6px;
visibility: visible;
}
</style>
</head>
<body>
<canvas id='canvas'>
HTML5 canvas appears to be unsupported in the current browser.<br />
Please try updating or use a different browser.
</canvas>
<div id='status'>
<div id='status-progress' style='display: none;' oncontextmenu='event.preventDefault();'><div id ='status-progress-inner'></div></div>
<div id='status-indeterminate' style='display: none;' oncontextmenu='event.preventDefault();'>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
</div>
<div id='status-notice' class='godot' style='display: none;'></div>
</div>
<script type='text/javascript' src='index.js'></script>
<script type='text/javascript'>//<![CDATA[
var engine = new Engine;
var setStatusMode;
var setStatusNotice;
(function() {
const EXECUTABLE_NAME = 'index';
const MAIN_PACK = 'index.pck';
const GDNATIVE_LIBS = [];
const INDETERMINATE_STATUS_STEP_MS = 100;
const FULL_WINDOW = true;
var canvas = document.getElementById('canvas');
var statusProgress = document.getElementById('status-progress');
var statusProgressInner = document.getElementById('status-progress-inner');
var statusIndeterminate = document.getElementById('status-indeterminate');
var statusNotice = document.getElementById('status-notice');
var initializing = true;
var statusMode = 'hidden';
var lastWidth = 0;
var lastHeight = 0;
var lastScale = 0;
var animationCallbacks = [];
function animate(time) {
animationCallbacks.forEach(callback => callback(time));
requestAnimationFrame(animate);
}
requestAnimationFrame(animate);
function adjustCanvasDimensions() {
const scale = window.devicePixelRatio || 1;
if (lastWidth != window.innerWidth || lastHeight != window.innerHeight || lastScale != scale) {
lastScale = scale;
lastWidth = window.innerWidth;
lastHeight = window.innerHeight;
canvas.width = Math.floor(lastWidth * scale);
canvas.height = Math.floor(lastHeight * scale);
canvas.style.width = lastWidth + "px";
canvas.style.height = lastHeight + "px";
}
}
if (FULL_WINDOW) {
animationCallbacks.push(adjustCanvasDimensions);
adjustCanvasDimensions();
} else {
engine.setCanvasResizedOnStart(true);
}
setStatusMode = function setStatusMode(mode) {
if (statusMode === mode || !initializing)
return;
[statusProgress, statusIndeterminate, statusNotice].forEach(elem => {
elem.style.display = 'none';
});
animationCallbacks = animationCallbacks.filter(function(value) {
return (value != animateStatusIndeterminate);
});
switch (mode) {
case 'progress':
statusProgress.style.display = 'block';
break;
case 'indeterminate':
statusIndeterminate.style.display = 'block';
animationCallbacks.push(animateStatusIndeterminate);
break;
case 'notice':
statusNotice.style.display = 'block';
break;
case 'hidden':
break;
default:
throw new Error('Invalid status mode');
}
statusMode = mode;
}
function animateStatusIndeterminate(ms) {
var i = Math.floor(ms / INDETERMINATE_STATUS_STEP_MS % 8);
if (statusIndeterminate.children[i].style.borderTopColor == '') {
Array.prototype.slice.call(statusIndeterminate.children).forEach(child => {
child.style.borderTopColor = '';
});
statusIndeterminate.children[i].style.borderTopColor = '#dfdfdf';
}
}
setStatusNotice = function setStatusNotice(text) {
while (statusNotice.lastChild) {
statusNotice.removeChild(statusNotice.lastChild);
}
var lines = text.split('\n');
lines.forEach((line) => {
statusNotice.appendChild(document.createTextNode(line));
statusNotice.appendChild(document.createElement('br'));
});
};
engine.setProgressFunc((current, total) => {
if (total > 0) {
statusProgressInner.style.width = current/total * 100 + '%';
setStatusMode('progress');
if (current === total) {
// wait for progress bar animation
setTimeout(() => {
setStatusMode('indeterminate');
}, 500);
}
} else {
setStatusMode('indeterminate');
}
});
function displayFailureNotice(err) {
var msg = err.message || err;
console.error(msg);
setStatusNotice(msg);
setStatusMode('notice');
initializing = false;
};
if (!Engine.isWebGLAvailable()) {
displayFailureNotice('WebGL not available');
} else {
setStatusMode('indeterminate');
engine.setCanvas(canvas);
engine.setGDNativeLibraries(GDNATIVE_LIBS);
engine.startGame(EXECUTABLE_NAME, MAIN_PACK).then(() => {
setStatusMode('hidden');
initializing = false;
}, displayFailureNotice);
}
})();
//]]></script>
</body>
</html>

File diff suppressed because one or more lines are too long

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

View File

@@ -1,34 +0,0 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/index.png-7663b4c35f4e22caef50fe5165188bb3.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://bin/html5/index.png"
dest_files=[ "res://.import/index.png-7663b4c35f4e22caef50fe5165188bb3.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -18,7 +18,3 @@ points = PoolVector2Array( -2.96298, 712.01, 129.973, 614.429, 1167.5, 612.894,
[node name="r_door" type="Line2D" parent="."]
position = Vector2( 0, -267.828 )
points = PoolVector2Array( 1175.07, 620.086, 1171.24, 311.267, 1274.8, 356.87, 1278.31, 672.412, 1188.64, 624.843 )
[node name="item" type="Line2D" parent="."]
position = Vector2( 0, -267.828 )
points = PoolVector2Array( 634.097, 516.751, 578.861, 335.008, 701.805, 386.68, 696.459, 509.624, 634.097, 516.751 )

View File

@@ -4,7 +4,7 @@
set_global dialog_advance 1
stop
> [eq dialog_advance 1]
say player "I REALLY don't know what that stuff is." dialog_box_inset
say player "I REALLY don't know what that stuff is."
set_global dialog_advance 2
stop
> [eq dialog_advance 2]

View File

@@ -0,0 +1,13 @@
:look
> [! dialog_popup_advance]
say player "I don't know what that stuff is." dialog_box_inset
set_global dialog_popup_advance 1
stop
> [eq dialog_popup_advance 1]
say player "I REALLY don't know what that stuff is." dialog_box_inset
set_global dialog_popup_advance 2
stop
> [eq dialog_popup_advance 2]
say player "No, SERIOUSLY, I have no idea what that is!" dialog_box_inset
say player "Please stop asking me that!" dialog_box_inset
stop

View File

@@ -19,11 +19,11 @@ camera_limits = [ Rect2( 0, 0, 1289, 555 ) ]
[node name="background" parent="." instance=ExtResource( 2 )]
[node name="Label" type="Label" parent="background"]
margin_left = 371.033
margin_top = 214.057
margin_right = 551.033
margin_bottom = 245.057
[node name="Advice" type="Label" parent="background"]
margin_left = 90.2752
margin_top = 120.824
margin_right = 270.275
margin_bottom = 155.824
custom_fonts/font = ExtResource( 3 )
text = "Move : left click
Fast move : double left click"
@@ -65,14 +65,15 @@ polygon = PoolVector2Array( 1177.94, 348.61, 1175.95, 45.3759, 1276.06, 92.0953,
position = Vector2( 1225.47, 353.99 )
[node name="item" type="Area2D" parent="Hotspots"]
position = Vector2( -217.19, 0 )
script = ExtResource( 5 )
global_id = "r1_wall_item"
global_id = "r1_wall_item1"
esc_script = "res://game/rooms/room1/esc/wall_item.esc"
tooltip_name = "Item on the wall"
default_action = "look"
dialog_color = Color( 1, 1, 1, 1 )
interact_positions = {
"default": Vector2( 671.798, 373.035 )
"default": Vector2( 454.608, 373.035 )
}
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="Hotspots/item"]
@@ -81,5 +82,59 @@ polygon = PoolVector2Array( 635.586, 253.345, 568.928, 60.1716, 709.047, 120.028
[node name="Position2D" type="Position2D" parent="Hotspots/item"]
position = Vector2( 671.798, 373.035 )
[node name="Line2D" type="Line2D" parent="Hotspots/item"]
position = Vector2( 0, -267.828 )
points = PoolVector2Array( 634.097, 516.751, 578.861, 335.008, 701.805, 386.68, 696.459, 509.624, 634.097, 516.751 )
__meta__ = {
"_editor_description_": ""
}
[node name="Label" type="Label" parent="Hotspots/item"]
margin_left = 563.635
margin_top = 265.925
margin_right = 759.635
margin_bottom = 279.925
custom_fonts/font = ExtResource( 3 )
text = "Character talks with text above"
__meta__ = {
"_edit_use_anchors_": false
}
[node name="item2" type="Area2D" parent="Hotspots"]
position = Vector2( 189.644, 0 )
script = ExtResource( 5 )
global_id = "r1_wall_item2"
esc_script = "res://game/rooms/room1/esc/wall_item_popupdialog.esc"
tooltip_name = "Item on the wall"
default_action = "look"
dialog_color = Color( 1, 1, 1, 1 )
interact_positions = {
"default": Vector2( 861.442, 373.035 )
}
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="Hotspots/item2"]
polygon = PoolVector2Array( 635.586, 253.345, 568.928, 60.1716, 709.047, 120.028, 699.524, 247.903 )
[node name="Position2D" type="Position2D" parent="Hotspots/item2"]
position = Vector2( 671.798, 373.035 )
[node name="Line2D" type="Line2D" parent="Hotspots/item2"]
position = Vector2( -4.23779, -267.828 )
points = PoolVector2Array( 634.097, 516.751, 578.861, 335.008, 701.805, 386.68, 696.459, 509.624, 634.097, 516.751 )
__meta__ = {
"_editor_description_": ""
}
[node name="Label2" type="Label" parent="Hotspots/item2"]
margin_left = 556.218
margin_top = 265.925
margin_right = 752.218
margin_bottom = 279.925
custom_fonts/font = ExtResource( 3 )
text = "Character talks with popup"
__meta__ = {
"_edit_use_anchors_": false
}
[node name="player_start" type="Position2D" parent="."]
position = Vector2( 76.7617, 437.649 )

View File

@@ -28,22 +28,9 @@ points = PoolVector2Array( 859.704, 802.519, 815.717, 612.674, 1172.24, 617.258,
position = Vector2( 0, -267.828 )
points = PoolVector2Array( 1175.07, 620.086, 1171.24, 311.267, 1274.8, 356.87, 1278.31, 672.412, 1184.97, 628.571 )
[node name="button_left" type="Line2D" parent="."]
position = Vector2( 0, -266.591 )
points = PoolVector2Array( 322.305, 390.985, 322.305, 439.068, 368.698, 440.037, 368.974, 392.399, 319.028, 391.549 )
[node name="Polygon2D" type="Polygon2D" parent="button_left"]
visible = false
polygon = PoolVector2Array( 343.993, 396.767, 323.298, 415.689, 344.585, 438.158, 365.872, 417.463 )
[node name="button_right" type="Line2D" parent="."]
position = Vector2( 627.193, -266.591 )
points = PoolVector2Array( 322.305, 390.985, 322.305, 439.068, 368.698, 440.037, 368.974, 392.399, 319.028, 391.549 )
[node name="Polygon2D" type="Polygon2D" parent="button_right"]
visible = false
polygon = PoolVector2Array( 343.993, 396.767, 323.298, 415.689, 344.585, 438.158, 365.872, 417.463 )
[node name="bridge" parent="." instance=ExtResource( 2 )]
interact_positions = {
"default": Vector2( 0, 0 )
}
[editable path="bridge"]

View File

@@ -14,6 +14,9 @@ interact_positions = {
"default": Vector2( 971.212, 150.721 )
}
[node name="Line2D" type="Line2D" parent="."]
points = PoolVector2Array( 2.86993, 4.8189, 2.86993, 53.646, 50.8979, 53.9476, 50.5746, 3.69644, -1.72314, 4.51215 )
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
position = Vector2( 971.212, 150.721 )
position = Vector2( 26.9811, 29.4218 )
shape = SubResource( 1 )

View File

@@ -81,28 +81,29 @@ polygon = PoolVector2Array( -1.37926, 443.158, 7.96461, 122.796, 84.0504, 77.411
position = Vector2( 52.1462, 384.691 )
[node name="button_right" parent="Hotspots" instance=ExtResource( 5 )]
position = Vector2( 958.107, 176.401 )
global_id = "r2_button_right"
esc_script = "res://game/rooms/room2/esc/button.esc"
interact_positions = {
"default": Vector2( 337.299, 370.025 )
"default": Vector2( 987.537, 371.812 )
}
[node name="Position2D" type="Position2D" parent="Hotspots/button_right"]
position = Vector2( 962.822, 370.025 )
position = Vector2( 29.4302, 195.411 )
__meta__ = {
"_editor_description_": ""
}
[node name="button_left" parent="Hotspots" instance=ExtResource( 5 )]
position = Vector2( -625.523, 0 )
position = Vector2( 288.82, 171.439 )
global_id = "r2_button"
esc_script = "res://game/rooms/room2/esc/button.esc"
interact_positions = {
"default": Vector2( 345.689, 150.721 )
"default": Vector2( 313.488, 368.437 )
}
[node name="Position2D" type="Position2D" parent="Hotspots/button_left"]
position = Vector2( 962.822, 370.025 )
position = Vector2( 24.6681, 196.998 )
__meta__ = {
"_editor_description_": ""
}

22
game/rooms/room8/esc/room8.esc Executable file
View File

@@ -0,0 +1,22 @@
# :SETUP is called EVERY TIME the room is loaded
# :READY is called only the FIRST TIME the room is loaded
:setup
> [eq ESC_LAST_SCENE room7]
teleport player r8_l_exit
# Set player look right
set_angle player 90
stop
> [eq ESC_LAST_SCENE room9]
teleport player r8_m_door
# Set player look down
set_angle player 180
stop
> [!last_scene]
teleport player player_start
stop
:ready

View File

@@ -1,12 +1,212 @@
[gd_scene load_steps=2 format=2]
[gd_scene load_steps=7 format=2]
[ext_resource path="res://addons/escoria-core/game/core-scripts/escitem.gd" type="Script" id=1]
[node name="magical_closet" type="Area2D"]
[sub_resource type="RectangleShape2D" id=1]
extents = Vector2( 20.13, 26.023 )
[sub_resource type="RectangleShape2D" id=2]
extents = Vector2( 66.4415, 154.457 )
[sub_resource type="Animation" id=3]
length = 0.5
tracks/0/type = "value"
tracks/0/path = NodePath("base/closed:visible")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 1,
"values": [ true ]
}
tracks/1/type = "value"
tracks/1/path = NodePath("base/open_no_object:visible")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 1,
"values": [ false ]
}
tracks/2/type = "value"
tracks/2/path = NodePath("base/open_object:visible")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 1,
"values": [ false ]
}
[sub_resource type="Animation" id=4]
length = 0.5
tracks/0/type = "value"
tracks/0/path = NodePath("base/closed:visible")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 1,
"values": [ false ]
}
tracks/1/type = "value"
tracks/1/path = NodePath("base/open_no_object:visible")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 1,
"values": [ true ]
}
tracks/2/type = "value"
tracks/2/path = NodePath("base/open_object:visible")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 1,
"values": [ false ]
}
[sub_resource type="Animation" id=5]
length = 0.5
tracks/0/type = "value"
tracks/0/path = NodePath("base/closed:visible")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 1,
"values": [ false ]
}
tracks/1/type = "value"
tracks/1/path = NodePath("base/open_no_object:visible")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 1,
"values": [ false ]
}
tracks/2/type = "value"
tracks/2/path = NodePath("base/open_object:visible")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 1,
"values": [ true ]
}
[node name="closet" type="Area2D"]
script = ExtResource( 1 )
dialog_color = Color( 1, 1, 1, 1 )
interact_positions = {
"default": null
}
[node name="Line2D" type="Line2D" parent="."]
[node name="base" type="Line2D" parent="."]
position = Vector2( 1.12247, 0 )
points = PoolVector2Array( 1.96387, 306.585, 1.76169, 4.1832, 126.121, 4.93235, 124.623, 302.346, -0.485764, 300.848 )
[node name="closed" type="Node2D" parent="base"]
[node name="door" type="Polygon2D" parent="base/closed"]
color = Color( 0.4, 0.501961, 1, 1 )
polygon = PoolVector2Array( 5.79657, 8.23298, 5.79657, 297.059, 121.893, 299.89, 123.781, 6.34522 )
[node name="grid" type="Line2D" parent="base/closed"]
points = PoolVector2Array( 26.5586, 38.8841, 26.4838, 74.6036, 106.914, 74.7399, 106.643, 43.8883, 27.9821, 43.8883 )
default_color = Color( 0.415686, 0.415686, 0.415686, 1 )
[node name="Polygon2D" type="Polygon2D" parent="base/closed/grid"]
show_behind_parent = true
color = Color( 0.47451, 0.47451, 0.47451, 1 )
polygon = PoolVector2Array( 29.051, 47.3419, 29.9949, 71.8826, 105.033, 71.8826, 104.561, 45.9261 )
[node name="handle" type="Line2D" parent="base/closed"]
points = PoolVector2Array( 106.643, 175.739, 105.894, 144.275 )
default_color = Color( 0.478431, 0.478431, 0.478431, 1 )
[node name="open_no_object" type="Node2D" parent="base"]
visible = false
[node name="black" type="Polygon2D" parent="base/open_no_object"]
color = Color( 0.141176, 0.141176, 0.141176, 1 )
polygon = PoolVector2Array( 5.79657, 8.23298, 5.79657, 297.059, 121.893, 299.89, 123.781, 6.34522 )
[node name="shelf" type="Line2D" parent="base/open_no_object"]
points = PoolVector2Array( 10.112, 86.2807, 118.234, 86.2807 )
default_color = Color( 0.4, 0.501961, 1, 1 )
[node name="door" type="Polygon2D" parent="base/open_no_object"]
color = Color( 0.4, 0.501961, 1, 1 )
polygon = PoolVector2Array( 1.07718, 7.2891, -37.6216, 23.335, -37.6216, 328.206, 2.02106, 302.722 )
[node name="open_object" type="Node2D" parent="base"]
visible = false
[node name="black" type="Polygon2D" parent="base/open_object"]
color = Color( 0.141176, 0.141176, 0.141176, 1 )
polygon = PoolVector2Array( 5.79657, 8.23298, 5.79657, 297.059, 121.893, 299.89, 123.781, 6.34522 )
[node name="shelf" type="Line2D" parent="base/open_object"]
points = PoolVector2Array( 10.112, 86.2807, 118.234, 86.2807 )
default_color = Color( 0.4, 0.501961, 1, 1 )
[node name="door" type="Polygon2D" parent="base/open_object"]
color = Color( 0.4, 0.501961, 1, 1 )
polygon = PoolVector2Array( 1.07718, 7.2891, -37.6216, 23.335, -37.6216, 328.206, 2.02106, 302.722 )
[node name="statue" type="Area2D" parent="base/open_object"]
script = ExtResource( 1 )
global_id = "statue"
dialog_color = Color( 1, 1, 1, 1 )
interact_positions = {
"default": Vector2( 59.3937, 58.8658 )
}
[node name="object" type="Polygon2D" parent="base/open_object/statue"]
position = Vector2( 1.18921, 7.13524 )
color = Color( 0.662745, 0.529412, 0, 1 )
polygon = PoolVector2Array( 52.338, 36.2829, 57.6774, 26.2716, 62.3493, 36.9503, 70.3583, 35.6154, 70.692, 27.2727, 76.3651, 26.6053, 76.3651, 29.9424, 72.9964, 30.7421, 72.9964, 39.2744, 61.4878, 45.624, 69.2264, 73.602, 43.4311, 73.4035, 53.7492, 45.4256, 41.4468, 39.8697, 41.6453, 31.139, 37.8752, 30.3453, 37.6768, 26.5752, 44.4232, 27.7657, 44.4232, 34.1154 )
[node name="CollisionShape2D" type="CollisionShape2D" parent="base/open_object/statue"]
position = Vector2( 58.2712, 58.8658 )
shape = SubResource( 1 )
[node name="CollisionPolygon2D" type="CollisionShape2D" parent="."]
position = Vector2( 64.2172, 153.408 )
shape = SubResource( 2 )
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
anims/closed = SubResource( 3 )
anims/open_no_object = SubResource( 4 )
anims/open_object = SubResource( 5 )

View File

@@ -0,0 +1,8 @@
# :SETUP is called EVERY TIME the room is loaded
# :READY is called only the FIRST TIME the room is loaded
:use
set_global open_closets 0
set_state r9_closet_left closed
set_state r9_closet_middle closed
set_state r9_closet_right closed

View File

@@ -1,5 +0,0 @@
# Magical closet: the object is always in the LAST opened closet
:open

View File

@@ -0,0 +1,13 @@
# Magical closet: the object is always in the LAST opened closet
:open
inc_global open_closets 1
> [lt open_closets 3]
set_state r9_closet_left open_no_object
stop
> [eq open_closets 3]
set_state r9_closet_left open_object
stop

View File

@@ -0,0 +1,13 @@
# Magical closet: the object is always in the LAST opened closet
:open
inc_global open_closets 1
> [lt open_closets 3]
set_state r9_closet_middle open_no_object
stop
> [eq open_closets 3]
set_state r9_closet_middle open_object
stop

View File

@@ -0,0 +1,13 @@
# Magical closet: the object is always in the LAST opened closet
:open
inc_global open_closets 1
> [lt open_closets 3]
set_state r9_closet_right open_no_object
stop
> [eq open_closets 3]
set_state r9_closet_right open_object
stop

View File

@@ -2,8 +2,24 @@
# :READY is called only the FIRST TIME the room is loaded
:setup
> [eq ESC_LAST_SCENE room8]
teleport player r9_l_exit
# Set player look right
set_angle player 180
stop
> [eq ESC_LAST_SCENE room10]
teleport player r9_r_exit
# Set player look left
set_angle player 270
stop
> [!last_scene]
teleport player player_start
stop
:ready
set_global open_closets 0
#set_state r9_closet_left closed
#set_state r9_closet_middle closed
#set_state r9_closet_right closed

View File

@@ -1,16 +1,18 @@
[gd_scene load_steps=8 format=2]
[gd_scene load_steps=10 format=2]
[ext_resource path="res://addons/escoria-core/game/core-scripts/escterrain.gd" type="Script" id=1]
[ext_resource path="res://game/rooms/room9/background.tscn" type="PackedScene" id=2]
[ext_resource path="res://game/ui/commons/fonts/caslonantique.tres" type="DynamicFont" id=3]
[ext_resource path="res://game/characters/mark/mark.tscn" type="PackedScene" id=4]
[ext_resource path="res://game/rooms/room9/closet/magical_closet.tscn" type="PackedScene" id=5]
[ext_resource path="res://addons/escoria-core/game/core-scripts/escroom.gd" type="Script" id=6]
[ext_resource path="res://addons/escoria-core/game/core-scripts/escitem.gd" type="Script" id=7]
[ext_resource path="res://game/rooms/room2/button/button.tscn" type="PackedScene" id=8]
[sub_resource type="NavigationPolygon" id=1]
vertices = PoolVector2Array( 1168.92, 640.557, 1182.53, 588.863, 1269.59, 622.872, 1275.03, 799.721, 129.634, 615.792, 1143.08, 613.35, -9.16094, 803.802, 84.5821, 654.06, -6.44019, 711.297, 3.15687, 646.051, 59.2201, 628.698 )
polygons = [ PoolIntArray( 0, 1, 2, 3 ), PoolIntArray( 4, 5, 0, 3, 6, 7 ), PoolIntArray( 7, 6, 8, 9, 10 ) ]
outlines = [ PoolVector2Array( -6.44019, 711.297, 3.15687, 646.051, 59.2201, 628.698, 84.5821, 654.06, 129.634, 615.792, 1143.08, 613.35, 1168.92, 640.557, 1182.53, 588.863, 1269.59, 622.872, 1275.03, 799.721, -9.16094, 803.802 ) ]
vertices = PoolVector2Array( 1168.92, 640.557, 1182.53, 588.863, 1269.59, 622.872, 1275.03, 799.721, 1143.08, 613.35, -9.16094, 803.802, -6.44019, 711.297, 846.646, 637.49, 3.15687, 646.051, 59.2201, 628.698, 84.5821, 654.06, 864.626, 613.518, 428.618, 640.487, 386.666, 618.012, 129.634, 615.792 )
polygons = [ PoolIntArray( 0, 1, 2, 3 ), PoolIntArray( 4, 0, 3, 5, 6, 7 ), PoolIntArray( 6, 8, 9, 10 ), PoolIntArray( 7, 11, 4 ), PoolIntArray( 12, 7, 6, 10 ), PoolIntArray( 13, 12, 10, 14 ) ]
outlines = [ PoolVector2Array( -6.44019, 711.297, 3.15687, 646.051, 59.2201, 628.698, 84.5821, 654.06, 129.634, 615.792, 386.666, 618.012, 428.618, 640.487, 846.646, 637.49, 864.626, 613.518, 1143.08, 613.35, 1168.92, 640.557, 1182.53, 588.863, 1269.59, 622.872, 1275.03, 799.721, -9.16094, 803.802 ) ]
[node name="room9" type="Node2D"]
script = ExtResource( 6 )
@@ -79,5 +81,66 @@ polygon = PoolVector2Array( 1177.94, 348.61, 1175.95, 45.3759, 1276.06, 92.0953,
[node name="Position2D" type="Position2D" parent="Hotspots/r_door"]
position = Vector2( 1225.47, 353.99 )
[node name="r9_closet_left" parent="Hotspots" instance=ExtResource( 5 )]
position = Vector2( 435.233, 64.1518 )
global_id = "r9_closet_left"
esc_script = "res://game/rooms/room9/esc/closet_left.esc"
tooltip_name = "Left closet"
default_action = "open"
interact_positions = {
"default": Vector2( 505.158, 383.05 )
}
[node name="Position2D" type="Position2D" parent="Hotspots/r9_closet_left"]
position = Vector2( 69.9246, 318.898 )
[node name="r9_closet_middle" parent="Hotspots" instance=ExtResource( 5 )]
position = Vector2( 572.963, 65.2113 )
global_id = "r9_closet_middle"
esc_script = "res://game/rooms/room9/esc/closet_middle.esc"
tooltip_name = "Middle closet"
default_action = "open"
interact_positions = {
"default": Vector2( 638.65, 383.05 )
}
[node name="Position2D" type="Position2D" parent="Hotspots/r9_closet_middle"]
position = Vector2( 65.6867, 317.839 )
[node name="r9_closet_right" parent="Hotspots" instance=ExtResource( 5 )]
position = Vector2( 710.693, 66.2707 )
global_id = "r9_closet_right"
esc_script = "res://game/rooms/room9/esc/closet_right.esc"
tooltip_name = "Right closet"
default_action = "open"
interact_positions = {
"default": Vector2( 775.32, 383.05 )
}
[node name="Position2D" type="Position2D" parent="Hotspots/r9_closet_right"]
position = Vector2( 64.6273, 316.779 )
[node name="button" parent="Hotspots" instance=ExtResource( 8 )]
position = Vector2( 240.688, 160.459 )
global_id = "r9_button_reset"
esc_script = "res://game/rooms/room9/esc/button_reset.esc"
interact_positions = {
"default": Vector2( 270.892, 369.999 )
}
[node name="Position2D" type="Position2D" parent="Hotspots/button"]
position = Vector2( 30.204, 209.54 )
[node name="Label" type="Label" parent="Hotspots/button"]
margin_left = -15.5154
margin_top = -23.3368
margin_right = 59.4846
margin_bottom = -7.33676
custom_fonts/font = ExtResource( 3 )
text = "Reset closets"
__meta__ = {
"_edit_use_anchors_": false
}
[node name="player_start" type="Position2D" parent="."]
position = Vector2( 76.7617, 437.649 )

View File

@@ -1,14 +1,10 @@
[gd_scene load_steps=5 format=2]
[ext_resource path="res://addons/escoria-core/game/assets/fonts/efmi/efmi_font.tres" type="DynamicFont" id=1]
[ext_resource path="res://game/ui/commons/dialogs/insets/guybrush.jpeg" type="Texture" id=2]
[ext_resource path="res://addons/escoria-core/game/assets/images/no_image.png" type="Texture" id=2]
[ext_resource path="res://addons/escoria-core/template_scenes/dialog_scenes/dialog_box_inset.gd" type="Script" id=3]
[ext_resource path="res://game/ui/commons/dialogs/insets/dialog_box_avatars.tscn" type="PackedScene" id=4]
[node name="dialog_box" type="PanelContainer"]
anchor_left = 0.155
anchor_top = 0.334
@@ -45,25 +41,31 @@ custom_constants/separation = 35
dragger_visibility = 1
[node name="VBoxContainer" type="VBoxContainer" parent="MarginContainer/HSplitContainer"]
margin_right = 150.0
margin_right = 174.0
margin_bottom = 212.0
size_flags_horizontal = 3
size_flags_stretch_ratio = 0.3
[node name="avatar" type="TextureRect" parent="MarginContainer/HSplitContainer/VBoxContainer"]
margin_right = 150.0
margin_bottom = 150.0
margin_right = 174.0
margin_bottom = 184.0
size_flags_horizontal = 3
size_flags_vertical = 3
texture = ExtResource( 2 )
expand = true
[node name="name" type="Label" parent="MarginContainer/HSplitContainer/VBoxContainer"]
margin_top = 154.0
margin_right = 150.0
margin_bottom = 178.0
margin_top = 188.0
margin_right = 174.0
margin_bottom = 212.0
custom_fonts/font = ExtResource( 1 )
valign = 1
[node name="text" type="RichTextLabel" parent="MarginContainer/HSplitContainer"]
margin_left = 185.0
margin_left = 209.0
margin_right = 829.0
margin_bottom = 212.0
size_flags_horizontal = 3
custom_fonts/normal_font = ExtResource( 1 )
bbcode_enabled = true
bbcode_text = "Here be some text"

View File

@@ -1,6 +1,6 @@
[gd_scene load_steps=2 format=2]
[ext_resource path="res://game/ui/commons/dialogs/insets/guybrush.jpeg" type="Texture" id=1]
[ext_resource path="res://game/ui/commons/dialogs/insets/mark_talk_down_right_1.png" type="Texture" id=1]
[node name="dialog_avatars" type="Control"]
__meta__ = {
@@ -8,8 +8,8 @@ __meta__ = {
}
[node name="player" type="TextureRect" parent="."]
margin_right = 40.0
margin_bottom = 40.0
margin_right = 23.0
margin_bottom = 27.0
texture = ExtResource( 1 )
__meta__ = {
"_edit_use_anchors_": false

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.9 KiB

View File

@@ -1,6 +1,7 @@
[gd_scene load_steps=2 format=2]
[gd_scene load_steps=3 format=2]
[ext_resource path="res://game/ui/commons/main_menu.gd" type="Script" id=1]
[ext_resource path="res://game/ui/commons/fonts/caslonantique.tres" type="DynamicFont" id=2]
[node name="main_menu" type="Control"]
anchor_right = 1.0
@@ -16,34 +17,39 @@ anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
margin_left = -92.0
margin_top = -34.0
margin_top = -73.5
margin_right = 92.0
margin_bottom = 34.0
margin_bottom = 73.5
custom_constants/separation = 10
__meta__ = {
"_edit_use_anchors_": false
}
[node name="new_game" type="Button" parent="VBoxContainer"]
margin_right = 184.0
margin_bottom = 20.0
margin_bottom = 83.0
size_flags_vertical = 3
custom_fonts/font = ExtResource( 2 )
text = "New game"
__meta__ = {
"_edit_use_anchors_": false
}
[node name="load_game" type="Button" parent="VBoxContainer"]
margin_top = 24.0
margin_top = 93.0
margin_right = 184.0
margin_bottom = 44.0
margin_bottom = 115.0
custom_fonts/font = ExtResource( 2 )
text = "Load game"
__meta__ = {
"_edit_use_anchors_": false
}
[node name="quit" type="Button" parent="VBoxContainer"]
margin_top = 48.0
margin_top = 125.0
margin_right = 184.0
margin_bottom = 68.0
margin_bottom = 147.0
custom_fonts/font = ExtResource( 2 )
text = "Quit"
__meta__ = {
"_edit_use_anchors_": false