Fallout Tactics utility FTSE - Fallout Tactics Scripting Engine (0.55a)

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 ;).
 

Attachments

  • fbos0000.jpg
    fbos0000.jpg
    58 KB · Views: 488
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.
 
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.
 
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!
 
Re: crash:

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.

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).

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!

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.

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)

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

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.

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).
 
Re: crash:
The way you describe it, it is actually very likely to be the same one.

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
 
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).

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.
 
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 tried all the previous crash scenarios and so far no crash. Looks like you did it!
 
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
 
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


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?)
 
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.

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).

(Also once the Lua is edited do I re-run FTSE or just launch tactics?)

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.)
 
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!
 
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?.

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.

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

Thanks a bunch!

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:
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.

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.


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?

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
 
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:
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:
So, after fixing a fun bug where swapping weapons between hands would duplicate items, and another bug where swapping weapons between hands would give a character millions of XP, FTSE 0.52a is now released. There are new hooks and class functions for equipped items. Docs are updated, including a nifty new example inspired by Corpse's idea for armor-attached weapons.

As always, let me know of any issues.
 
Im very interested in a dialouge system that you proposed, i understand it would be its own undertaking and lots of work.
I won't consider FTSE "complete" until this one is done. I've been saving it for later, though, to make sure I have a full understanding of what goes on inside the game EXE, because it will build on almost every other area that I have to work on.

Are you able to display sprites or tiles with FOTSE?

I haven't done much with the graphics part of the game engine yet, other than lucking into finding the palette entries allowing for color portraits to work.

When using a higher RES, is it possible to have title and splash screens that aren't cropped to 800x600?

This is probably doable, but I'd need to learn more about how the UI windows work. I've learned a little bit about e.g. the title screen buttons from looking at what FT Improver does to enable the tools in the 1.27 EXE, so I know roughly where to look, but haven't dug in much yet.

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

I did have a thought on this. It's still a very long way off (I want to get the in-game features of FTSE working first, and I'm still in a time crunch), but one way I thought to go about this would be to make a plugin for a graphics package (would probably have to be GIMP since I don't have Photoshop), that would support using layers for defining sprite direction and animation frames, and that could then export the appropriately-built SPR or TIL file. This would be a lot quicker/easier than trying to build a fully capable graphics editor + SPR/TIL builder.
 
I'm amazed and so happy you managed to pull this out before my new release! I'll definitely add it as soon as tomorrow and give you some feedback on how it went. Congrats and thanks again for your incredible work. And oh, these are funny bugs by the way ha! The engine have some crazy behaviours sometimes, but it always make us learn a bit more about it each time.
 
I haven't done much with the graphics part of the game engine yet, other than lucking into finding the palette entries allowing for color portraits to work.

Was just thinking about a basic speech system using comic style speech bubbles, but the Spr/Til image spawned would need to be interactable and have some kind of effect when clicked. Ive done it before using the tactics scripting but it was an insane amount of scripting. Having the engine paused also while speech is happening would be handy, as in my version you could shoot the dialouge options lol.
 
Back
Top