Titan Quest Wiki
Register
Advertisement

Flavor text can be used to enhance the players experience when he or she enters certain areas. The text may convey information that otherwise would be lost to the player such as smells or sounds that would be hard to indicate in other ways. The following tutorial gives one way to add flavor text to a module.
The tutorial explains a method for creating an invisible NPC, a dialog for that NPC, and a quest file to initiate the dialog when a player enters a specific trigger zone. Since this uses a specialized NPC to do the trick, reading and understanding Talking NPC: How To would be beneficial.

Customizing All the Parts[]

The NPC[]

You need to make an NPC invisible. Here is how:

  1. Download the invisible.psd.
  2. Unzip it and save it to C:\Documents and Settings\YOUR USER NAME HERE\My Documents\My Games\Titan Quest\Working\CustomMaps\YOUR MOD NAME HERE\source\Textures
    Fairytale messagebox critical If you have changed the location of your My Documents folder, your path will differ accordingly
  3. Open the Art Manager and select your mod.
  4. Open the Textures file folder. The invisible.psd file should be there.
  5. Right Click and select "Auto Create Asset"
    03autocreate

  6. Select "texture" and click Okay
  7. Select DXT3 as the texture type and click okay
    04texture

  8. Import a talking NPC. One can be found here: records\creature\npc\speaking\story\alalaq11.dbr
  9. Click the "Database" tab
  10. Copy the entry to another location and rename it.
  11. A dialog file also needs to be imported. One can be found here: records\dialog\story\alalaq11_a.dbr
  12. Click the "Database" tab
  13. Copy the entry to another location and rename it.
    Flavor01

  14. Build your database by pressing F7
  15. Right click the NPC entity and select edit.
    Flavor02

  16. Several items need to be edited:
    • Header
      • FileDescription - A description for you to use in the database (optional)
    • NPC Static Dialog
      • dialogPak - enter the database entry for the dialog pak you imported above
    • NPC:Map
      • IncludeInMap - make this zero (entity will not show up as yellow exclamation mark on minimap)
    • Character
      • invincible - 1
    • Actor Variables
      • description - FlavorText01Loc (an entry in modstrings.txt yet to be created
      • baseTexture - the invisible tex file imported previously.
      • scale - 0.1 or smaller
    • Reward
      • goldGeneratorChance - 0
    • Initial Equipment
      • Ensure that all body pieces have ChanceToEquipXXX as "0." This will give this NPC no starting equipment.
      • Delete all entries in the lootXXXItemX
  17. Save this database entry
  18. Right click on the dialog pak that was imported earlier and select edit.
    Flavor03

  19. A couple of entries in this record need to be changed:
    • Header
      • FileDescription - a note to yourself what this item is for (optional)
    • Default Dialog
      • defaultDialogTextTag - change to "FlavorText01" (an entry in modstrings.txt that hasn't yet been created)
      • defaultDialogSoundFile - if it exists, delete or change if you have imported an mp3 for this text
    • Additional Dialog and Irritation Dialog
      • Ensure that all XXDialogTextTags and XXDialogSoundFile entries are deleted.
  20. Save the database record
  21. Build your database by pressing F7

Modstrings.txt[]

There are only a couple of entries that need to be added to the modstrings.txt file.

  1. Open the modstrings.txt file by clicking on the "Text" folder under the "Sources tab"
  2. If you haven't created the asset do so now by right clicking the file and selecting "Auto Create Asset"
  3. Add the following two entries:
    • FlavorText01Loc=A Dark Dungeon
    • FlavorText01=As you enter the room you are overcome with a strong feeling of nausea.
    The first is actually the name of the NPC, the second is the flavor text itself - the NPC's dialog
  4. Save the file.
  5. Build your database by pressing F7

The Bounding Volume[]

A trigger is needed to start the quest which initiates the dialog with the player These are found in the "triggers" portion of the object tool pallet.

  1. In the Art Manager, import the following record: records\triggers\quests\testquestregion.dbr
  2. Click the "Database" tab.
  3. Copy the entry to another location and rename it
  4. Nothing else needs to be changed, but the Volume Variables:radius could be increased or decreased as necessary for your mod. This is the size of the bounding volume in the game.
  5. Build the mod by pressing F7

Coding Quest File[]

Almost done...

  1. Open up the Quest Editor and select your mod
  2. Select File-New Quest Document (Ctrl+N)
  3. There should be a File "New Quest 1" on the left. Right click this and select Add Quest Step
  4. Select the new quest step (on the right)
  5. Click the Add Trigger button GS42
  6. Under the trigger seclect Conditions and click the New Condition button GS69
  7. Select Enter bounding volume as the condition
  8. On the far right, there is a pallet similar to the object tool. Find the bounding volume that was changed and select it. At the bottom, click the elipsis that corresponds with BaseDatabaseRecord. The location of the bounding volume should appear in the blank.
    Flavor04

  9. Click the Add new action button GS70
  10. Select Initiate Conversation with X as the action
  11. Find the invisible NPC that was created and select it from the pallet. At the bottom, click the elipsis that corresponds with NPC. The NPC's database location should appear.
    Flavor05

  12. Your quest should look similar to the following:
    Flavor06

  13. Save the quest to C:\Documents and Settings\YOUR USER NAME\My Documents\My Games\Titan Quest\Working\CustomMaps\YOUR MOD NAME\source\Quests
  14. Close the Quest Editor.

That is the only coding that is necessary, but here are some other ideas:

  • Kill the NPC off, since he isn't needed anymore
  • Change the NPC's dialog to be dynamic based on the situation

Adding in the Pieces[]

  1. Open up the Art Manager
  2. In the sources tab, select the quests file
  3. Right click the quest that was just made and "Auto Create Asset"
  4. Build your database by pressing F7
  5. Open the World Editor and select your mod
  6. Under the Quest menu, click Select Files...
    08 door

  7. Find and select your quest from the list. If there are more than one, you will need to select all you wish to add at once by holding down the CTRL button.
  8. Click Add, and then Ok

Conclusions[]

All the pieces should be present in the object tool pallet in the World Editor. The NPC will need to be placed where you want the text to appear, with the specific bounding volume placed over it. Since this is an NPC with a valid dialog tree, if the mouse hovers over him, the player can initiate the dialog. Keep that in mind if you have multiple dialogs for the same NPC.


See Also[]

Advertisement