Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Character InteractionPolygon is reset when reloading Aseprite file or running game #158

Closed
drbloop opened this issue Feb 21, 2024 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@drbloop
Copy link

drbloop commented Feb 21, 2024

Bug description

When importing a Character via Aseprite, the InteractionPolygon is reset to a default value. This causes the interaction area for a character to be the default small square in the middle of their sprite. This does not happen for other import types like Props in a Room.

I can see this happening by running git diff on the Character tscn after reloading Import or running the game and seeing the polygon coordinates have changed.

--- a/game/characters/manny/character_manny.tscn
+++ b/game/characters/manny/character_manny.tscn
@@ -218,7 +218,7 @@ metadata/_popochiu_aseprite_config_ = {
 
 [node name="InteractionPolygon" type="CollisionPolygon2D" parent="."]
 visible = false
-polygon = PackedVector2Array(-9.75, -14, 11.5, -12.75, 14.25, 16.25, -9, 15.5)
+polygon = PackedVector2Array(-10, -10, 10, -10, 10, 10, -10, 10)

Steps to reproduce

Steps to reproduce the behavior:

  1. Create a Character and import from Aseprite file
  2. Update the InteractionPolygon for the Character in its scene
  3. Add the Character to a Room
  4. Run the Room scene and try to click on the Character

Expected vs observed behavior

I expected the InteractionPolygon would be what I set in the Character scene, but it is instead the small default square.

Environment information (please complete):

  • OS type and version: Ubuntu 22.04
  • Godot version: 4.2.1
  • Plugin version or branch: v2.0.0-beta1

Additional context

I only noticed this when moving to new Aseprite import workflow for Characters, so maybe the problem is in the import code. Previous Characters created without Aseprite import have correct InteractionPolygon boxes in Rooms.

@drbloop drbloop added the bug Something isn't working label Feb 21, 2024
@drbloop
Copy link
Author

drbloop commented Feb 23, 2024

I was able to get around this issue by manually editing the Character tscn file in a text editor. It looks like the InteractionPolygon array of points is declared twice in the file, and unless you edit them both to be the correct value, the InteractionPolygon defaults to the small square.

[node name="CharacterSabrina" type="Area2D"]
priority = 1
script = ExtResource("1_fq3jt")
text_color = Color(0.47451, 0.227451, 0.501961, 1)
can_move = false
popochiu_placeholder = null
script_name = "Sabrina"
description = "Sabrina"
walk_to_point = Vector2(-58, 57)
cursor = 8
interaction_polygon = PackedVector2Array(-19, -65, 26, -65, 22, 15, -17, 16)
...
[node name="InteractionPolygon" type="CollisionPolygon2D" parent="."]
visible = false
polygon = PackedVector2Array(-19, -65, 26, -65, 22, 15, -17, 16)
...

Maybe there is a way to reference the InteractionPolygon in the Character node instead of duplicating it - then there would be a single source of truth.

@mapedorr mapedorr self-assigned this Feb 24, 2024
mapedorr added a commit that referenced this issue Feb 25, 2024
Ignore the polygon assignation process when editing a PopochiuClickable
from its .tscn file, or when it is a PopochiuCharacter.
@mapedorr
Copy link
Collaborator

Will be fixed with #163

mapedorr added a commit that referenced this issue Feb 25, 2024
* Fixes for #159 and #160

Improve behavior of all GUI templates for items use.
[upd] Use Mono font for Label in GUI copy progress popup.
[fix] Validate existance of avatars to fix Portrait component.
[fix] Now item use fallback is handled by the commands script of each
GUI template.

* Fix #158

Ignore the polygon assignation process when editing a PopochiuClickable
from its .tscn file, or when it is a PopochiuCharacter.

* Fix #162

Now the copy process text is shown inside the Setup popup.

[fea] Also adds an Output message to inform the copy process is
completed.
[upd] Style of slots in 9 Verb GUI wasn't correct.
[fix] Update script templates so the method _on_item_used calls
E.command_fallback().

* Update message with potential misunderstanding

Cambridge dictionary says that: an assignation is a meeting that is secret or not allowed, especially one between two people having a romantic relationship.

Co-authored-by: Paolo Pustorino <[email protected]>

* Use a progress bar to show GUI template process

Update code to follow suggestions made by @stickgrinder .

* Update style of copy progress panel to match the engine theme

---------

Co-authored-by: Paolo Pustorino <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants