Fallout Tactics utility Fallout Tactics Scripting Engine (0.51a)

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

  1. nadeauhugo

    nadeauhugo Author of FOT mod THE SUM Modder

    541
    Mar 9, 2014
    I have an easy to create (I think...?) hook that I would like to suggest, lets say for your long-term update list Melindil. :D

    It would be something like : OnDeath(isSquadMember)

    You see, I just had this crazy idea to give more meaning to squad members death. Upon a squad member death, the hook could theorically fire and then create an item (using your already existing function) inside the main character inventory. This item would be the "remains" of the characters, or "dogtags", with the name of the character as the item name. The "on the ground" image for that item could be the image of a tomb, that the squad could "dig" anywhere they want just by dropping the item. Mouse over the tomb would then show the squad member name. pretty great isn't it? Hehe! I would LOVE to see something like this one day ;).
     

    Attached Files:

  2. Uncertain Questioner

    Uncertain Questioner First time out of the vault

    5
    Apr 3, 2021
    I don't want to be presumptuous, but is there a chance for a version of the sniper perk that works on all ranged weapons ala FO2? I feel like that would really help the otherwise kinda wimpy feeling miniguns. (Well, that or AP ammo for 5.56 and 7.62, but my ignorant rear assumes it would probably be easier to make a Falout 2 style Sniper patch than to create new ammo and place it in appropriate inventories.
     
  3. Melindil

    Melindil First time out of the vault

    87
    Apr 15, 2018
    Updated to 0.51a. Only change is a (hopeful) bugfix for the crash issue that some people have been experiencing. If you have had issues with crashing, please try again with this version to see if the crash has been eliminated. If not, I'll try to put together a debug build to get more information on the reason for the crash.

    I also owe responses to some of the replies above - I'll try to get to those tomorrow.
     
  4. nadeauhugo

    nadeauhugo Author of FOT mod THE SUM Modder

    541
    Mar 9, 2014
    I played a lot with the previous version while having a long list of ftse.lua added functions. The only repetitive crashs to desktop I experienced were soon after the beginning of a game on the first map, but not frequently. Might it be the crash we're after? Its possible its not related due to my map scripts.

    Also, are you closed to implementing the equipped status in onInventoryAdd and removed? I'm about to send a new version of my mod out there and this could really come in handy. Thanks a lot!
     
  5. Melindil

    Melindil First time out of the vault

    87
    Apr 15, 2018
    Re: crash:

    The way you describe it, it is actually very likely to be the same one. The Lua stack issue tends to happen a) near the beginning of the start of the game (reason unknown), and b) when there are *fewer* Lua hook functions implemented in ftse.lua, as the problem is that the C++ part of the code wouldn't pop the error object off the stack whenever it tried to look up a hook function name and couldn't find it. So that may be why you didn't see it as often as others, and why I couldn't see it at all during testing (as I usually have at least a small logging function on each hook).

    Now that the crash is (hopefully?) solved, this is next on my list. And I have most of the info and code I need to implement it, so it will not take very long. If I get time like I did yesterday, then it should only take a couple days to get it working.

    This one is already on my list, along with hooks for when entities take damage or are healed/repaired.

    No worries. This is pretty easy to do with a FTSE script, I'll put one together along with instructions on how to install. If you'd prefer a hex edit instead (e.g. you'd prefer to not install FTSE), I can try to come up with one that works (though it wouldn't be as easy to tweak the behavior to, e.g., not make the M2 Browning ridiculously overpowered).
     
    • [Rad] [Rad] x 1
  6. nadeauhugo

    nadeauhugo Author of FOT mod THE SUM Modder

    541
    Mar 9, 2014
    This is wow very promising, as about now this is the only problem I have that really get me stuck. The rest are rare or mostly nuisance. Your explainations make real sense so let's hope it's only this.

    As for the onEquipped script, very great news it means a lot to me and it's all I could hope for! :D As soon as yesterday, I tried to add a script to "transform" an item in the player's inventory (a working cellphone to a dead one) under certain circumstances. Worked fine, but both vanilla Tactics scripts and Lua code were unable to deal with the item in any way when it was eqquiped. I'm confident it will help me solve that as well.

    And finally yes I'm glad the OnDeath and damage/healed/repaired hook is on the list. I also have a script ready for when this is implemented : a bonus "Survivor" perk if the squad member get in a situation when he.she gets very close to dying but survives... :D
     
  7. Uncertain Questioner

    Uncertain Questioner First time out of the vault

    5
    Apr 3, 2021
    Thank you so much. I already have FTSE. (A shame I didn't actually build my main character for Sniper and none of the recruits really have a good mix of PE, AG, and LK for it, but it's still a fun idea maybe for a future playthrough.
     
  8. Reinar

    Reinar First time out of the vault

    70
    Oct 23, 2011
    I tried all the previous crash scenarios and so far no crash. Looks like you did it!
     
    • [Rad] [Rad] x 1
  9. Melindil

    Melindil First time out of the vault

    87
    Apr 15, 2018
    Re: Sniper perk working for all ranged weapons, I think the following will work. Just copy the below text into the "ftse.lua" file in the Fallout Tactics directory (or create the file as a text file if it doesn't exist):

    Code:
    function OnChanceToCritical1(attacker, target, weapon, loc, chance)
    
      -- Check for Sniper perk on the attacker
      if attacker:GetAttribute("sniper", ACTOR_TABLE_CURRENT) then
    
        -- Attacker has Sniper
    
        -- Include only Short and Thrown weapon range classes
        -- Long and Scoped modes already work in the base game code;
        -- if we include them here then we'll give those weapons double chance
        local weapon_range_type = weapon:GetCurrentMode():GetRangeType()
        if weapon_range_type == "Short" or weapon_range_type == "Thrown" then
    
          -- Weapon counts as ranged, do a luck roll
          local roll = math.random(10)
          if roll <= attacker:GetAttribute("luck", ACTOR_TABLE_CURRENT) then
            
            -- Luck roll succeeded, modify critical chance to 100%
            return 100
          end
        end
    
      end
    
      -- Default return = chance of critical unaffected
      return chance
    end
    If you want to test the change prior to your character getting the Sniper perk (to verify if it's working), add the word "not" after "if" in line number 4; e.g.:

    Code:
     if not attacker:GetAttribute("sniper", ACTOR_TABLE_CURRENT) then
     
  10. Uncertain Questioner

    Uncertain Questioner First time out of the vault

    5
    Apr 3, 2021

    Thanks a ton. By the way does modifying the game with this program make using a save editor harder? I think Harold might have one perk too few by the time he's maxed out to get sniper. (Also once the Lua is edited do I re-run FTSE or just launch tactics?)
     
  11. Melindil

    Melindil First time out of the vault

    87
    Apr 15, 2018
    FTSE does not yet make any changes to the save game format, so any existing save editors will still work. Starting in (probably) FTSE 0.60, there will be customizable entity parameters that will persist in the save file; at that point, whether save editors continue to work or not will depend on how they're implemented (the one I use for testing, FOTGEE, will very likely still work, unsure about others).

    Changes to the Lua script or configuration file only require restarting the game, no need to re-run the FTSE setup. And the scripts can be changed without breaking existing saved games - whatever script is loaded at game startup will be used for that session, regardless of what was in use when the save was made. (So FTSE can also be used as a kind of save editor, by making changes to entities in the OnLongTick hook, re-saving the game after the changes are made, then clearing out the script before continuing play. This is probably more tedious than using the existing editors, but it gives mods a lot of flexibility if they need it.)
     
  12. nadeauhugo

    nadeauhugo Author of FOT mod THE SUM Modder

    541
    Mar 9, 2014
    Hello hello,

    Two small questions for you Melindil.

    First, I was wondering if, in your explorations, you came accros the functions that are called when the Glowing one trait is on. I really love the light it provide as it is customizable (if you give it a white hue and an arc of 90 degrees to it, it really feels like the character is holding a torchlight), but I would like to disable the aura of radiation around as it makes no sense in my use of it. Is there some chance you could provide me with an hex patch for that in one of your future versions?.

    And also, have you got some chance to work on the onInventory hook yet?

    Thanks a bunch!
     
  13. Melindil

    Melindil First time out of the vault

    87
    Apr 15, 2018
    I have seen reference to the Glowing One perk, way back when I did the first investigation into the Team Player perk. But I think that was for applying the radiation damage, not the lighting effect. I can add it to my list of things to search for, as being able to add those kinds of effect attachments to entities would be useful.

    It's in progress now. To double-check, I'm looking at adding the following: (in all cases, "entity" is the character equipping the item, "item" is the entity object to be equipped, and "slot" is for either left hand, right hand, or armor)

    Hooks:
    OnEquip (entity,item,slot)
    OnCheckEquip (entity,item,slot) [called before equipping to let scripts control if equipping an item is allowed]
    OnUnequip (entity,item,slot)
    OnCheckUnequip (entity,item,slot)

    Functions:
    entity:GetEquippedItem (slot)
    entity:EquipItem (item,slot)
    entity:UnequipItem (slot)

    Am I missing anything important?
     
    Last edited: Apr 18, 2021
  14. nadeauhugo

    nadeauhugo Author of FOT mod THE SUM Modder

    541
    Mar 9, 2014
    Oh yeah controling radiation damage is exactly what I will need. Just need to find a way to cancel it to use the light without it. Thanks a lot for adding this to the list.


    And yeah, this just look amazing to work with. I understand that it will let us produce different effects from items equipped or in inventory as needed. Great :D
     
  15. Uncertain Questioner

    Uncertain Questioner First time out of the vault

    5
    Apr 3, 2021
    Is there a possibility this may have busted the Tank Cannon? I've got it loaded but it won't fire even at behemoths. It always says "That shot is blocked." NEVERMIND It was my just punishment for using the prone exploit.
     
    Last edited: Apr 23, 2021
  16. OxSkull

    OxSkull First time out of the vault

    1
    Sunday
    Just logged in to say what you have achieved for FOT is awesome.:clap::clap::clap:
    Im very interested in a dialouge system that you proposed, i understand it would be its own undertaking and lots of work.

    Are you able to display sprites or tiles with FOTSE?
    When using a higher RES, is it possible to have title and splash screens that aren't cropped to 800x600?

    A side note, we have Sprite creator by JarekFall, a long process but a reliable program, i dont remember it ever crashing. Then there is redViewer that can make tiles, the til format. A strict process, when not followed like a lemming caused the program to crash or make a corrupt tile making the map editor crash when selecting it.

    Basically it would be awesome to have til creation built into Sprite creator. I tried contacting JarekFall years ago about it, but never got a reply.

    Anyway sweet work Melindil.
     
    Last edited: May 2, 2021 at 6:27 AM