Skip to content

Commit

Permalink
chore: storing version and changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
StraToN committed Oct 7, 2024
1 parent ba54f2b commit a81eaaa
Show file tree
Hide file tree
Showing 26 changed files with 103 additions and 94 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
## [4.0.0-alpha.267](https://github.com/godot-escoria/escoria-demo-game/compare/v0.0.0...v4.0.0-alpha.267) (2024-10-07)


### Bug Fixes

* initialize escoria.main.last_room_id on loading ([ba54f2b](https://github.com/godot-escoria/escoria-demo-game/commit/ba54f2bd4621716e24bc6cf82a45e27435e60c03))



## [4.0.0-alpha.266](https://github.com/godot-escoria/escoria-demo-game/compare/v0.0.0...v4.0.0-alpha.266) (2024-08-13)


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ onready var task = MovableTask.NONE
func _ready() -> void:
if not parent.has_user_signal("arrived"):
parent.add_user_signal("arrived")


# Main processing loop
#
Expand Down Expand Up @@ -448,12 +448,12 @@ func set_direction(target_dir: int, wait: float = 0.0) -> void:
if target_dir < 0 or target_dir >= parent.animations.dir_angles.size():
escoria.logger.warn(
self,
"Invalid direction to turn to : %s. Valid directions are between 0 and %s. "
"Invalid direction to turn to : %s. Valid directions are between 0 and %s. "
% [str(target_dir), parent.animations.dir_angles.size() - 1]
+ "Resetting target direction to 0 (up)"
)
target_dir = 0

var current_dir = last_dir
var way_to_turn = get_shortest_way_to_dir(current_dir, target_dir)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# Saves the game in the [slot_id] slot, and sets the [savegame_description] in
# the savegame name/title.
#
#
# Example:
# `save_game 1 "description of game saved`
#
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
#
# Turns a movable `ESCItem` or `ESCPlayer` to face a given target direction id
# (between 0 and 3 for a 4-directional character, or between 0 and 7 for an
# 8-directional character).
#
# 8-directional character).
#
# 4-directional :
# 0 : UP / NORTH
# 1 : RIGHT / EAST
Expand Down Expand Up @@ -70,7 +70,7 @@ func validate(arguments: Array):
.node.get_directions_quantity() - 1]
)
return false

return true


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,16 +67,16 @@ func interrupt():
var _sound_players = []
if previous_snd_state.empty():
previous_snd_state = "off"

if _snd_player.empty():
_sound_players = [
ESCObjectManager.MUSIC,
ESCObjectManager.SOUND,
ESCObjectManager.MUSIC,
ESCObjectManager.SOUND,
ESCObjectManager.SPEECH
]
else:
_sound_players = [_snd_player]

