Skip to content

NPC dialog source #103

@exectails

Description

@exectails

Our NPC's dialog code currently looks something like this:

if select("TUTO_GIRL_basic_02", "!@#$TUTO_GIRL_select01#@!", "!@#$Auto_JongLyo#@!") ~= 1 then
	return
end
if select("TUTO_GIRL_basic_03", "!@#$TUTO_GIRL_select02#@!", "!@#$Auto_JongLyo#@!") ~= 1 then
	return
end
if select("TUTO_GIRL_basic_04", "!@#$TUTO_GIRL_select03#@!", "!@#$Auto_JongLyo#@!") ~= 1 then
	return
end

msg("TUTO_GIRL_basic_05")

We take advantage of the fact that the client has the dialogues for all NPCs, and just send localization keys. This has the advantage that it's pretty easy to create NPCs from logs, and we don't have to worry about localization, as long as there is an official translation for your language.

However, we also put ourselves at the mercy of the client. Any string can change at any time, just like their keys, and the script we wrote might not make any sense anymore after a few updates. That wouldn't be a problem if we sent the actual text, without relying on the client. It would also allow users to actually figure out what's going on in a script, instead of just guessing, based on structure and keys.

if select("It would not be strange if the world ended tomorrow.{nl}However, I just want to know. Why the goddesses disappeared..", "Ask about the disappearance of the goddesses", "Cancel") ~= 1 then
	return
end
if select("I'm not sure I understand it completely, but what I'm sure of is that the goddesses didn't disappear all at once.", "Ask what happened", "Cancel") ~= 1 then
	return
end
if select("Goddess Vakarine left us shortly before Medzio Diena.{nl}Both Zemyna and Ausrine disappeared soon after.{nl}It's already been four years since.", "I think you forgot to mention Goddess Laima", "Cancel") ~= 1 then
	return
end

msg("She has never appeared before.{nl}Although I've read somewhere that she does appear every now and then...")

Typing all this out is certainly more work though, even if a Pale plugin could help with that, and I don't know if anyone will actually care about the dialog. It should be said though that writing the script would also be easier with actual text.

I thought I'd create a discussion for it, because I'm not sure which is better, and we should definitely stick to one.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions