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

Not a FTSE specific issue, but why did Farsight promote to senior initiate while my main character and Stitch are still initiates. Both Stitch and Farsight have 5 charisma. Does Farsight have more initial "missionscom" value? This is important for the above reason. I thought maybe kill counts slightly affected promotions but I did all my killing with my main character. Maybe some raiders in Brahmin Wood are bugged and will reduce your missionscom if you kill them? Or are promotions handed out randomly between team members every mission? Sometimes I can disband Farsight after Brahmin Wood without getting the bug, ergo sometimes she isn't outranking me after Brahmin Wood, but unfortunately I haven't properly confirmed that (didn't know promotion was tied to that bug when it didn't happen).
I looked into this, and found the code routine that calculates rank. Paraphrasing from my notes:

For the main character, you get "half of a rank" for each of the following:

* Completing a "mission" (this is the "missionscom" field in the save / editor). Note that this is incremented for more than just triggering exit on a map. It looks like even unlocking bunker maps, and side mission objectives, can increment this too. (Specifically, completing mission 1 gives one point for finishing the mission, and one point for unlocking Bunker Alpha.)

* One half of a rank for every 2 Charisma

* One half of a rank for every 300 reputation. (Negative reputations will subtract half a rank every 300 points as well.)

* +2 halves of a rank for every instance of the Brown Noser perk

Once this value is determined, subtract one, and divide by 2 (rounding down). This will assign rank from 1 (Initiate) to 13 (General). Values above 13 or below 1 are capped to the max/min ranks.

Net result: Because the player rank calculation starts at a "rank" of zero (actually negative one-half due to the subtraction in the final calaculation), you need 5 "half ranks" in order to get from Initiate to Senior Initiate ( 5 - 1 = 4, and 4 / 2 = 2). A low Charisma character (below 6), or one that received a lot of negative reputation in the first mission, may not get promoted.


For side characters, the calculation is simpler. Rank is equal to (base rank + Brown Noser perks), + 1/2 of missionscom value (rounded down). Charisma does not matter, but base rank as assigned in the Entity Editor does. The big difference for squad members is that, for every "completed mission", every squad member has only a 25% chance to gain one point of missionscom. So it is entirely random whether or not recruits eventually gain ranks.

In the case of Farsight, base rank is Initiate (1), and there's a 25% chance for each of the two missionscom increments that she will gain half a rank. So if both of these happen to trigger, then she will rank up after arriving at the first bunker. I would assume the same applies to Stitch as well.
 
Wow, thanks so much. You should put this in your Github wiki. Your critical hit documentation has been instrumental in me doing multiple solo tough guy runs. I learned from your documentation that FT classifies bypass and 2x damage crits as "low crits", so the Heavy Handed trait "penalizes" you with more of those "awful" bypass crits that hit armored targets for 500+ damage from big guns.

Anyway using the probability calculator it looks like a low charisma main character has a 12% chance of either or both Stitch and Farsight outranking you after Brahmin Wood, which bricks your team with ghosts if you try to disband them.
 
How to disable the new burst fire fix? There's only the option to enable/disable old burst fire fix. Do I just delete the CalculateChance, CalculateSharefunctions, OnBurstAttack functions in ftse_base file? Asking because if i'm playing solo the bug would only give me an advantage, would it not?
 
Last edited:
How to disable the new burst fire fix? There's only the option to enable/disable old burst fire fix. Do I just delete the CalculateChance, CalculateSharefunctions, OnBurstAttack functions in ftse_base file?
You should only need to remove OnBurstAttack, as it's the only one directly called by the FTSE engine. The others are only helper functions for OnBurstAttack.


Asking because if i'm playing solo the bug would only give me an advantage, would it not?
For a player doing a solo run, the bug fix doesn't make a lot of difference on damage taken - enemies firing at your character will have the same chance to hit, bug or no. It would really only matter if you were standing next to friendly NPCs, or explosive targets, where the high chance of hits on those targets could affect the player's ability to complete the mission without friendly casualties. (Or on missions where enemies with big guns might target friendly NPCs, since in that case *the player* would be the one more likely to be hit.) But otherwise, yes, a player who knows about the bug can a) avoid the few situations on a solo run where they would face added difficulty, and b) fire at targets in a way to specifically take advantage of the old burst behavior.
 
Hi, I have been testing ftse in turnbased mod and it is absolutely great. Really great work, Melendil! But of course I have some questions:

- I think ftse should try to load the FTSE.lua file from the mod folder first and if none is there load the one from the main folder. This way each mod could have their own ftse code without interfering with other mods and still be installed alongside.

- It seems there is no way to integrate with explosions from traps? At least they dont show up for me in the OnDamageCalc, OnChanceToCritical or OnAreaAttack hooks.

- Movement speed. This i guess is a problem only in turnbased mode. The Bonus move perk seems to work as expected, but Silent Running is not. It is just changing the speed of the movement but the range is the same. There is MaxMovementSpeedMaybe in ftse which also only changes the speed of the animation. Since Bonus move works, the engine seems capable of it. It would be great for our mod if fiddling with this would be possible.
 
