Skip to content

Conversation

@Arebuayon
Copy link
Contributor

No description provided.

@Arebuayon Arebuayon requested review from JuanFdS, manuq, pablitar and wjt May 9, 2025 20:02
@Arebuayon Arebuayon force-pushed the die-animation-in-stealth-level branch from f68e931 to a7e7ddf Compare May 9, 2025 21:21
Copy link
Collaborator

@manuq manuq left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would like to give this a try myself.

COZY,
## Player is engaged in combat. Player can use combat actions.
FIGHTING,
CAUGHT
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if this really has to be a new player mode. For the stealth game the player is "cozy". The only thing that's needed when caught is to play an animation, and stop handling player input.

Comment on lines -399 to +401
return instant_detection_area.get_overlapping_bodies().front()
for body in instant_detection_area.get_overlapping_bodies():
if body is Player and not body.caught:
return body
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why has this changed? It is not explained.

Comment on lines -404 to +409
var player: Node2D = detection_area.get_overlapping_bodies().front()
for body in detection_area.get_overlapping_bodies():
if body is Player and not body.caught:
if not _is_sight_to_point_blocked(body.global_position):
return body
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here, I wonder why this change is needed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi! I changed this because, to allow defeat animations to play, I could no longer rely on PROCESS_MODE_DISABLED to stop everything. This created a problem: if one guard detected the player and others saw them in the area, multiple guards would trigger alerts for an already detected player.

Iterating through all the overlapping bodies might seem unnecessary if only the player should be in that detection layer, but I added this logic as a safety precaution. If someone accidentally adds another node to the detection layer or group, this prevents errors such as trying to access .caught in a scene that doesn't define it

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the explanation @Arebuayon !

@wjt wjt linked an issue May 12, 2025 that may be closed by this pull request
@manuq manuq marked this pull request as draft May 14, 2025 12:18
@manuq
Copy link
Collaborator

manuq commented May 14, 2025

Converting this PR to draft while I iterate on it.

@wjt
Copy link
Member

wjt commented May 19, 2025

Superseded by #654

@wjt wjt closed this May 19, 2025
@wjt wjt deleted the die-animation-in-stealth-level branch May 19, 2025 09:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Use StoryWeaver’s defeat animation in Stealth game

4 participants