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
coppolaemilio
merged 5 commits into
dialogic-godot:version-2.0
from
Jowan-Spooner:character_portraits
Jun 14, 2022
Merged
2.0 Character editor and (simple) Portrait management #925
coppolaemilio
merged 5 commits into
dialogic-godot:version-2.0
from
Jowan-Spooner:character_portraits
Jun 14, 2022
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() |
There was a problem hiding this comment.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Commit 1:
This commit adds a Wait event with a float input for seconds.
Notes:
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:
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
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.
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: