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

2.0 Character editor and (simple) Portrait management #925

Merged

Conversation

Jowan-Spooner
Copy link
Collaborator

@Jowan-Spooner Jowan-Spooner commented Jun 13, 2022

Commit 1:

This commit adds a Wait event with a float input for seconds.

Notes:

  • Adds a float mode to the Number input
  • Fixed a bug when the last event was an End Branch event.

Commit 2

Character editor

This re-implements the character editor from 1.x, but with a few changes.
Scale, offset and mirror are now per-portrait, although I added a new Main scale setting that affects all portraits. The "real-size-preview" is a bit more advanced. It has an origin point now and actually displays the portrait offset. It's the new default view. I believe for everything except pixel-art games, this is the view you wan't to use.

There have been a couple of few changes to the timeline editor and toolbar to make them behave when the character editor is opened.

Commit 3

Portrait display nodes

There are now 2 more Dialogic Display Nodes:

  • PortraitPosition scene is a Position2D node that only has a portrait_index (any integer 0 <= x <= 100)
  • PortraitHolder scene is a CanvasLayer that the portraits will be added to as children.

There should always only be at most one Portrait Holder (although more will not break) and there can be unlimited PortraitPositions, although they should ideally have different indexes. The DefaultDialogNode has 5 positions set up with the indexes 1 to 5

DialogicGameHandler functions

  • update_portrait() -> updates or adds a portrait
  • remove_portrait() -> removes a character
  • is_character_joined() -> true if the character has a visible portrait
  • get_current_portrait_info_of_character() -> returns all the stored info on the portrait of the character (e.g portrait name, position, the actual node, etc.)

These functions mainly use the current_portraits array to communicate with each other/store stuff.

Event updates

The character event and text event have been updated to use the methods listed above to manipulate the portraits.

  • Character Event has a position spin box. This is not optimal, especiall as writing a number in the text format is really obnoxious. My suggestion are somewhat named positions, either in the settings (e.g {1:'left', 2:'center_left', 3:'center', 4:'center_right', 5:'right'}) or as strings actually entered on the PortraitPosition nodes (then it would be hard to suggest them tho).

Example Assets

I've added CC0 portraits of characters to test this. If this is to much, we can delete them again. They are the same that I used in the official Dialogic Test Project.

Missing from last commit :(

The character resource actually has a couple of needed updates for the last commit that I forgot to stage. These include new variables for nicknames, description, scale and theme.

Images:

grafik
grafik
grafik
grafik
grafik

This commit adds a Wait event with a float input for seconds.

# Notes:
- Adds a float mode to the Number input
- Fixed a bug when the last event was an End Branch event.
# Character editor
This re-implements the character editor from 1.x, but with a few changes. 
Scale, offset and mirror are now per-portrait, although I added a new `Main scale` setting that affects all portraits. The "real-size-preview" is a bit more advanced. It has an origin point now and actually displays the portrait offset. It's the new default view. I believe for everything except pixel-art games, this is the view you wan't to use.

There have been a couple of few changes to the timeline editor and toolbar to make them behave when the character editor is opened.
# Portrait display nodes
There are now 2 more Dialogic Display Nodes:

- PortraitPosition scene is a Position2D node that only has a portrait_index (any integer  0 <= x <= 100) 
- PortraitHolder scene is a CanvasLayer that the portraits will be added to as children.

There should always only be at most one Portrait Holder (although more will not break) and there can be unlimited PortraitPositions, although they should ideally have different indexes. The DefaultDialogNode has 5 positions set up with the indexes 1 to 5

# DialogicGameHandler functions
- update_portrait() -> updates or adds a portrait
- remove_portrait() -> removes a character
- is_character_joined() -> true if the character has a visible portrait
- get_current_portrait_info_of_character() -> returns all the stored info on the portrait of the character (e.g portrait name, position, the actual node, etc.)

These functions mainly use the `current_portraits` array to communicate with each other/store stuff.

# Event updates
The character event and text event have been updated to use the methods listed above to manipulate the portraits. 

- Character Event has a position spin box. This is not optimal, especiall as writing a number in the text format is really obnoxious. My suggestion are somewhat named positions, either in the settings (e.g {1:'left', 2:'center_left', 3:'center', 4:'center_right', 5:'right'}) or as strings actually entered on the PortraitPosition nodes (then it would be hard to suggest them tho).


# Example Assets
I've added CC0 portraits of characters to test this. If this is to much, we can delete them again. They are the same that I used in the official Dialogic Test Project. 

# Missing from last commit :(
The character resource actually has a couple of needed updates for the last commit that I forgot to stage. These include new variables for nicknames, description, scale and theme.
var Time :float = 1.0

func _execute() -> void:
var timer = Timer.new()
Copy link
Collaborator

Choose a reason for hiding this comment

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

We should probably use the scene tree timer here instead of creating one https://docs.godotengine.org/en/stable/classes/class_scenetreetimer.html

@coppolaemilio coppolaemilio merged commit 5a8e796 into dialogic-godot:version-2.0 Jun 14, 2022
@Jowan-Spooner Jowan-Spooner deleted the character_portraits branch December 26, 2023 17:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants