Forum Mod Bakery Docs

Dialog questions

Posted in Support
Please login to contribute to the conversation.
(AUGH, I ask too many questions)

I was looking inside SHAR's files (and the dialog.spt file that is found in one of the RCF files) and the Donut Mod's LMLM file with a HEX editor, and I still don't understand how the dialog system works (but I do understand the animations during the conversations). I thought it had something to do with the name of the files since includes the character's name, that number which I assume tells the game which order the line is played, but to be sure, how does dialog work in terms of LUA coding?

Is it also possible to make it so when you "talk" to a race host or bonus mission character, the game goes straight to the mission screen without needing to play the dialog (like how when you are about to enter a wager race, the game goes straight to the mission screen)? It may sound pointless, but most of the dialog in the game wouldn't fit with how the mission is supposed to be beat, even when edited.
"I thought it had something to do with the name of the files since includes the character's name"
The filenames are an absolutely crucial part of the game's dialog system, and these files are referenced by sound resources created in Sound Scripts (.spt files).

"but to be sure, how does dialog work in terms of LUA coding?"
You make a Path Handler for a sound script and then you'd handle it like any other script. You output a script to the game using Lua. Donut Mod uses a script I created that reads a bunch of individual files, combines them, and hands them over to the game as one sound script (as far as the game is concerned).

The mod launcher has a Lua function called Output which outputs code to the game. The mfk.lua script I released some time ago adds Lua versions of every MFK function in the game, and then outputs the equivilent MFK code to the game, which lets you skip using Output in the case of missions.

Now in Donut Mod, I made one function for use in handling the creation of sound resources in sound scripts but I haven't publicly released that script yet.

"Is it also possible to make it so when you "talk" to a race host or bonus mission character, the game goes straight to the mission screen without needing to play the dialog"
You could copy the 4 dialog.spt files (you may have noticed the 3 for other languages of the game) to your mod and delete the sound resources associated with whatever conversation you want to remove. I believe that'd work since the function that adds Louie refers to a conversation that doesn't actually exist, and as you probably know Louie doesn't actually say anything before a wager race.
When I deleted entire conversation from the SPT file and began talking to somebody who normally speaks using those files, the "conversation" isn't skipped. Instead, the player and the NPC (he's not Louie) just stare at each other, and this causes the player to be stuck for some reason after declining the mission (trying to start it does nothing). I once replaced a race host with somebody who isn't, and the same thing happened, though it was expected. Changing the filename to make it so that the original character's name is replaced by the other one does the same thing.