for snd_player in _sound_players:
if escoria.object_manager.get_object(snd_player).node:
escoria.object_manager.get_object(snd_player).node.set_state(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ func _get_event_to_queue(
combine_with.global_id
],
"Check that action ':%s %s' exists in the script of item '%s'" % [
action,
action,
target.global_id,
combine_with.global_id
]
Expand Down
24 changes: 12 additions & 12 deletions addons/escoria-core/game/core-scripts/esc/esc_event_manager.gd
Original file line number Diff line number Diff line change
Expand Up @@ -374,8 +374,8 @@ func set_changing_scene(p_is_changing_scene: bool) -> void:
# all event queues.
if _changing_scene:
interrupt([
EVENT_INIT,
EVENT_EXIT_SCENE,
EVENT_INIT,
EVENT_EXIT_SCENE,
EVENT_LOAD,
EVENT_RESUME,
_change_scene.get_command_name()
Expand All @@ -391,9 +391,9 @@ func set_changing_scene(p_is_changing_scene: bool) -> void:
# - return_code: Return code of the finished event
# - channel_name: Name of the channel that the event came from
func _on_event_finished(
finished_event: ESCStatement,
finished_statement: ESCStatement,
return_code: int,
finished_event: ESCStatement,
finished_statement: ESCStatement,
return_code: int,
channel_name: String = CHANNEL_FRONT) -> void:
var event = _running_events[channel_name]
if not event:
Expand Down Expand Up @@ -440,7 +440,7 @@ func _on_event_finished(
return_code,
event.name
)

if finished_event.name == EVENT_LOAD \
and escoria.current_state == escoria.GAME_STATE.LOADING:
escoria.save_manager.is_loading_game = false
Expand Down Expand Up @@ -514,13 +514,13 @@ func save_game(p_savegame: ESCSaveGame) -> void:
var running_event = get_running_event(CHANNEL_FRONT)
if running_event != null:
p_savegame.events.running_event = running_event.exported()

# Scheduled events
var sched_events_array: Array = []
for sched_event in scheduled_events:
sched_events_array.push_back(sched_event.exported())
p_savegame.events.sched_events = sched_events_array

# Events queue
var events_queue_dict: Dictionary = {}
for ev_key in events_queue:
Expand All @@ -531,8 +531,8 @@ func save_game(p_savegame: ESCSaveGame) -> void:
p_savegame.events.events_queue = events_queue_dict


# Recursive function that fills an array with statement ids
# to resume from the running event.
# Recursive function that fills an array with statement ids
# to resume from the running event.
#
# #### Parameters
# - p_running_event: Dictionary containing the nested ESCStatements (first one should be an ESCEvent)
Expand Down Expand Up @@ -567,7 +567,7 @@ func _set_current_statements_in_running_event(running_event: ESCStatement, state
# - p_running_event: The Dictionary containing the event data
func set_running_event_from_savegame(p_running_event: Dictionary):
# Get ids of the statements to set as current
var statement_ids_arr: Array = []
var statement_ids_arr: Array = []
_get_current_statement_ids_in_running_event(p_running_event, statement_ids_arr)
var script: ESCScript = escoria.esc_compiler.load_esc_file(p_running_event.source)
var running_event: ESCEvent = script.events[p_running_event.original_name] # usually "setup" or "ready"
Expand All @@ -583,5 +583,5 @@ func set_running_event_from_savegame(p_running_event: Dictionary):
func set_scheduled_events_from_savegame(p_scheduled_events: Array):
for sched_ev in p_scheduled_events:
var script: ESCScript = escoria.esc_compiler.load_esc_file(sched_ev.event.source)
var ev: ESCEvent = script.events[sched_ev.event.original_name]
var ev: ESCEvent = script.events[sched_ev.event.original_name]
escoria.event_manager.schedule_event(ev, sched_ev.timeout, sched_ev.object)
18 changes: 9 additions & 9 deletions addons/escoria-core/game/core-scripts/esc/esc_object_manager.gd
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ const RESERVED_OBJECTS = [
# ]
var room_objects: Array = []

# Array containing the encountered terrains so they can be properly saved in savegames
# Array containing the encountered terrains so they can be properly saved in savegames
var room_terrains: Array = []

# We also store the current room's ids for retrieving the right objects.
Expand Down Expand Up @@ -257,13 +257,13 @@ func register_terrain(object: ESCObject, room: ESCRoom = null) -> void:
else:
room_key.room_global_id = room.global_id
room_key.room_instance_id = room.get_instance_id()

var terrains: Dictionary = _get_room_terrain_navpolys(room_key)
if object.node is NavigationPolygonInstance:
terrains[object.global_id] = object
if terrains[object.global_id].node.enabled:
terrains[object.global_id].state = "enabled"

if terrains.size() == 1:
var room_container: ESCRoomTerrains = ESCRoomTerrains.new()
room_container.room_global_id = room_key.room_global_id
Expand Down Expand Up @@ -423,30 +423,30 @@ func unregister_object_by_global_id(global_id: String, room_key: ESCRoomObjectsK
# - p_savegame: The savegame resource
func save_game(p_savegame: ESCSaveGame) -> void:
p_savegame.objects = {}

for room_obj in room_objects:
if room_obj.room_global_id.empty():
continue

var room_objects_dict = {}
for obj_id in room_obj.objects:
var obj: ESCObject = room_obj.objects[obj_id]
var obj_json_to_save: Dictionary = obj.get_save_data()
if not obj_json_to_save.empty():
room_objects_dict[obj_id] = obj_json_to_save

p_savegame.objects[room_obj.room_global_id] = room_objects_dict

p_savegame.objects[room_obj.room_global_id] = room_objects_dict

# Add in reserved objects (music, speech, sound), too.
var reserved_objects: Dictionary = reserved_objects_container.objects
for obj_global_id in reserved_objects:
if not reserved_objects[obj_global_id] is ESCObject:
continue
p_savegame.objects[obj_global_id] = reserved_objects[obj_global_id].get_save_data()

# Add ENABLED terrain navigationpolygons in, too.
p_savegame.terrain_navpolys = {}

for room_terrain_container in room_terrains:
if room_terrain_container.room_global_id == current_room_key.room_global_id:
for terrain_name in room_terrain_container.terrains:
Expand Down
6 changes: 3 additions & 3 deletions addons/escoria-core/game/core-scripts/esc/esc_room_manager.gd
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ func init_room(room: ESCRoom) -> void:
if room.is_run_directly:
if escoria.main.current_scene == null:
escoria.main.set_scene(room)

# Register all navigationpolygons in the terrain
if escoria.room_terrain != null:
for n in escoria.room_terrain.get_children_navpolys():
Expand Down Expand Up @@ -292,8 +292,8 @@ func _perform_script_events(room: ESCRoom) -> void:

if room.global_id.empty():
room.global_id = room.name


# Manage player location at room start
if room.player != null \
and escoria.object_manager.get_start_location() != null \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ func exported() -> Dictionary:
exported_dict.original_name = original_name
exported_dict.flags = flags
return exported_dict


# Create a new event from an event line
func _init(event_string: String):
Expand Down
4 changes: 2 additions & 2 deletions addons/escoria-core/game/core-scripts/esc/types/esc_object.gd
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,10 @@ func _set_interactive(value: bool):
# A dictionary containing the data to be saved for this object.
func get_save_data() -> Dictionary:
var save_data: Dictionary = {}

if self.global_id == "player" and not is_instance_valid(self.node):
return save_data

save_data["active"] = self.active
save_data["interactive"] = self.interactive
save_data["state"] = self.state
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ func is_valid() -> bool:
# Execute this statement and return its return code
func run() -> int:
var final_rc = ESCExecution.RC_OK

var statement_id = 0
for statement in statements:
from_statement_id = statement_id
Expand Down
6 changes: 3 additions & 3 deletions addons/escoria-core/game/core-scripts/esc_item.gd
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ func _ready():
)

terrain = escoria.room_terrain

if escoria.object_manager.get_object(global_id).state == ESCObject.STATE_DEFAULT \
and get_animation_player() != null:
escoria.object_manager.get_object(global_id) \
Expand All @@ -238,7 +238,7 @@ func _ready():
._movable.last_dir = animations.get_direction_id_from_animation_name(
get_animation_player().get_animation()
)


if !is_trigger:
if not self.is_connected(
Expand Down Expand Up @@ -333,7 +333,7 @@ func disconnect_trigger_events():
assert(is_trigger)
monitoring = false


# Mouse exited happens on any item that mouse cursor exited, even those UNDER
# the top level of overlapping stack.
func _on_mouse_exited():
Expand Down
2 changes: 1 addition & 1 deletion addons/escoria-core/game/core-scripts/esc_terrain.gd
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ func _ready():
# Returns all NavigationPolygonInstances defined as children of ESCTerrain in an Array.
#
# **Returns**
# A list of NavigationPolygons nodes
# A list of NavigationPolygons nodes
func get_children_navpolys() -> Array:
var navpolys: Array = []
for n in get_children():
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ func set_speaks(p_set_speaks: Array) -> void:
# **Returns** The int value representing the direction id of the animation, or -1 if not found.
func get_direction_id_from_animation_name(p_animation_name: String) -> int:
var founds_array = []

for directions_anim_resource in directions:
if (directions_anim_resource as ESCAnimationName).animation == p_animation_name:
founds_array.push_back(directions.find(directions_anim_resource))
Expand All @@ -87,7 +87,7 @@ func get_direction_id_from_animation_name(p_animation_name: String) -> int:
for speaks_anim_resource in speaks:
if (speaks_anim_resource as ESCAnimationName).animation == p_animation_name:
founds_array.push_back(speaks.find(speaks_anim_resource))

if founds_array.size() > 1:
escoria.logger.warn(
self,
Expand All @@ -96,5 +96,5 @@ func get_direction_id_from_animation_name(p_animation_name: String) -> int:
elif founds_array.size() == 0:
return -1
return founds_array[0]


Loading

0 comments on commit a81eaaa

Please sign in to comment.