- I think ftse should try to load the FTSE.lua file from the mod folder first and if none is there load the one from the main folder. This way each mod could have their own ftse code without interfering with other mods and still be installed alongside.
Quick question on this - will the separate mods be started via the -path command-line option, or via the "Custom Campaign" option from the menu? For the -path option, it should be simple to add (and, given that the file structure is changing a bit in the next FTSE release anyway, it's a perfect time to add something like this). The "Custom Campaign" option is more difficult, for a couple reasons: 1) There are parts of the FTSE Lua scripts that are run prior to the intro screen starting (things like OnStart, OnLocaleLoad, etc.), so most of these would run from the default location before the mod was selected. And 2) I wouldn't be able to easily handle running the right Lua scripts for save game loading, unless I had some way to track which default path should be used in the saved game file (and, even then, I'd have to reinitialize the Lua state each time a game was loaded, in case the mod base directory changed).

- It seems there is no way to integrate with explosions from traps? At least they dont show up for me in the OnDamageCalc, OnChanceToCritical or OnAreaAttack hooks.
Yeah, the existing event hooks miss the trap detonation cases. I do know there's a virtual table function for trap detonation (#451, listed as "DetonateTrap" in the FTSE vtable documentation), but I haven't yet confirmed that all trap detonation scenarios run through this code. I'll probably want to walk through all of the cases to validate each one (from memory - traps can be detonated from proximity, timer, remote detonator, damage to the trap, opening a container, opening a door, failing to disarm, or failing to set - any others?). If everything goes through vtable function 451, then I can probably provide an example of how to place a hook on that function - or, if desired, I can add a regular trampoline-style hook (e.g. OnTrapDetonate).

The fact that OnDamageCalc doesn't get triggered here also means there may be additional places in the code where damage is determined. I'll need to walk the trap detonate code to figure out where the damage is figured, then either create a new trampoline hook there, or have that location call the existing OnDamageCalc if the parameters and return type are identical. I'll probably need to do the same for the Breakable class (e.g. oil drums), since it may also do the same thing.

- Movement speed. This i guess is a problem only in turnbased mode. The Bonus move perk seems to work as expected, but Silent Running is not. It is just changing the speed of the movement but the range is the same. There is MaxMovementSpeedMaybe in ftse which also only changes the speed of the animation. Since Bonus move works, the engine seems capable of it. It would be great for our mod if fiddling with this would be possible.
I haven't yet found the code that does conversion of movement distance to AP cost (though I could probably find it via a breakpoint on access to the Bonus Move perk memory location). But I did do a quick test, and found that even without sneak, walking and running (either shift-click or modifying the default run option in the options screen) both give the same max distance to move in turn-based. So I assume the game code only uses stance, and not animation type or movement speed, to determine the distance-to-AP conversion. This would be another place where I could add a hook to let a script change (fix) the distance conversion for walk vs. run.

EDIT: It turns out I *did* find this code - part of it is in the Actor::Move vtable function (#280), and part is in GetActorMovementCostToLocation (#278). I assume Move calculates cost as the character moves, and GetActorMovementCostToLocation is used to show the movement cost tooltip when you move the cursor to a location within movement range. Looking at the code, I can confirm that the only factors which influence distance-to-AP cost calculation are: stance, climbing a ladder, Bonus Move perk, and Tunnel Rat perk. There is no check for Silent Running, walk vs. run, or even sneak. Since the code is also included in the Move function itself, using vtable overrides isn't going to work (the Move function does too much that isn't yet exposed to the Lua API), so I'll need to add a trampoline hook to both places, and set it up to call a Lua event function (e.g. GetMoveDistancePerAP or similar).
 
Last edited:
Quick question on this - will the separate mods be started via the -path command-line option, or via the "Custom Campaign" option from the menu?
Yes - I was thinking of the -path case.
Yeah, the existing event hooks miss the trap detonation cases. I do know there's a virtual table function for trap detonation (#451, listed as "DetonateTrap" in the FTSE vtable documentation), but I haven't yet confirmed that all trap detonation scenarios run through this code. I'll probably want to walk through all of the cases to validate each one (from memory - traps can be detonated from proximity, timer, remote detonator, damage to the trap, opening a container, opening a door, failing to disarm, or failing to set - any others?). If everything goes through vtable function 451, then I can probably provide an example of how to place a hook on that function - or, if desired, I can add a regular trampoline-style hook (e.g. OnTrapDetonate).
From my testing I have found DetonateTrap to be called on any Traps explosion and PlaceTrapMaybe when placing a trap. One more way to detonate is when picking up a CaptureItem like the Flag. (on which someone put a trap of course)
Looking at the code, I can confirm that the only factors which influence distance-to-AP cost calculation are: stance, climbing a ladder, Bonus Move perk, and Tunnel Rat perk. There is no check for Silent Running, walk vs. run, or even sneak.
Yes, I think thats true
Since the code is also included in the Move function itself, using vtable overrides isn't going to work (the Move function does too much that isn't yet exposed to the Lua API), so I'll need to add a trampoline hook to both places, and set it up to call a Lua event function (e.g. GetMoveDistancePerAP or similar).
This would be great :D
 
Back
Top