Skip to content

Predefined Variables/Expressions - #2812

Draft
Jowan-Spooner wants to merge 2 commits into
dialogic-godot:mainfrom
Jowan-Spooner:special-variables
Draft

Jowan-Spooner wants to merge 2 commits into
dialogic-godot:mainfrom
Jowan-Spooner:special-variables

Conversation

@Jowan-Spooner

Copy link
Copy Markdown
Member

This adds two new variable/expression-related systems:

Predefined variables for characters and timelines allows to define a set of variables that will be available for each character/timeline:
Godot_v4 7-stable_win64_8XbK9GoU2O

These can then be accessed in timelines with: {C(MyCharacter}.variable} or {T(MyTimeline).variable}.

Godot_v4 7-stable_win64_RFpSD6uYE9

One predefined variable is enforced: @TIMLEINE.visited. It will automatically be ticked up each time start_timeline is called with a timeline.


Predefined expressions act like special variables but are registered on the Expression subsystem to evaluate a function when used. Three are defined in this PR by the text subsystem: {@has_speaker}, {@speaker_name}, {@speaker_color}.


This PR also does a small improvement to the regex of the condition_modifier which allows to escape [ in it now, which allows the use of bbcode in there. Ideally in the future the condition modifier would use a syntax that makes this unnecessary cause it's annoying.

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.

1 participant