Repository navigation
Predefined Variables/Expressions - #2812
Draft
Jowan-Spooner wants to merge 2 commits into
Draft
Jowan-Spooner wants to merge 2 commits into
Jowan-Spooner wants to merge 2 commits into
Conversation
This file contains hidden or 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
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.
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:

These can then be accessed in timelines with:
{C(MyCharacter}.variable}or{T(MyTimeline).variable}.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.