Open blurymind opened 8 months ago
I almost have something now that can be pr-ed.
Created a task here for feedback https://trello.com/c/OyHmrf2D/537-implement-an-actor-concept-to-dialoguetools-extension
This has been bugging me with the initial implementation for ages
This is now in PR, I just need to create a simple example of the new mechanics and do some more testing.
This was tested in a more complete project setting via javascript event blocks before pr-ed. I just migrated my code to the pr and renamed/hooked some things.
Description
Dialog heavy games often introduce the concept of an actor. That concept is used to apply base styling to the text when an actor is talking, change the avatar and do other things.
currently trying to do this with dialogtools is kind of cumbersome. You have to manually do it with bbtags all over the place that are later difficult to update (if you decide to change an actor's text color for example)
Solution suggested
The dialogtools extension can get a new mechanism that lets you add, remove and keep track of existing story actors.
Its interface can get a few new actions and conditions, as well as scrolling text parsing capabilities;
actions:
example: addActor(id="fl", color:230,122,113, name="Florian")
example: removeActor(id="fl")
expressions:
example: getActorInfo(id="fl", key="color") --> outputs "230,122,113" which can be used to set the color in the dialog box via the event sheet
example: return fl or mike (the id), you can pass that to getActorInfo to drive base styling of objects in GD integration within yarn syntax:
also when we write a line like this in yarn
dialog tools can identify that the line starts with an existing actor's id, followed by
":"
, and if so, automatically apply a style to it in the game via the new event sheet expressions + strip out the id: from the beginning of the scrolling text lineAnd so of course this is entirely optional and if the user has not created any actors linked to dialog text lines, this new behavior is not applying any change to the scrolled text
@4ian is this something that would be welcome as pr? I kind of take this idea from how visual novels are implemented - specifically renpy. Also notice that alot of existing yarn games are doing this extra step in order to reduce tying to set text color/avatar/etc when the talking character is changing
the basic goal here is to eliminate the need to use tons of repeated commands and bbtags to set things up every time the talking actor in the game changes. Make the actual story writing process much easier and less verbose/prone to errors. If the dev takes the extra steps to add actors and set them up, they can benefit from just starting a dialog line with their name