A modding prefix for your mods

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

  1. burn

    burn Mildly Dipped
    Modder

    573
    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
    4. cr_ - Cyrus
    (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: Oct 24, 2020
  2. Mr.Stalin

    Mr.Stalin Agent of Enclave Modder

    451
    Oct 29, 2015
    The main problem with sfall is the order of execution of global scripts, not a name conflict.
    If your script performs any important calculations for the mechanics of the engine/game, then this script should be executed first, so that subsequent executed scripts have new calculation data from your script, so your script should start with a priority prefix in its name, for example, the '#' symbol is considered to be higher than prefixes starting with 'a_'.

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

    burn Mildly Dipped
    Modder

    573
    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.
     
  4. Mr.Stalin

    Mr.Stalin Agent of Enclave Modder

    451
    Oct 29, 2015
    set_sfall_arg-does not solve the problem when the order of execution is important. Take the ECCO hs_barter script... and a filter with a tweak to trade, i.e. the tweak in the filter must be executed after the Ecco script.

    set_sfall_arg - не решает проблему, когда важна очередность выполнения. Возьми скрипт ECCO hs_barter... и фильтра с твиком к торговле, т.е твик в фильтре должен выполняться после скрипта Ecco.
     
    Last edited: Oct 24, 2020
  5. burn

    burn Mildly Dipped
    Modder

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

    Cyrus It Wandered In From the Wastes

    152
    Nov 5, 2015
    I will use cr_

    gl_cr_
     
    Last edited: Oct 24, 2020
  7. burn

    burn Mildly Dipped
    Modder

    573
    Apr 22, 2012
    added to the list