Adding NPC Speech (Console)

From Meridian 59 - Open Source Wiki
Jump to: navigation, search

Adding new NPC Speach


To add new text to NPCs, go to your server directory and in the dlg folder, open the text file called npc.txt.


What looks like a confusing mess of words is actually all the speach for the NPCs in the game.


How It Works:


You can either add new sentences to existing NPCs, or if you make and add some new NPC character yourself, this is a good way to make them more niteresting!


Let's take Paddock as our example:


send' o 0 randomlibquote who class TosInnKeeper quote q ~kPaddock says, "Frisconar says there is an underground lake somewhere around these parts."


send' o 0 randomlibquote who class TosInnKeeper - That is telling the server to send a random peice of text from the npc.txt file to the NPC of a certain class. In this case it's Paddock (class TosInnKeeper)


quote' q ~kPaddock says, "Frisconar says there is an underground lake somewhere around these parts." - That part is what to actually say. Anything after the q will be sent for all nearby to see.


If the sentence that the NPC is saying gets a little too long, then a new command is needed to join the sentences together:


send' o 0 randomlibappend quote q


This is used in cases like this when Paddock or whoever it is, rambles on about stuff:


send' o 0 randomlibquote who class TosInnKeeper quote q ~kPaddock says, "It's interesting to see all the different types that frequent my place.


send' o 0 randomlibappend quote q Soldiers, masons, bards, acolytes of the Priestesses. The acolytes usually have interes


send' o 0 randomlibappend quote q ting stories to tell about their pilgrimages to the temples."


Notice that it is a randomlibappend and that it doesn't require the class to be mentioned again.


For those time when you can talk to the NPC and actually get an answer, a different command is used:


send' o 0 speechlibtrigger who class TosInnKeeper trigger q GRAVEYARD


Here the command is a trigger. Instead of a random quote, which is for those things NPCs say whenever, a trigger is when you want the NPC to respond to a certain word. Here the trigger word is graveyard and how Paddock responds is with a speechlibquote instead:


send' o 0 speechlibquote who class TosInnKeeper quote q ~kPaddock says, "I'm a little uneasy about setting up shop so close to the old graveyard


send' o 0 speechlibappend quote q . When night falls, the dead pull themselves out of their graves. So far, the people of


send' o 0 speechlibappend quote q Tos have been pretty good about keeping them contained, but I'm still uncomfortable."


You can also set NPCs to respond differently depending on their mood. This is by using another command:


send' o 0 randomlibquote who class TosInnKeeper mood i LIBRES_MOOD_NOT_BAD quote q ~kPaddock says, "Kraanan's Arena is a good place to get better at fighting, but it's no


send' o 0 randomlibappend quote q replacement for the real thing. True warriors only get stronger by taking on stronger be


send' o 0 randomlibappend quote q asts in the wilds."


Here we have the mood i LIBRES_MOOD_NOT_BAD. These are the things Paddock (or whoever) will say when they are in a generally good mood.


Here is a list of mood settings:


mood' i LIBRES_MOOD_NEUTRAL


mood' i LIBRES_MOOD_GOOD


i' LIBRES_MOOD_NOT_BAD


mood' i LIBRES_MOOD_NOT_GOOD


mood' i LIBRES_MOOD_BAD


You can also make the NPC say the name of the person talking to them by using the %NAME tag in the sentance, for example:


send' o 0 speechlibtrigger who class TosInnKeeper trigger q need a courier?


send' o 0 speechlibquote who class TosInnKeeper quote q ~kPaddock says, "Sorry, %NAME, I don't have any letters to be delivered."


Now that you hopefully understand how it works, you can add your own text to the NPCs on your server, or to your own NPCs.


Here are some new bits of dialogue I added to Paddock...


send o 0 speechlibtrigger who class TosInnKeeper trigger q SEX


send o 0 speechlibquote who class TosInnKeeper quote q ~kPaddock wishes he could still have sex after his ~Iaccident~k


send o 0 speechlibtrigger who class TosInnKeeper trigger q ACCIDENT


send o 0 speechlibquote who class TosInnKeeper quote q ~kPaddock says, "Yeh I had an accident once, my dog bit my balls clean off!"


send o 0 speechlibtrigger who class TosInnKeeper trigger q SOCK


send o 0 speechlibquote who class TosInnKeeper quote q ~kPaddock suddenly blerts out, "SoCkS!"


send o 0 speechlibtrigger who class TosInnKeeper trigger q MF


send o 0 speechlibquote who class TosInnKeeper quote q ~kPaddock says, "No, you the mf!"