Fallout Tactics Scripting Engine (0.30a)

Discussion in 'Fallout Tactics Modding' started by Melindil, Jul 3, 2018.

  1. Melindil

    Melindil First time out of the vault

    Apr 15, 2018
    This is actually very useful information - it should help me find where in the loading / deserialization process the tag name is set. As a short-term workaround, I could set a custom script point at that process, so that items of a particular type can always have a certain tag name initialized if it doesn't already have one. And later I can try to narrow down where in both the level editor, and in-game, the entity file is read, so that it can override a "blank" tagname in the level entity.
     
  2. nadeauhugo

    nadeauhugo Author of FOT mod THE SUM Modder

    Mar 9, 2014
    Fantastic! This, combined with the hex edit to keep tagnames from being erased, will prevent many in-game bugs from happening... Sad bugs that now happen even if the mod/game has been carefully designed and planned.
     
  3. DDTerr

    DDTerr First time out of the vault

    Feb 2, 2014
    Desired feature: Empty starting inventory

    Modders (incl. me) often want to start the main character with an empty inventory, but FOT fills it with some stuff according to traits choosen.

    Workarounds:
    1) Renaming of all the auto-inserted ent files (entities) and creating new ones with different names - this needs a lot of work on all maps or start creating mod from scratch not using any previously created content
    2) Hex-editing bos.exe to rename path/name strings of all the auto-inserted entities to other ent files or directories where these copies would be unlootable, 0 weight and with no icons
    3) Hex-editing bos.exe to zero path/name strings of all the auto-inserted entities, but then the engine may behave strangely if there are no path/file names (i don't know if FOT code tolerates it, ignores it or makes some internal exception for missing files??). First seen on openfm.exe (=bos.exe) of the famous OpenFM mod.

    I've tried both 2) and 3) workarounds: offsets 498F04-498F24 (money), 49D494-49DA3E (the rest of items), but it is quite complicated and needs to include the modified exe file in my mod which may violate the FOT copyright.

    Recommended fix: it would be nice to have only 1 hex patch done by FTSE to remove the call to that auto-equipping routine or just insert a return command at the beginning of that routine.
     
    Last edited: Sep 26, 2018
  4. nadeauhugo

    nadeauhugo Author of FOT mod THE SUM Modder

    Mar 9, 2014
    Yess I support the need of such feature, because the 1) solution is far from perfect, it also creates a bug when any non-lootable object is on the ground somewhere (placed on the ground for let say immersion/decoration purposes). When that happen you can still see the item, take it, but nothing appears in your inventory.
     
  5. nadeauhugo

    nadeauhugo Author of FOT mod THE SUM Modder

    Mar 9, 2014
    Hi! I wonder why these fixes presented by TwoEyedYum have not been added to your scripting engine. Can I enter them in FTSE_config.json manually? Is it because they were not tested or don't work correctly? I noticed that because since I installed the scripting engine I still have random pink / blue ugly colors in random encounters and I there was a fix in that list a while ago : http://www.nma-fallout.com/threads/list-of-hex-based-fixes-changes-in-bos-exe-file.202858/

    Also, I experienced another bug that is very anoying to me in random encounters, possibly elsewhere but I don't think so. It appears that many entities inventory are altered, most of the time by duplicated (doubled) items. It looks very ugly as you can find the same item separated in two slots many time in the entity inventory. I think that may have something to do with tagname, as almost all my items have one. In a way, maybe the engine load some of the tagnames, or the first one, but not the rest, so he put the items in different slots. A fix to prevent item tagnames from disappearing in random encounters would probably solve this.

     
    Last edited: Oct 12, 2018 at 3:46 PM
  6. Melindil

    Melindil First time out of the vault

    Apr 15, 2018
    Ah, I missed the color change one. Some of the others I didn't include because they were somewhat optional changes (door open range, music in dialog window), but that one should have been included.

    Patches can be added to the FTSE_config.json file, and will take effect on next startup. One caveat - the address of the patch is an in-memory address, rather than an EXE offset address. Because BOS.EXE is loaded at hex address 400000, the address given in the JSON file must be hex 400000 greater than that for a typical hex edit.

    For this fix, a proper JSON entry would be:

    {
    "name": "Encounter color fix",
    "apply": "true",
    "changes": [
    {
    "offset": "6ae3f4",
    "patch": "33c990"
    }
    ]
    },

    I'll add this one in the defaults as well for next release.
     
    • [Rad] [Rad] x 1
  7. nadeauhugo

    nadeauhugo Author of FOT mod THE SUM Modder

    Mar 9, 2014
    Ah.. I was wondering about the differences in the adresses from one patch to another, thanks for the explanataion, and also for the code. It works fine thanks! Can't wait to see what you will come up with next :D I'll stay tuned.
     
  8. ItsaMen

    ItsaMen First time out of the vault

    Aug 25, 2018
    hello @Melindil

    This is about set variable hook.

    First my script.

    Code:
    -- Modifiable functions begin below -----------------
    
    function OnVariableChanged(key,val,campaign)
      
       if campaign ~= true then
           if key == "andy" then
          
               if val == "12" then
                   SetMissionVar("umbra", "323")      
               end
          
           end
       end
      
    end
    
    In a mission map I would make a trigger with condition Always, but no Preserve, and make the trigger's action to be "set a mission variable".
    This way a variable gets set and only once.

    I know the variable name from the trigger so I can have LUA check for this variable's name.
    In this case it's "andy". I also set the value to "12".

    With LUA I proceed to set another variable called "umbra" to a value "323" as a test.

    Am I correct in thinking after this point another trigger would find the variable "umbra" as having the value "323"?

    IMPORTANT: are the parameters correct and in correct order? I had to guess from reading the source code both function name and parameters.