Dumb questions about dialogs

Discussion in 'Fallout General Modding' started by burn, Jul 14, 2017.

  1. burn

    burn Mildly Dipped
    Modder

    557
    Apr 22, 2012
    1) I just realized that I don't know how MSGs are linked to scripts. Any gSay_Message refers to MSG by
    msg_list, which is an int, rather than name. I searched defines, but found only scripts mapping in SCRIPTS.H. Is it mapping both scripts and dialogs simultaneously?

    2) Some scripts in FO2 contain checks like "if (message_str(403, 100) == "You see one of the Reno townsfolk.") then begin...". What's the point of this? Is it dumb programming or a shady way to achieve some non-obvious effect?
     
  2. Lexx

    Lexx Background Radiant
    Moderator Modder

    Apr 24, 2005
    1) If I understood you right, then no, not necessarily / not directly. Take a look at Reply(x):
    Code:
    #define Reply(x)                    gSay_Reply(NAME,x)
    NAME is defined in the script at the beginning:
    Code:
    #define NAME                    SCRIPT_FAEMMA
    In this case, that makes the *.msg file FAEMMA.
    You can easily overwrite this and define a different name. Of course you can also get text from different files, if you define your own function:
    Code:
    #define float_color(x)               float_msg(self_obj, message_str(SCRIPT_SOMETHINGELSE,x), FLOAT_MSG_YELLOW)
    ^ using float_color(x) would take the strings from SOMETHINGELSE.msg file.

    /edit: Now after reading your post again, I guess one can say that *.msg files are linked to the scripts, but I'm pretty sure this only happens by name, as there is no "dialog.lst" file or anything in the text folders.

    2) Do you have an example script where this happens? Usually townsfolk is marked based on area coordinates and local variables. This way they achieve different critter descriptions based on critter locations with only one script. A citizen can be a "townsfolk", or a "barfly", or a "farmer" etc.
     
    Last edited: Jul 14, 2017
  3. burn

    burn Mildly Dipped
    Modder

    557
    Apr 22, 2012
    1) OK... it's by name, and linked to the script of the same name. So if I wanted to add new "mynew.msg" and refer to it from some script, I would need to add "DEFINE SCRIPT_MYNEW 9999" in SCRIPTS.H, and use gSay_Reply(9999,x) to access that message file.

    2)
    ncband.ssl: if ((message_str(403, 100) == "You see one of the Reno townsfolk.") == 0) then begin
    ncbill.ssl: if ((message_str(403, 100) == "You see one of the Reno townsfolk.") == 0) then begin
    ncbisgrd.ssl: if (message_str(403, 100) == "You see one of the Reno townsfolk.") then begin
    ncbismen.ssl: if (message_str(403, 100) == "You see one of the Reno townsfolk.") then begin
    ncboxfan.ssl: if (message_str(403, 100) == "You see one of the Reno townsfolk.") then begin​
    etc.
     
  4. Lexx

    Lexx Background Radiant
    Moderator Modder

    Apr 24, 2005
    1) Why would you add a new msg file? I wouldn't do it this way unless you really have a script like that. Besides, don't forget about scripts.lst file in data/scripts/ folder. I'm pretty sure that doing something like this will only cause problems down the line.

    2) Guess you're referring to decompiled scripts, as stuff looks different in the original files. There is also nothing referring to "You see one of the Reno townsfolk." as far as I can see (it doesn't appear in ncband.msg at all, for example).

    I've checked out ncband.ssl and what they did here is simply making their lives easier:
    They are saving the value that corresponds with a string number from the msg file into a local variable. Then later use the local variable to check it's current value to display the next fitting line accordingly, etc. This way they build the npc singing lines (floating text). It's quite smart and simple, imo. I used similar things in my mod to check object status and stuff.

    As far as I can see, ncbill.ssl and the other scripts doesn't have that stuff at all? Maybe I've missed something, but on a quick look I see nothing remotely in the files.
     
  5. Magnus

    Magnus Water Chip? Been There, Done That
    Modder

    953
    Dec 6, 2007
    2) Yes this is asshead programming. If the check ever referred to its own .msg file then it might make more sense, but the actual line, whether it's in NCPROSTI, NCBISGRD, etc, is

    if (message_str(SCRIPT_NCPERSON, 100) == "You see one of the Reno townsfolk.") then begin

    So this will always return True unless they're insane enough to redefine SCRIPT_NCPERSON somewhere. I suspect originally the NCPERSON script was used for every critter in New Reno and they used the check to avoid putting random floats on people who shouldn't have them (i.e. whose descriptions are different, such as bouncers, drug dealers etc). Later when they gave those subgroups their own scripts they just copypasted the code and forgot to remove the check.

    Or maybe they wanted to ensure that the lines will only run in the English version of the game, possibly because they had difficulty getting it all translated?

    In RP script sources this check is always commented out, so either way it's probably a bug.
     
    Last edited: Jul 14, 2017
  6. Lexx

    Lexx Background Radiant
    Moderator Modder

    Apr 24, 2005
    Well yeah, this "if (message_str(SCRIPT_NCPERSON, 100) == "You see one of the Reno townsfolk.")" line is dumb. But it also doesn't exist. I've searched the vanilla script files, and it just doesn't exist there.

    I don't know what script versions you people are looking at.


    /Edit: Alright, I just found it in the RP scripts. Well, no idea what Killap's thoughts have been here. In any case, it doesn't exist in the original scripts. Maybe it's some of this Seraph's code stuff? He used it to check the critter and then delete it... just that this would never work with translated versions of the game.
     
    Last edited: Jul 14, 2017
  7. NovaRain

    NovaRain Casual Modder Modder

    Mar 10, 2007
    The check is in the vanilla scripts. It's done by floater_rand_with_check.
    If you decompile ncboxfan.int from 1.02d patch, there are "if (message_str(403, 100) == "You see one of the Reno townsfolk.") then begin" in all nodes.
     
  8. burn

    burn Mildly Dipped
    Modder

    557
    Apr 22, 2012
    OK, it's good to hear that I'm not crazy. It does exist in vanilla, and it's still present in Killap's patch (and seems RP too). Even NCPERSON was used for every critter in Reno, it still doesn't make sense - the check is always true, so it's not necessary.
    Fortunately, it's only floats, and doesn't cause any real issues in the original game.
    The only way it will be noticeable is when you're working with localized game version. Which, incidentally, I'm doing at the moment, and that's how I discovered this mess.
    I'll post corrected files later.
     
  9. Mr.Stalin

    Mr.Stalin Agent of Enclave Modder

    348
    Oct 29, 2015
    There is script.lst, and by the number defined in NAME, by this number from script.lst, the name for msg-file will be taken.
    Now do you understand how the name for the dialog file is defined?)
     
    Last edited: Jul 14, 2017
  10. Magnus

    Magnus Water Chip? Been There, Done That
    Modder

    953
    Dec 6, 2007
    It is in NCPROSTI.ssl, NCFLUFFE.ssl and probably a few more, but only in the original 1.02d scripts. In the RP it is still present but
    //commented out like this
    so it won't run.

    Like I said, I only have theories as to why that code was ever written originally, but as it stands it is definitely dumb and should be commented out.
     
  11. burn

    burn Mildly Dipped
    Modder

    557
    Apr 22, 2012
    Here are the corrected scripts (based on killap's patch 1.02.31). The condition and actions that never run are removed.
     

    Attached Files:

    • ssl.zip
      File size:
      91.6 KB
      Views:
      148
    • int.zip
      File size:
      93.8 KB
      Views:
      125
  12. NovaRain

    NovaRain Casual Modder Modder

    Mar 10, 2007
    It would be better if your .ssl are based on the original script source rather than decompiled scripts.
     
  13. burn

    burn Mildly Dipped
    Modder

    557
    Apr 22, 2012
    I don't know where to get those. Either way, if you have them, it's easy to do with diff+patch.
     
  14. NovaRain

    NovaRain Casual Modder Modder

    Mar 10, 2007
    killap's post has the link for UP script source.
     
    Last edited: Jul 15, 2017
  15. burn

    burn Mildly Dipped
    Modder

    557
    Apr 22, 2012
    I notice some msg files have duplicate lines numbers (for example, ncpitbos.msg, 285). It seems that one of those is a float and another is a dialog line. Is there some magical rule that floats use first line, and dialogs use last, or these are just bugs?
     
  16. Mr.Stalin

    Mr.Stalin Agent of Enclave Modder

    348
    Oct 29, 2015
    There is no magic) this bug.
     
    Last edited: Jul 21, 2017