Fallout Tactics utility Fallout Tactics Scripting Engine (0.52a)

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

  1. nadeauhugo

    nadeauhugo Author of FOT mod THE SUM Modder

    Mar 9, 2014
    I think the efforts needed are not so bad if you systematize your work a bit.

    1. You first need to add a series of default dialog entries in generic_mission.txt :
    Dialog_yess= {<Cg>"Yes"<C->}
    Dialog_no= {<Co>"No"<C->}
    Dialog_more= {<Cy>"Tell me more"<C->}
    Dialog_violent= {<Cr>"Go fuck yourself!"<C->}
    Add more options each time you need them.

    2. Then you add these 4 dialogues under the level tab in each and every mission map using mission editor, regardless of dialogues existing or not. You are preparing the groundwork for the creation of dialogues when you will need them.

    3. Then you create 4 impossible to kill entities with 10000 AC and a sprite that look like a dialog icon, cheking the always friendly checkbox. You then change the color of the entities team to make it more easy to spot, like red for some violent dialog, for example. Don't forget to add as the default click dialog one of those already saved in each mission map.

    4. Add the dialogs as character names in characters.txt between two "", making the dialog appear later when hovering the dialog icon with your mouse.

    5. You pre-add those entitites to each of your maps, assigning them a friendly player and hiding them outside the map in a hidden location.

    You are now ready to quickly create any given dialog with no time.

    1. As soon as the character you are speaking to finish his.her sentence, using the script "speech occured", you move the 4 options (or only the ones you need) to that character using the script "move to [entity name]". You also assign a variable, like : speech = "super quest asked"

    2. Once again, you use the script "speech occured" + variable speech = "super quest asked" to determine the outcome. As soon as "yess" speech occured, for example, you move all the dialog icons back to the hidden location (using a waypoint), and you apply the consequence. If the consequence is a response from the character you are speaking to, you use the "force speech" trigger, that could trigger a new set of choices.

    If you need the dialog icons for another character, you simply call them again, including some other, uniques ones you might need. You can do this as many times as you need.

    Of course, it is still a bunch of work, but you can achieve that quickly if you already have the dialog icons and their dialog nodes integrated to each map. And it has the advantage of using the same mechanic as clicking something to speak.
  2. nadeauhugo

    nadeauhugo Author of FOT mod THE SUM Modder

    Mar 9, 2014
    0.52a works like a charm. I got my scripts work in no time and playing with the onEquipped and other hooks is a big big fun. Congrats for this amazing work! :D
  3. Sergeek

    Sergeek First time out of the vault

    Jul 26, 2021
    Decided to install this utility since manual editing of GoG's BoS.exe breaks the game with Team Player/Loner fix. This one works without problems, but I don't understand two options:

    1. Old burst bug fix. Burst fire bug is notorious, then why this fix is unchdked by default? Should I switch it off?

    2. DoNightPerson fix. What does it do? Doest it fix the permanency bug of Night Person or does it enable it for NPCs?

    Edit: I also hex-checked the patched BOS.exe and not a single value from the "List of HEX-based fixes" was changed. From what I gather, this is intended - FTSE externalizes those hex fixes, right?
    Last edited: Jul 27, 2021
  4. 2hmt

    2hmt First time out of the vault

    Mar 31, 2011
    Работает с NPC. Позволяет через скрипты определить переменную день/ночь. Простейший пример установить за пределами карты NPC с включенным DoNightPerson и осуществлять проверку.
    Ну как-то так. (Sorry ... Russian forum)
    • [Rad] [Rad] x 2
  5. Sergeek

    Sergeek First time out of the vault

    Jul 26, 2021
    Oh, that's cool! What about Old burst bug fix? Why is it unchecked by default? Is it unstable?
  6. Corpse

    Corpse Mildly Dipped

    Apr 7, 2003
    This is awesome news. Will give it a try soon. Thank you very much for implementing this.
  7. Templayer

    Templayer The Dark Templar of the New Brotherhood of Steel

    Jul 25, 2010
    Hello! Haven't read the entire thread yet (I'm at page 5), but are dogs being considered in the burst patch?

    They can't really crouch or go prone, but their standing position has less height than a crouching character, so it should be done for allied dogs/wolves as well?

    I would presume having a dog/wolf in your party would be "normal" for a new campaign, given the past with F1 and F2. It's a "classic feature", one could say. :P
  8. Templayer

    Templayer The Dark Templar of the New Brotherhood of Steel

    Jul 25, 2010
    I've read the entire thread (finally).

    I must say that the amount of work done and in working order is quite substantial! Great job!

    I'm not against Sniper being limited to "long-range" weapons instead of just ranged weapons, but maybe additional perks should be added for other kinds of combat to balance it out?

    Too bad that we cannot dual-wield pistols and SMGs, that would be a fun build!

    A "Gunslinger" perk for pistols and SMGs (wild west gunslinger picture), a "Killing Machine" perk for Big Guns and Energy Guns (Terminator-like stance with a rotary sci-fi looking minigun as the picture. Or just something that could be described as a plasma flak cannon :D ), as the replacements for Sniper not working on all ranged weapons. This would fix making M2 browning overpowered if the Sniper perk worked on it, as we could tweak the BG/EW perk instead.

    Until that, let's just use the fix that also makes Sniper work for all ranged weapons. Is that fix already a part of this as a variation on the Sniper perk fix? Because it should be. I mean having the code for it somewhere in the thread is nice and dandy (I saw it), but that really should be a part of this project. :P

    Again, excellent job, can't wait for people to make their own entire story campaigns with this!

    Here's a party set-up for my LP - the builds are based on HAVING FUN:

    EDIT: "Killing Machine" perk flavour text: "What's that flying over there? Is it a mutated bird? A plane? It's a... never mind, it's dead now. Even if it wasn't alive to begin with."
    Last edited: Oct 2, 2021
    • [Rad] [Rad] x 1
  9. nadeauhugo

    nadeauhugo Author of FOT mod THE SUM Modder

    Mar 9, 2014
    I realized that bonus triggers in LUA can't add or substract any armor threshold or resistance, and this is something that could be very useful to me. Is it planned to include them in the next version?

    Oh yes, another thing. I started using GetTag to trigger some behaviour following given tagnames, but I wonder if the reverse function SetTag exist too...
    Last edited by a moderator: Dec 7, 2021
    • [Rad] [Rad] x 1
  10. 2hmt

    2hmt First time out of the vault

    Mar 31, 2011
    Inventory notes.
    What should get into the starting inventory (item name, quantity and slot) is hardcoded into the engine.
    There are also additional items that are added depending on the skill:
    "small guns" = ammo9mmBall.ent + booze.ent
    "big guns" = happyPie.ent + booze.ent
    "energy weapons" = donutFood.ent + booze.ent
    "unarmed" = brassKnuckles.ent + rotGut.ent + buffoutChem.ent
    "melee weapons" = knife.ent + brokenBottle.ent
    "throwing" = spear.ent + rock.ent + fragGrenade.ent
    "first aid" = firstAidKit.ent + poisonChem.ent + poisonAntidote.ent
    "doctor" = doctorsBag.ent + fruitFood.ent + scalpel.ent
    "sneak" = axeHandle.ent
    "lockpick" = stinkyFood.ent + pullTabs.ent
    "steal" = pullTabs.ent + scripBos.ent (30)
    "traps" = spikeTrap.ent + grenadeTrap.ent + antiPersonnelMine.ent
    "science" = mentatsChem.ent + clipBoard02.ent + nukaClassic.ent
    "repair" = crowbar.ent + toolKit.ent + booze.ent
    "pilot" = beer.ent + booze.ent + xxxxxBeer.ent + catsPawMag.ent
    "barter" = catsPawMag.ent + pullTabs.ent + booze.ent
    "gambling" = scripBos.ent (500)
    "outdoorsman" = radxChem.ent + healingPowder.ent
    My first patch for OFM was to erase the names of these items.
    I found another way, more correct - changing the number of equipped items to zero:
    example asm

    No starting inventory (all value -> 00)

    0CC4FE 01 (mp5Sub.ent)
    0CC543 01 (stimpack.ent)
    0CC588 01 (bosLeather.ent)
    0CC5CC 30 (ammo9mmBall.ent)
    0CC610 01 (nucaNormal.ent)
    0CC654 01 (happyPie.ent)
    0CC6EA 18 (ammo9mmBall.ent)
    0CC72E 01 (booze.ent)
    0CC77D 01 (happyPie.ent)
    0CC7C1 02 (booze.ent)
    0CC810 03 (donutFood.ent)
    0CC854 01 (booze.ent)
    0CC8A4 01 (brassKnuckles.ent)
    0CC8E8 03 (rotGut.ent)
    0CC92C 01 (buffoutChem.ent)
    0CC97C 01 (knife.ent)
    0CC9C0 01 (brokenBottle.ent)
    0CCA10 03 (spear.ent)
    0CCA54 0A (rock.ent)
    0CCA98 01 (fragGrenade.ent)
    0CCAE8 01 (firstAidKit.ent)
    0CCB2C 02 (poisonChem.ent)
    0CCB70 01 (poisonAntidote.ent)
    0CCBC0 01 (doctorsBag.ent)
    0CCC04 03 (fruitFood.ent)
    0CCC48 01 (scalpel.ent)
    0CCC94 01 (axeHandle.ent)
    0CCCE3 01 (stinkyFood.ent)
    0CCD27 19 (pullTabs.ent)
    0CCD76 64 (pullTabs.ent)
    0CCDBA 1E (scripBos.ent)
    0CCE0A 04 (spikeTrap.ent)
    0CCE4E 01 (grenadeTrap.ent)
    0CCE92 03 (antiPersonnelMine.ent)
    0CCEE1 01 (mentatsChem.ent)
    0CCF26 01 (clipBoard02.ent)
    0CCF6A 04 (nukaClassic.ent)
    0CCFB9 01 (crowbar.ent)
    0CCFFE 01 (toolKit.ent)
    0CD042 01 (booze.ent)
    0CD091 06 (beer.ent)
    0CD0D6 01 (booze.ent)
    0CD11A 02 (xxxxxBeer.ent)
    0CD15E 01 (catsPawMag.ent)
    0CD1AD 01 (catsPawMag.ent)
    0CD1F1 32 (pullTabs.ent)
    0CD235 01 (booze.ent)

    0CD281 F4
    0CD282 01 (scripBos.ent 500)

    0CD2D3 01 (radxChem.ent)
    0CD318 01 (healingPowder.ent)

    these are real offsets - for FTSE + 40000h
  11. nadeauhugo

    nadeauhugo Author of FOT mod THE SUM Modder

    Mar 9, 2014
    Okay, yeah, another thing I'm experiencing. I tested it, and it seems the OnInventoryAdd does not work for container entities, only for actors. But the documentation says that it is a hook created for any entity. Is there a way to make the hook work for containers? It is a bit sad that no trigger works in FT to check the contents of containters, and the same is happening in FTSE, making containers only useful for unscripted game contents for now.
  12. Reinar

    Reinar First time out of the vault

    Oct 23, 2011
    A few weeks ago I was thinking about starting my new project (the Firefly campaign) so I started exploring FTSE which I definitely want to use in some way. I had a couple of ideas for new perks. Most of them aren't doable, because it's impossible to access character's current HP or AP (or radPoints). Some of them are and if I ever finish the campaign, they will be there. But since that's improbable, I thought I would share them with the community.

    Make squad mate(s) immune to friendly fire
    (something every F2 player with Marcus in party always wanted). I attached the effect to the Scout perk. You can also make the character immune to own attacks (for example grenades) if you remove the second part of the condition.
    function OnDamageCalc (attacker, target, weapon, loc, damage, critTable, rollArray)
      if target:GetAttribute("scout", ACTOR_TABLE_CURRENT) > 0 and target ~= attacker then
         local squad = world:GetSquad()
         for i,guy in ipairs(squad) do
             if attacker["id"] == guy["id"] then
                 target:DisplayMessage("Watch it!")
                 return 0

    Destroy armor on critical hit. This needs some work to make a dented/destroyed version for each armor that can be affected. Also this could use some randomness to it so it's not on every crit, but only on some of them (5 % chance or whatever).
    function OnCriticalEffect1 (attacker, target, weapon, loc, roll)
      local armor = target:GetEquippedItem(EQUIP_SLOT_ARMOR)
      if armor:GetInternalName() == "bosMetal" then
        dented = world:CreateEntity("entities/items/armour/bosMetalDented.ent", 1)
        target:EquipItem (dented, EQUIP_SLOT_ARMOR)
    Doing something on critical hit sounds like fun, so here are another two ideas for perks that I tried (and work). Both go inside the OnCriticalEffect1 function. Once again attached to some random perks.
    Gain experience for each crit. Can be taken multiple times.
        if attacker:GetAttribute("stuntMan", ACTOR_TABLE_CURRENT) > 0 then
           local cur_xp = attacker:GetAttribute ("experience", ACTOR_TABLE_PERM)
           local lvl = attacker:GetAttribute("stuntMan", ACTOR_TABLE_PERM)
           attacker:SetAttribute ("experience", ACTOR_TABLE_PERM, cur_xp + 20 * lvl)
    Gain money for each incoming crit. The amount of money can depend on some stat (luck) or level to stay relevant throughout the game.
      if target:GetAttribute("fortuneFinder", ACTOR_TABLE_CURRENT) > 0 then
        local newent = world:CreateEntity("entities/items/money/scripBOS.ent", 10)
    BTW: It's possible to change sex, although it takes some time and some armor swapping for the sprite to adjust. I tried to change race, but that doesn't work (no turning humans into supermutants or ghouls). Changing display name doesn't work either.
  13. nadeauhugo

    nadeauhugo Author of FOT mod THE SUM Modder

    Mar 9, 2014
    Amazing work here Reinar, I like all of them a lot and they trully feels like perks to me: strange behaviours than you could not obtain in any other way. The code looks pretty neat to.

    I wish we could be able to check the hitpoints as well, I would love to be able to give my petk "Survivor" to any character going as low as 1 or 2 hit point without dying, would be fun story-wise.

    Being able to play with character's color would be amazing also... We could have some special red power armors and other stuff. But like you said with changing sex, maybe it would not update right away, something that would render armor colors unusable.

    I think that changing display name fail as all local text files are only loaded once in memory at the game launch. Melindil told me that any script to change let's say a holotape content dynamically also fail for now due to this. A patch or code would be needed to change those strings into the loaded memory and save file info directly, or ask some files to be loaded again I think (like probably characters.txt in the case you mentionned), something like that.
    Last edited: Jan 17, 2022
  14. Reinar

    Reinar First time out of the vault

    Oct 23, 2011
    I was thinking more about changing the portrait with this (would be great when doing the race change, right?). Also if you have the strings prepared in front, you can just switch between them. I know where you aim with the dynamic changes, that's another level. Accessing the entity name and changing it should be easy (the getter already works, now we need the setter).

    Anyway, this is really a minor feature. The FT community can get without stories where the player transforms into ghoul or where the villain is hiding in plain sight wearing a mask or something like that. Now with accessing HPs and APs, I can think of a few really cool perks. And radPoints for a proximity detector. Also injuries, so we can fully implement an autodoc for campaigns where the player doesn't (can't) have a doctor.
  15. nadeauhugo

    nadeauhugo Author of FOT mod THE SUM Modder

    Mar 9, 2014
    Oh yes! Not only auto docs, but also area damage like pollution, heat and so on, that you could then reduce by the damage threshold...
  16. nadeauhugo

    nadeauhugo Author of FOT mod THE SUM Modder

    Mar 9, 2014
    I recently realized that my NPC might be all slowly dying from radiation, as the radiation is global in my mod (replaced by hunger). It will be very helpful to me to be able to assign radiation damage from FTSE, this way I could 1) give radiation damage without affecting other NPC 2) take into consideration RadiationResistance that actually do nothing, except from shutting down radiation completely when it is above 100%. Please include this in your next version, I think that will be a fantastic addition to it!
  17. topaz

    topaz First time out of the vault

    Dec 10, 2015
    hmm, author dont do nothing from last year may -> project is dead ?
  18. nadeauhugo

    nadeauhugo Author of FOT mod THE SUM Modder

    Mar 9, 2014
    I did not have a reply from the author in a very long while too. I guess we might have to assume this is as far as it gets. Unless some other programmer with Lua knowlege step up, of course.
  19. Corpse

    Corpse Mildly Dipped

    Apr 7, 2003
    Oh no! Has work on this project stopped?
    With what is available, is it possible to manipulate time to advance a specific amount within a mission?
  20. Reinar

    Reinar First time out of the vault

    Oct 23, 2011
    No. The possibilities are limited mainly to inventory operations, variable checks, some perks, combat modifications (damage calculations and stuff). Now that I think about it, variable quest rewards are also possible (without creating several triggers and items, for example for each stat/skill point when the reward is based off of charisma or barter) - even randomized ones. Nothing revolutionary though, no game-changing stuff.