GameMaker Touhou Engine   Home   Downloads   Documentation

_DIALOGUE_CONTROLLER


The object that draws dialogue and handles dialogue progression.


Locals:


Name Type Significance
_ACTORS_LEFT Sprite Reference Array The cutins of the characters that are to be displayed on the left side of the screen during dialogue (left to right).
_ACTORS_RIGHT Sprite Reference Array The cutins of the characters that are to be displayed on the right side of the screen during dialogue (right to left).
_DIAG_RECT_X Integer The left X-coordinate of the black rectangle where text will be drawn during dialogue.
_DIAG_RECT_W Integer The width of the black rectangle where text will be drawn during dialogue.
_DIAG_RECT_H Integer The height of the black rectangle where text will be drawn during dialogue.
_DIAG_RECT_Y Integer The top Y-coordinate of the black rectangle where text will be drawn during dialogue.
_LINE_NUMBER Integer The number of the current line of dialogue (counted from 0). A value of -1 indicates dialogue has not yet started.
_SEQUENCE_ARR_ACTOR_I String Array The string at position i represents the control string (see below) for line i.
_SEQUENCE_ARR_STRING String Array The string at position i represents the markup string (see _DRAW_MARKUP_STRING()) for line i.
_DRAW_TEXT Boolean Whether or not the dialogue text is being drawn.
_TALPHA Float The alpha value of the black rectangle where text will be drawn during dialogue, also used to calculate the base alpha value of the character cutins.
_TEXT_ALPHA Float The current alpha value of the text being drawn during dialogue.
_ACTOR_ALPHA Float The current alpha value of the active character cutin(s).
_FADING Boolean Whether or not the initial fading-in is being peformed.
_INTERMISSION Boolean Whether or not the dialogue sequence is currently unable to progress.
_CHOOSING Boolean Whether or not the player is currently making a choice.
_CHOICE Non-negative Integer The index of the currently selected choice, counted from 0.
_CHOICE_TIMELINES Object Reference Array Each object in this array signifies the timeline object which will be created when the choice of the corresponding index is selected.
_CUTIN_SPACE Integer The space, in pixels, between each character cutin on one given side.

Control Strings


A control string is a special string that tells GMTE which character/s are speaking during a given line of dialogue. A control string has the form of:


l n0 n1 ... nk r m0 m1 ... mp

ni and mi represent an index in _ACTORS_LEFT and _ACTORS_RIGHT respectively, signifying that the character whose cutin is located at that index is active. In order to
signify that no actors are active on a given side, n/m0 should be equal to the length of _ACTORS_LEFT/RIGHT and no other index should be named.


Events:


Trigger # Actions
Create 1 Declare local variables, as well as global._DIALOGUE_ACTIVE.
Step 1 Increase the alpha-related local variables to achieve a fading-in effect for the text and character cutins.
User Defined 0 1 Advance the dialogue if it can be advanced, creating the corresponding timeline object if the player has made a choice. (if you wish to continue dialogue, just reinitialize the dialogue sequence on the first step of the timeline)
User Defined 1 1 Decrease the selected choice index.
User Defined 2 1 Increase the selected choice index.
Draw 1 Draw the character cutins on both sides of the screen in the designated orders semi-transparently except for the currently active ones, draw the black rectangle that holds the text, before drawing the text using _DRAW_MARKUP_STRING(), all of this for the current designated line of dialogue. Note that the active characters are drawn in a separate iteration after the others, in the same orders (left side is drawn left to right, the ride side is drawn right to left).