Fallout Tactics utility Fallout Tactics Scripting Engine (0.50a)

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

  1. Melindil

    Melindil First time out of the vault

    81
    Apr 15, 2018
    Did you install the game from GOG? That's the only reference I can find for 2.0.0.8 as a version.

    If the game is crashing that early, it's possible GOG (or another mod?) made some edits to the EXE that are incompatible with the edits FTSE makes. (Since the edits go down to machine code level, FTSE is sensitive to any EXE changes beyond those explicitly used in testing.)

    Has anyone else tried FTSE with the GOG version of FT? I unfortunately only have the original 1.27 and Steam versions to test with.

    In the meantime, I can look to see if I can add further safety checks in the internal patches applied at program start, and report a cleaner error if the EXE is not compatible. Or, if I can somehow get a copy of the GOG version of BOS.EXE, I can maybe figure out a way to get the FTSE functionality to work with both.
     
  2. Calimany

    Calimany First time out of the vault

    8
    Jul 21, 2020

    Yes is the GoG and it was brand new when crashed(had just instaled). I did tampered with the bos.exe since my brother made a very neat perk editor that is a dream. (unfortunately the perks that require tampering with the functions have to be made manual like you are doing, until i can figure out what is what in that hex nightmare)

    i will upload the file in any case. (that file has some modified perks).

    good to know that the steam version works.
     

    Attached Files:

    • BOS.zip
      File size:
      2 MB
      Views:
      16
  3. Melindil

    Melindil First time out of the vault

    81
    Apr 15, 2018
    Thanks. I checked the GOG version against mine, and except for the perk changes (which look OK), the files are identical. And running that EXE in my installation works as well. So that rules out a GOG version incompatibility.

    I'll think up a way to do further checking. Until then, there's a couple of other things to check:

    1. Is there a FTSE.log file in the game directory? If so, can you attach that as well?

    2. Does the FTSE version (0.50a) appear alongside the Fallout Tactics version at the main menu screen? The versions are displayed in white text at the bottom left.
     
  4. Calimany

    Calimany First time out of the vault

    8
    Jul 21, 2020
    Yes the version apear in the inferface as normal. I think it has something to do with Farsight...
    i gave her 2 itens a lot of xp and a few perks for testing reasons because is easier to skip the first mission to see the recruits and stuff. i will try puting her into her vanila form. Strange is the fact that it works as normal without the patch tough
     

    Attached Files:

    • FTSE.zip
      File size:
      633 bytes
      Views:
      21
  5. Corpse

    Corpse Mildly Dipped

    554
    Apr 7, 2003
    Was wondering how to implement combo weapons like an assault rifle with an underslung grenade launcher.
    Is there any way to make a script switch an equipped weapon, when an attack mode was selected?
    Say I have a specific weapon entity in one of the weapon slots, I select a specific attack mode; and the weapon is removed from that slot, and replaced with another weapon entity. Then being able to switch back to the first weapon entity the same way, and have it restored with the ammo variant, and number of rounds it was loaded with when removed.
     
  6. nadeauhugo

    nadeauhugo Author of FOT mod THE SUM Modder

    519
    Mar 9, 2014
    With FTSE 0.50, there is a way to apply bonuses to ITEMS HELD IN INVENTORY (not equipped)! Thanks A LOT Melindil.

    This is how you do it in "ftse.lua". In this example, the spanner is instantly giving the actor +5 to repair skill. The repair skill bonus is applied only once, regardless of the number of spanners the character has. Spanner in other characters inventories does not count. It uses a temporary variable stored in the entity's "Stat" perk to work.

    Code:
    function OnInventoryAdd (receiver, item, quantity)
      nom = item:GetName()
    --Spanner (stat)
    comp = receiver:GetAttribute("stat",ACTOR_TABLE_TEMPORARY)
      total = comp + quantity
      if nom == "Spanner" then
        if comp == 0 then
          bonus = { repair=5 }
          receiver:ApplyBonus(bonus,false)
        end
          receiver:SetAttribute("stat", ACTOR_TABLE_TEMPORARY, total)
      end
    end
    
    function OnInventoryRemove (source, item, quantity)
      nom = item:GetName()
      --Spanner
      comp = source:GetAttribute("stat",ACTOR_TABLE_TEMPORARY)
      total = comp - quantity
      if nom == "Spanner" then
        if total == 0 then
          bonus = { repair=5 }
          source:RemoveBonus(bonus,false)
        end
          source:SetAttribute("stat", ACTOR_TABLE_TEMPORARY, total)
      end
    end
    There might be easier ways to do this, but this is the way I found.
     
  7. nadeauhugo

    nadeauhugo Author of FOT mod THE SUM Modder

    519
    Mar 9, 2014
    Oh, sorry guys, I just saw with this the big problem showing at the horizon with this feature...

    Equipped items (2 primary slots and armors too) does not flag as being part of the inventory using this method. Soo, the bonus is lost when the item is equiped... Imagine you have a bonus with your spanner, but you want to use it to repair something if this is also usable as a toolkit. Then the bonus will be removed as soon as you place the item in one of your two primary slots. It can be partially solved by adding also a bonus in the item effect of being equipped (using entity editor), but then if you have another spanner in your inventory you will get two times the bonus.

    Melindil, is there a way in opinion to optain a similar function to detect items being equipped, or to consider them part of the inventory with an additional variable that serves as a boolean (equipped or not)? Thanks!
     
  8. nadeauhugo

    nadeauhugo Author of FOT mod THE SUM Modder

    519
    Mar 9, 2014
    Me again! Another topic in the meanwhile... Sorry if this is a lot to ask, version 0.50a really made me play with the game mechanics and getting closer to my goals! :D

    Regarding the QUEST LOG :
    I tried and tried the hookexecutor formula in OnStart(), OnLocaleLoad() and OnLongTick(e) to update an existing locale entry (holodisk and character sheets entries), even attempted to remove these entries in advance from the .txt to see if the game would use the one I created, but I was not able to get any result yet... Just nothing so far.

    Here is a preview of the feature I would like to implement to the game :

    upload_2020-9-30_15-41-52.jpeg

    You see this "TRAIT.S" entry there (that is only used as a general descrption), I would like to dynamically change that description to store all my quest datas, removing the smiley to give me more space. It will then serve as a Quest log that is directly imbeded into the character sheet (yeah!), and every character will be able to see that list as it is a general description entry. What do you think of this? The code would (if of course there is a way to make it work) look like that into the OnLongTick(e) hook.

    Code:
    SUPER_LIST_OF_QUESTS = whatever_I_have_in_mind
    hookexecutor:AddLocaleString("desc_otraits",SUPER_LIST_OF_QUESTS)
     
  9. Corpse

    Corpse Mildly Dipped

    554
    Apr 7, 2003
    I have tried adding bonuses to weapons on the entity editor, but this only seems to work with toolkits, or repair items.
    A function that adds bonuses to weapons or items (other than toolkits) that are equipped would be useful too.
     
  10. nadeauhugo

    nadeauhugo Author of FOT mod THE SUM Modder

    519
    Mar 9, 2014
    You are damn right about this. Only skill consumables (including lockpicks and medkits) and armors grant bonuses. Also, this would permit giving perks for equiped items and/or posessed items. This would look like this :

    Code:
      --Helmet (using hideOfScars as a temporary variable)
    
    -- Place in function OnInventoryAdd (receiver, item, quantity)
    
    comp = receiver:GetAttribute("hideOfScars",ACTOR_TABLE_TEMPORARY)
      total = comp + quantity
      if nom == "Casque" or nom == "Helmet" then
        if comp == 0 then
          bonus = { normalResist=5 }
          receiver:ApplyBonus(bonus,false)
         if receiver:GetAttribute("boneHead", ACTOR_TABLE_CURRENT) == 0 then
            receiver:SetAttribute("boneHead", ACTOR_TABLE_PERM, 1)
         end
        end
         receiver:SetAttribute("hideOfScars", ACTOR_TABLE_TEMPORARY, total)
      end
    
    -- Place in function OnInventoryRemove (source, item, quantity)
    
      comp = source:GetAttribute("hideOfScars",ACTOR_TABLE_TEMPORARY)
      total = comp - quantity
      if nom == "Casque" or nom == "Helmet" then
        if total == 0 then
          bonus = { normalResist=5 }
          source:RemoveBonus(bonus,false)
          source:SetAttribute("boneHead", ACTOR_TABLE_PERM, 0)
        end
          source:SetAttribute("hideOfScars", ACTOR_TABLE_TEMPORARY, total)
      end 
     
  11. Corpse

    Corpse Mildly Dipped

    554
    Apr 7, 2003
    That would be great. Make Night Vision Goggles give you the Night Vision perk.
     
  12. Corpse

    Corpse Mildly Dipped

    554
    Apr 7, 2003
    Got a couple of questions.
    Is it possible to add items directly into the weapon slots, rather than the inventory?
    Here is what I want to do: I want a specific weapon to be integral of an armour; so every time the armour is equipped, the weapon is added, and placed into a weapon slot. When the armour is unequipped, the weapon must be deleted. The condition should check the armour is equipped, and the weapon entity is not, to add the weapon.
    In the instance the weapon is moved to inventory (while armour is equipped), the weapon entity should be deleted. This would prevent the weapon from being placed on the ground, a container, given to another squad member, and being duplicated.
     
  13. nadeauhugo

    nadeauhugo Author of FOT mod THE SUM Modder

    519
    Mar 9, 2014
    This might be even more interesting using a vehicle with only 1 person slot, that would use a caracter sprite in place of a vehicle sprite. This way, it would simulate a kind of Power armor with a gun in which a caracter could climb in and out as will. As vehicles like tanks are already programmed to add a weapon, it could be easier to do this solution than programming a set of armor to add and remove an item. Still, the .exe would have to be slightly modified, as for now a weapon can only be added to a second passenger inside the vehicle, not a single driver.
     
  14. Corpse

    Corpse Mildly Dipped

    554
    Apr 7, 2003
    There's a few problems doing it that way. As you mentioned, the weapon is only added to the gunner; not the driver.
    Vehicle weapons are locked to use the same sound effect, and I don't know if you can add burst mode to the attacks.
    The armour I wan't to assign this function to, has the head exposed; the sprite I made is multilayered to adapt to the skin and hair colour of the user.
    Also the movement would just loop the walk animation on turn based mode.
     
  15. nadeauhugo

    nadeauhugo Author of FOT mod THE SUM Modder

    519
    Mar 9, 2014
    He you certainly know your shit. I relate to that, yep Tactics has a way to let you do something, but at the same time bring you to a bunch of dead ends at the same time :P And with this solution I didn't even thought about ladders and no-cars locations...
     
  16. Corpse

    Corpse Mildly Dipped

    554
    Apr 7, 2003
    lol... I had not even considered ladders and maps that don't allow vehicles.
    Anyway, these are some of the new units I have been working on. Imported the graphics from Crusader No Regret.
    The armour is the Draygan Mech suit.
    fbos0157.jpg
     
  17. nadeauhugo

    nadeauhugo Author of FOT mod THE SUM Modder

    519
    Mar 9, 2014
    Oh yeah amazing range of choice! I can clearly see why you need this improvement.