Terraria

Terraria

Terraria Official Steam Workshop
Create, discover, and download the best Texture/Language/Music Packs & Worlds in order to enhance your Terraria adventures! Create your own content to share with the world! Click below to learn how!
Learn More
Uzi 8 25 Jul, 2024 @ 11:15pm
Editing NPC Dialogue Via .json Files
I've been searching for ANY SORT of help for editing NPC dialogue through .json files for a stupid resource pack I've been creating. I've. Found. Nothing. Barely any guides touch on the details that I've wanted to know. If you're a Terraria genius and know what I'm talking about, please help me since doing the worm with a boner appears to be easier than trying to figure this stuff out alone.

I've been trying to edit all of the Dryad's dialogue in favour of a new character. :LIS_poker_face:
< >
Showing 1-2 of 2 comments
Snek 27 Jul, 2024 @ 11:33am 
I'm assuming that you already know how to make Resource Packs and to make text changes in them, given what's currently on your Workshop. Editing NPC dialogue is no different than replacing any other text, the main issue is just finding what keys to replace.

tl;dr: Your best bet is to search through Terraria's localization dump[forums.terraria.org] for quotes from the wiki. Once you know what keys to replace, it's no different than replacing item names.
The categories you want are "LegacyDialog", "DryadSpecialText", and "StardewTalk".




Because of how long the Dryad has been in-game, there are three places in Terraria's localization files that hold her dialogue: The "DryadSpecialText" category, the "StardewTalk" category, and the "LegacyDialog" category.

The keys in the DryadSpecialText and StardewTalk categories should be self-explanatory in when they are shown. The LegacyDialog category, on the other hand, uses arbitrary numbers as keys instead of meaningful names.

Firstly: If the Dryad has special event text (found in DryadSpecialText), the game will roll to see if she uses it. If no special event text is rolled, the Dryad tries to use the following keys in order:
  • LegacyDialog.69 -> Pre-EoW, at a random chance
  • LegacyDialog.332 -> Pre-BoC, at a random chance
  • LegacyDialog.70 -> The Arms Dealer is present, at a random chance
  • LegacyDialog.71 -> The Merchant is present, at a random chance
  • LegacyDialog.72 -> The Old Man is present, at a random chance
  • LegacyDialog.238 -> The Truffle is present, at a random chance
  • LegacyDialog.73 - 76: 100% if a Blood Moon is active and no previous option has been picked
  • LegacyDialog.77 -> Corruption world, at a random chance
  • LegacyDialog.333 -> Crimson world, at a random chance
  • LegacyDialog.78 - 81: No previous option has been picked
If the player has a Joja Cola, this will override all other possible dialogue options.

Some of the texts that show up when certain NPCs are present will contain text enclosed in curly braces ({}), which will be substituted with the respective NPC's name when shown to the player.
If there's a number enclosed in curly braces (e.g. {0}), then you can't replace it. Your final text must contain these curly-braced numbers somewhere, and they will be replaced with appropriate values when shown to the player. The link above has a section called "Advanced Formatting" that explains this better.
There are some other substitutions you can put into your dialogue:
  • {WorldName} -> The name of the world
  • {PlayerName} -> The player's name
  • {AnglerCompletedQuestsCount} -> The number of complete quests
  • {TotalDeathsCount} -> The number of times the player has died
  • {WorldEvilStone} -> "Ebonstone" on Corruption worlds, "Crimstone" on Crimson worlds
There are many more possible substitutions, but the Dryad unfortunately isn't set up to safely use the full system -- maybe 1.4.5 will covert all the legacy dialogue to use it.

This guide has been specific to the Dryad, though many of the issues present with her are also present in other pre-1.4 NPCs. In general, your best bet is to refer to the wiki and search for the target NPC's quotes in Terraria's localization dump to figure out the keys you need to replace.
Uzi 8 27 Jul, 2024 @ 12:04pm 
♥♥♥♥♥♥♥♥♥ youre my equivalent of jesus thank you so much
< >
Showing 1-2 of 2 comments
Per page: 1530 50