Mod:Create a dialogue

From Wikipedia 2197
Jump to navigation Jump to search

This tutorial shows how to create or edit dialogs in The Sum.

This tutorial uses mainly the Notepad++ text editor.

Required tools[edit | edit source]

Before You Begin[edit | edit source]

Please take some time to browse the "Speech" section of the readme file from the Fallout Tactics editor.

Create a dialogue[edit | edit source]

Access the .txt file of the location[edit | edit source]

Each location has its dialog file (with an eponymous code name) already imported. It is in Game/NousAurons/locale/ (French version) and Game/core/locale/ (English version). Some of these files are in a folder of the same name to allow to also store voice files.

Bulb.png  Any .mp3 file (in the same folder) with the same file name as a dialog entry (ex: AJOUT_Di_1_1.mp3 will be heard in the game. 



Writing introduction[edit | edit source]

  1. Open the two files 'location_code_name_where_the_dialogue_takes_place.txt and for each of them:
    1. Press
       ctrl 
      +
       f 
      and search for "// DIALOGUES"
    2. Copy/paste the following code:
      ADD_Di_1 = {<Ck>- Dialog portion}
  2. Add as many dialog portions as you need.
  3. Go to the
     File 
    menu and then
     Save 
    .

Writing convention[edit | edit source]

  • Each dialog code name (ex: AJOUT_Di_1) must be unique in the file where it is added.
  • AJOUT_: helps to find the dialog first in the alphabetical list when it is integrated in the Level editor.
  • Di_: indicates that it is a portion of a dialog.
  • Acc: indicates that this is the character's first piece of dialogue.
  • R: indicates that this is a response from the player.
  • Rdm followed by a number from 1 to 6: is used to indicate that the dialogue portion will float over the character's head.
  • OBJ: indicates that the dialogue portion is a quest label, or related to a quest.
  • Pers followed by a number from 1 to 6: refers to a character whose code name is identical in the level editor.
  • Int and Cha: indicate a portion of dialogue that is triggered when the player has a low Intelligence or Charisma score.
  • <Ck>-: is placed in any dialog to change the color of the text to black and precede it with a dash.
  • A few short sentences can be added to the dialog code name to differentiate it (ex: Mad)
    Alert.png  The characters "/" and ":" cannot be used as is in dialogs. Replace them with "^" and "#" to display them properly in the game 


Writing steps[edit | edit source]

  1. Access the appropriate .txt files (those with the code name of the location where the dialogue will be added)
  2. Choose the code name of the character speaking (if possible identical to the code name of a character already in the location, like Pers1)
  3. Write an introduction line:
    ADD_Di_Pers1_Acc = {<Ck>- Hello!}
  4. Add or don't add a player reply:
    ADD_Di_Pers1_AccR = {<Ck>- Hi!}

    Bulb.png  This response may require certain conditions, indicated after the dialog portion as a comment (preceded by //). Ex: //Intelligence < 5 


  5. Add the dialogs that logically follow:
    ADD_Di_Pers1_1 = {<Ck>- Would you have a minute to help me?}
    ADD_Di_Pers1_1R = {<Ck>- I'd love to!}
    ADD_Di_Pers1_1R_Refuse_to_help = {<Ck>- Forget it!} //Insensible
    ADD_Di_Pers1_2 = {<Ck>- Wonderful. I was about to pass out, this is too heavy!}
    ADD_Di_Pers1_2_Refuse_help = {<Ck>- This is so insensitive of you!}
  6. Add some portions of dialogue appearing above the character's head:
    ADD_Di_Pers1_Rdm1 = {Beautiful day still<C->}
    ADD_Di_Pers1_Rdm2 = {<Cr>This is heavy!<C->}
    ADD_Di_Pers1_Rdm3 = {What's that?<C->}
    ADD_Di_Pers1_Rdm4 = {I could use some help...<C->}
    ADD_Di_Pers1_Rdm5 = {<Co>How are the others doing?<C->}
    ADD_Di_Pers1_Rdm6 = {I try as hard as I can, it's useless.<C->}

Writing codes[edit | edit source]

The following codes are used to color the text and add special characters, for example.

  • \n: Skip a line.
  • <C*> and <C->: Add/remove a Color. Replace *' with b (blue), c (cyan), k (black), m (magenta), o (orange), r (red), w (white) or y (yellow).
  • <rgb:***,***,***>: Add a specific RGB color. Replace *** with a number from 1 to 255.
  • <b+> and <b->: Add/Remove Bold.
  • <Jl>, <Jc>, <Jr> and <Jj>: Left-aligned, center-aligned, right-aligned or justified text.
More information (English)

Add dialog to Level editor[edit | edit source]

Open the location file (level editor)[edit | edit source]

  1. Open the folder Game/ then FT Improver.EXE.
    Alert.png  Use FT Tools.exe instead will result in an error. 


  2. Pass the videos by clicking on them.
  3. Click on
    ⦿  MORE 
    .
  4. Click
    ⦿  LEVEL EDITOR 
    .
  5. Navigate to the
     File 
    menu then
     Open 
    .
  6. Open the file of the location previously created which must end with .mis.

Add the dialog[edit | edit source]

  1. Click on the
     Level 
    tab.
  2. Click on the
     Speech... 
    button at the bottom.
  3. Click on the
     Add 
    button at the top.
  4. Scroll left to the bottom of the list.
  5. Click on
     New Node 
    and replace the "New Node" with the code name of your first portion of the dialog under the
     Remove 
    button.
    •  ✔    Floating       
      (checked by default): floats the dialog over the character's head.
    •        Windowed     
      : adds the dialog in a box at the bottom of the screen with the character's portrait and a
      ⦿  OK 
      button.
  6. Add the code name of the dialog under
     Default Event: 
    (for scripts).
  7. Select the dialog code to the right of
     Random 1 
    .
    Bulb.png  When you add the floating dialogs Rdm1 to 6, you can add all 6 of them one after the other. The game will display them randomly 


Scripting dialogue (advanced)[edit | edit source]

Coding a dialog inside the Mod:Editors#Level_editor requires a lot of scripting. Refer to the Mod:Scripts section for the basics of coding in the Level editor.

Prepare the code to be added[edit | edit source]

The table here allows you to know in advance the most complex codes to use to program your dialog, according to a number of special pre-determined conditions (e.g. the player refuses to help, tries to seduce the other character, is threatening, etc.)

Code the first portion of the dialog[edit | edit source]


Alert.png  The section
 Triggers... 
of the level editor contains a very large number of triggers, added over the years. Avoid editing them unless you know exactly what you are doing. Don't be intimidated by this list, you don't have to interact with it; just add your code to the end of it using the scroll bar to get to the end quickly
 



  1. Click on the
     Level 
    tab.
  2. Click on the
     Triggers... 
    tab at the bottom left.
  3. Click on
     New... 
    .
  4. Add a description (example: PERS1 - Acc)
  5. The tab
     ✔ Conditions 
    is already open. Click on
     New... 
    .
  6. The
     Always 
    condition is already selected. Click on
     Ok 
    at the bottom right.
  7. Click on the
      Actions 
    tab. It changes to
     ✔ Actions 
    .
  8. Click on
     New... 
    .
  9. Click on the
     Center View 
    tab and select
     Set Click Speech 
    .
  10. Under
     Set Click Speech for Unit 
    , click
     list... 
    and select the code name of the character you want to speak. If you have not added a character already, follow these steps.
  11. Under
     to: 
    , select the dialog code you previously embedded.
  12. Click
     Ok 

    Bulb.png  At any time, double-clicking on an item in the trigger list allows you to open it to edit it 


Code the other portions of the dialogue[edit | edit source]

The following dialogue portions will no longer use the Always condition, but will all require a special condition to appear.

  1. Click on the
     Level 
    tab.
  2. Click on
     Triggers... 
    at the bottom left.
  3. Click on
     New... 
    .
  4. Add a description (example: PERS1 - 01)
  5. The tab
     ✔ Conditions 
    is already open. Click on
     New... 
    .
  6. Click on the
     Always 
    tab and select
     Speech Occured 
    , then under
     Speech Event was 
    , select the portion of the dialog that you coded before.
  7. Click on the
      Actions 
    tab. It changes to
     ✔ Actions 
    .
  8. Click on
     New... 
    .
  9. Click on the
     Center View 
    tab and select
     Set Click Speech 
    .
  10. Under
     Set Click Speech for Unit 
    , click
     list... 
    and select the code name of the character you want to re-speak.
  11. Under
     to: 
    , select the code for the next section of the dialog.
  12. Press
     Ok 

    Bulb.png  This step completed, after the first dialog, clicking on the character again will start a new dialog. 


Code a player response or a sequence of interactions[edit | edit source]

It is possible to code a series of interactions that appear automatically after a portion of the dialog (after the dialog button is clicked).

  1. Click on the
     Level 
    tab.
  2. Click on the
     Triggers... 
    tab at the bottom left.
  3. Click on
     New... 
    .
  4. Add a description (example: PERS1 - 01R)
  5. The
     ✔ Conditions 
    tab is already open. Click on
     New... 
    .
  6. Click on the
     Always 
    tab and select
     Speech Occured 
    , then under
     Speech Event was 
    , select the portion of the dialog that will be responded to.
  7. Click on the
      Actions 
    tab. It will change to
     ✔ Actions 
    .
  8. Click on
     New... 
    .
  9. Click on the
     Center View 
    tab and select
     Set Variable 
    .
  10. Under
     Variable 
    , type, for example: Pers1_message.
  11. Under
       Value 
    , type, for example: AccR.
  12. Press
     Ok 
  13. Click
     New... 
    .
  14. Add a description (example: PERS1 - 01R (message))
  15. The
     ✔ Conditions 
    tab is already open. Click on
     New... 
    .
  16. Click on the
     Always 
    tab and select
     Variable 
    , then under
     Variable 
    type in the variable you just chose, then under
     is Value 
    type in the value you just chose.
  17. Click on the
      Actions 
    tab. It will change to
     ✔ Actions 
    .
  18. Click on
     New... 
    .
  19. Click on the
     Center View 
    tab and select
     Force Speech 
    .
  20. Under
     Unit 
    , click
     list... 
    and select the code name of the character who will be responding. If it is the player, type "LeJoueur" instead.
  21. Under
     will use speech node 
    , select the code for the section of the dialog that corresponds to the response.
  22. Check the
     Blocking 
    box in the upper right corner.
  23. Repeat the steps from 18 to add all the portions of dialogs that you want. They will all follow each other.
  24. Press
     Ok 

Code a portion of the dialog that depends on a condition[edit | edit source]

When you add a condition, you can always add a number of additional conditions that must all be true for the script to activate the intended dialog portion. This allows you, for example, to create a specific dialog portion if the player has an intelligence score < 5 and another if their score is >= 5. If you don't consider all the possibilities, nothing may happen if the player doesn't have the necessary characteristics. To code a response that appears only if the player-character has at least 5 intelligence, follow all the steps in the previous portion, but add these after step 6:

  1. Click on
     New... 
    .
  2. Click on the
     Always 
    tab and select
     Quantity - Unit 
    , then under
     Unit 
    , type "LeJoueur", then under
     has 
    , click on
     Change 
  3. Click on
     More than 
    and enter the value "4" to the right of the
     Num 
    . Press
     Ok 
  4. Under
     type 
    click
     change 
    then select
     Status 
    . Click on
     strength 
    to the right and change it to
     intelligence 
    . Press
     Ok 
    .