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

Improve runtime resources (timelines and characters created through code) #2537

Merged

Conversation

Jowan-Spooner
Copy link
Member

This makes both DialogicTimeline and DialogicCharacter extend DialogicIdentifiableResource which basically adds a get_identifier and set_identifier method. If an identifier is set at runtime for a non-saved resource, the resource is registered to the directories directly (without a path) allowing for the use of those resources in timelines from then on.

        var characterA := DialogicCharacter.new()
	characterA.display_name = "Code Character"
	characterA.color = Color.WEB_PURPLE
	characterA.set_identifier("CodeCharacter")

	var timelineA := DialogicTimeline.new()
	timelineA.from_text(
	"""
		CodeCharacter: Timeline A!!!
		jump CodeTimelineB/
		label Section2
		CodeCharacter: About to end timeline A.
	""")
	timelineA.set_identifier("CodeTimelineA")

	var timelineB := DialogicTimeline.new()
	timelineB.from_text(
	"""
		Timeline B!!!
		jump CodeTimelineA/Section2
	"""
	)
	timelineB.set_identifier("CodeTimelineB")

	Dialogic.start(timelineA)

This also once again allows using "invalid" character names in timelines (a new character resource will be created on the spot) and will now even interpret the portrait as a color for those, which allows to have one-off characters say something. However the portrait picker is not shown in the visual editor for those characters for now so this is kinda a text-editor exclusive rn.

"Random person" (webpurple): Wait who's that?
"Other person" (darkblue): I think that's the new guy.

Also fixes a bug with dictionaries as export overrides for custom portraits.

This makes both DialogicTimeline and DialogicCharacter extend DialogicIdentifiableResource which basically adds a get_identifier and set_identifier method. If an identifier is set at runtime for a non-saved resource, the resource is registered to the directories directly (without a path) allowing for the use of those resources in timelines from then on.

This also once again allows using "invalid" character names in timelines and will now even interpret the portrait as a color, which allows to have one-off characters say something. However the portrait picker is not shown in the visual editor for those characters for now so this is kinda a text-editor exclusive rn.
@Jowan-Spooner Jowan-Spooner merged commit 3308160 into dialogic-godot:main Feb 17, 2025
3 checks passed
@shazzner
Copy link
Contributor

Great work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants