Skip to content

How to add a new dialogue

MythsList edited this page Oct 29, 2021 · 3 revisions

This page is based off V.1.1.1

Dialogue.txt

Add a new TXT file inside of assets/preload/data/SONGS/song (Replace song with the song you want the dialogue to be played so for example bopeebo) then rename the TXT file as songDialogue.txt if it's a start dialogue or songDialogue-end.txt if it's an end dialogue (Also replace song with the song you want it to be so for example bopeeboDialogue or bopeeboDialogue-end).

Here's an example of what you can do with dialogues, it will ALWAYS follow the format side : portrait(s) : text.

Side

  • 'left' - Shows a single portrait on the left side.
  • 'right' - Shows a single portrait on the right side.
  • 'middle' - Shows two portraits on the left and right side.

Portrait(s)

  • For 'left' or 'right' side - Portraits are named like portrait-bf.png so it should be written bf so the game's code loads the correct portrait.
  • For 'middle' side - Same thing but you have to enter two portraits so if you want to load gfand bf, it should be written gf/bf. The / separates both character portraits so the code doesn't confuse them.

Text

  • For any text - you can put whatever you want.

DialogueBox.hx

Setting the background fade style

hasMusic is self explanatory, if a certain song has music, it will fade in and at the end it will fade out.

Basically put your songs in a new case, you can choose between two fade styles (basic and pixel) and the background fade color. If you don't add your songs, the fade style will defaults to basic with a black background.

Making the background fade style

I don't know how to explain this but if you know how to code you should be able to make a new fade style.

Making a new dialogue box

hasDialog is a bool value you must set to true.

isAnimated is also self explanatory, if the dialogue box is animated set it to true.

The rest is just a "Load the assets" code.

Making a new portrait

All portraits should look like the one above so they can be flipped correctly, etc... They all have the size of 540x540 pixels by default, if you want a different size, you must do extra coding in Portrait.hx.

Make a new PNG file in assets/shared/images/portraits named portrait-character.png. (Replace character with the character you chose so for example portrait-bf.png)

Setting the portraits

leftposX and leftposY are the coordinates of the left portrait.

rightposX and rightposY are the coordinates of the right portrait.

Setting the text's font and color

The dropText is the text's shadow and swagDialogue is the actual text.

You can customize the font, the color and what sound the text should make.

In case your portraits are too small or too big

Add your character's name inside a new case so basically copy paste the previous case and change the value inside the parentheses. The code will resize your portrait like for example the ones from the OG week 6 portraits, the size is multiplied by 6 then by 0.9.