Codename Logo Codename Logo

Cutscenes and Dialogues

APIWiki

Cutscenes and dialogues.

Cutscenes

Making Cutscenes is easy, either drop an .mp4 file in ./videos with the name of the song followed by -cutscene at the end, or drop it in the corresponding song folder and simply name it cutscene.mp4

You can also put an -end before -cutscene to make that cutscene appear at the end of the song.
Starting them manually with also a custom prefix is also possible, check the Cutscenes/Dialogue Scripts page.

Dialogues

Codename Engine also supports Dialogues, though there's a lot to unwrap here, so please read with patience.

Making a basic dialogue is done by making a file called dialogue.xml in the corresponding song folder, and the content should look something like this:

<dialogue box="default">
    <!-- All characters -->
    <char name="dad" position="left" />
    <char name="girlfriend" position="middle" />
    <char name="boyfriend" position="right" />

    <!-- Lines -->
    <line char="dad">
        yo its me your <format color="#FF0000">enemy!</format> how are you
    </line>
    <line char="boyfriend">
        shut up u stupid bitch
        ur useless af!!! loser!
    </line>
    <line char="girlfriend">
        agreed
    </line>
</dialogue>

This dialogue covers all types of characters (only having 3 types of positions).

Starting with the <dialogue> node, it only has 2 parameters:

For the <char> node, it has the following parameters:

As for the <line> node, the example shows it's default usage, so the next parameters are mostly for advanced usage:

The <line> node also accepts <format> children, to format different parts of the text. The parameters are:

Setting up Dialogue Characters.

After realizing how to basically make a dialogue, you can now start adding custom characters besides the default ones.

You can start by making an XML file with the character's corresponding name and put it in ./data/dialogue/characters/.

Here's what Boyfriend's data looks like:

<character x="285">
    <anim name="normal" anim="normal" fps="24" />
</character>

We'll quickly go through the parameters here, for <character>:

Other options include:

As for the <anim> nodes, these are the parameters:

(if you think this is familiar yes this is basically the same as making a sprite in a stage.)

Setting up Dialogue Boxes.

If you feel like also customizing boxes, fret not because you can also change that as well. (although this is gonna be a bit more advanced than the last 2)

You can start by making an XML file with the box's corresponding name and put it in ./data/dialogue/boxes/.

The default box's XML data looks like this:

<dialoguebox y="75">
    <!--
        Node containing all text settings
    -->
    <text font="vcr.ttf" x="107" y="206" width="1053" color="#000000" size="40"/>

    <!--
        All positions for characters
    -->
    <charpos name="left" x="-500" y="184" flipBubble="true" />
    <charpos name="middle" x="0" y="184" />
    <charpos name="right" x="500" y="184" />

    <!--
        All animations for the dialogue box
        For example, if you wanna add an "angry" animation, add an animation named "angry" (box idle), and "angry-open" (not needed, for box apparition)
    -->
    <anim name="normal" anim="speech bubble normal" fps="24" loop="true" x="-30"/>
    <anim name="normal-open" anim="Speech Bubble Normal Open" fps="24" />

    <anim name="angry" anim="AHH speech bubble" fps="24" loop="true" y="60"/>
    <anim name="angry-open" anim="speech bubble loud open" fps="24"  y="60"/>
</dialoguebox>

There's a lot to unpack but we'll go over each step in understanding this.

The <dialoguebox> node parameters and also the <anim> node parameters are exactly like the Dialogue Character ones (such as sprite for <dialoguebox>), so we'll skip those. (keep in mind if you make an animation with an -open at the end it will be used as an opening animation).

For the <text> node, which is required for this Dialogue Box to be considered valid, has the following parameters:

Now, for the <charpos> node, it's pretty simple, these are the parameters:

Written by: Frakits & Nex_isDumb
Last updated: 2024-10-14