A modding prefix for your mods

Discussion in 'Fallout General Modding' started by burn, Jun 17, 2019.

  1. burn

    burn Where'd That 6th Toe Come From?
    Modder

    Apr 22, 2012
    Modder prefix list (see description below):
    1. g_ - burn
    2. p_ - pelicano (used in Party Orders)
    3. k_ - (reserved by me for) killap's mods: RP, UP
    (Also see reserved box bars and hotkeys at the end of the post.)
    This is intended for mod authors who:
    1. Use scripts - global scripts, in particular.
    2. Care about mod compatibility.
    Sfall's global scripts and global variable greatly expanded modding possibilities. However, the problem with globals is that they are... global. Each name in the namespace is available for everyone. And that will inevitably lead to conflicts, sooner or later.
    Infinity Engine modders started a modding prefix list over a decade ago to tackle this exact problem. The simple idea is that you pick a 2-3 (ascii) character prefix, and use it to create your own, private namespace inside the global one.

    My suggestion is to do the same. For example, if you pick prefix “a_”, your script could be named gl_a_myscript.int, and might look like this:
    Code:
    #define S_NAME "gl_a_myscript"
    #define ndebug(message) debug_msg(S_NAME + ": " + message + "\n")
    
    procedure start begin
     if game_loaded then begin
       set_sfall_global("a_myvar", 1000);
       ndebug("initialized");
     end
    end
    ...
    
    So, if you want to ensure (to some degree) that another mod doesn’t overwrite your scripts, doesn’t mess with your global variables, and that debug messages coming from your scripts can be distinguished easily, pick a prefix, post it here, and use it for:
    • global script names
    • global variable names and saved array names
    • debug messages
    • new message files (can be loaded with add_extra_msg_file)

    Of course, you can just as well not do that... but then don't say I didn't warn you.


    My personal prefix is "g_", and I'm using it for quite a while already.


    Edit: In addition to the above, there are other resources should be used sparingly and with caution to avoid conflicts (listing the mods I'm aware of, post to add things):

    Box bars
    ("LEVEL", "ADDICT", etc).
    Hotkeys
     
    Last edited: Aug 11, 2019
  2. Mr.Stalin

    Mr.Stalin Agent of Enclave Modder

    Oct 29, 2015
    Главная проблема sfall - это очередность выполнения глобальных скриптов, а не конфликт имен.
    Если ваш скрипт выполняет какие-либо важные расчеты для механики движка/игры, то такой скрипт должен выполняться первым, чтобы последующие выполняемые скрипты имели новые расчетные данные от вашего скрипта, поэтому ваш скрипт должен начинаться с приоритетного префикса в его имени, например символ '#' считается приоритетнее чем префиксы начинающиеся с 'а_'.
     
    Last edited: Aug 4, 2019
  3. Mr.Stalin

    Mr.Stalin Agent of Enclave Modder

    Oct 29, 2015
  4. burn

    burn Where'd That 6th Toe Come From?
    Modder

    Apr 22, 2012
    I don't think it's a good approach. A good approach would be to write scripts in such a way that execution order doesn't matter, which is what set_sfall_arg for.
    Making a mod dependent on script execution order will only lead to prefix arms race and in the end result in the same conflicting situation. Mods that aren't compatible conceptually should be simply marked as such in the readmes.

    Also, added a list of reserved box bars and hotkeys to the first post.
     
  5. Mr.Stalin

    Mr.Stalin Agent of Enclave Modder

    Oct 29, 2015
    set_sfall_arg - не решает проблему, когда важна очередность выполнения. Возьми скрипт ECCO hs_barter... и фильтра с твиком к торговле, т.е твик в фильтре должен выполняться после скрипта Ecco.
     
  6. burn

    burn Where'd That 6th Toe Come From?
    Modder

    Apr 22, 2012
    Мне непонятна проблема, на гитхабе написал.