There's a character_replace_dialog() function in the Character Select API. I'm not 100% sure I'm putting it in the right place, but it seems to work at my end.
In the main.lua file, there should be a on_character_select_load() function. Add these lines to replace specifically the opening letter:
_G.charSelect.character_replace_dialog(CT_CHARNAME,DIALOG_020, 1, 6, 95, 150, (
"Dear Mario:\
Please come to the\
castle. I've baked\
a cake for you.\
Yours truly--\
Princess Toadstool"))
Some info on the inputs:
- CT_CHARNAME can be replaced with whatever _G.charSelect.character_add() is assigned to
- DIALOG_020 is Peach's letter. You can replace the 020 at the end with another number if you want to change other dialogue. This website lists the dialogue IDs https://ukikipedia.net/wiki/All_text
- 1 apparently doesn't do anything, leave it as is.
- 6 is the number of lines. If you change the number of lines then this should be changed too. (If you add too many lines the text will extend off the bottom of the letter, but if you're going for a funny joke edit then maybe that's fine)
- 95 is the offset from the left side of the text box
- 150 is the width of the text box
Then anything between the quote marks can be changed to whatever text you want.