-
Notifications
You must be signed in to change notification settings - Fork 6
DTAIFix
CJ Kucera edited this page Jan 29, 2023
·
4 revisions
Author: Riftedge
Last Updated: July 23, 2018
In Categories: Gaige Changes
Link to Mod File
(right click and "Save Link As") |
View on Github
(after clicking on a mod, right click on "Raw" or "Download," and then "Save Link As") |
I'm not good at English so the following description may looks strange LOL
How I make this mod:
DeathTrap's AI config is in GD_Tulip_DeathTrap.AI.WillowAIDef_DeathTrap. Dump it and you'll find that the AIDef is formed of several nodes. Actually, there are 4 kinds of node: NodeType_Priority, NodeType_Action, NodeType_Random and NodeType_Sequential. They all have an attribute called Children, and DeathTrap will execute nodes in their Children attribute by Priority, randomly or sequentially. This is the tree of DeathTrap's AI. It starts with node(0) called Tree.
Besides, most nodes have attribute CanRunIf and Action.
The problem here is that the priority of shock attack is too high and it's CanRunIf attribute is wired. It could be run when "target is flying or target is not phaselockable". So DeathTrap will always use shock attack against most bosses, which are not phaselockable.
Other modification are mostly easy to understand.
NodeType_Sequential will somewhat make DeathTrap stuck. So I extract shock ball, rampage, explosive clap and laser from their original sequences and put them into the main node "Prority" directly. This actually give them priority which does not exist in vanilla Borderlands 2. But this prevent DeathTrap from being stuck sometimes.
DeathTrap will try to go to the opposite side of Gaige when using any melee attack, including normal melee and rampage. This is because some enemies' hitboxes are strange. For example, DeathTrap is not able to deal damage to Wilhelm when facing his back because of the gaps. So this will give player some kind of ability to reposition DeathTrap.
After decrease the prority of shock attack, DeathTrap will stuck in the following situation:
Target runs away from DeathTrap, then DeathTrap run after it trying to use melee attack. Target stops suddenly and doesn't move, DeathTrap will hit the target and cannot move either. Then DeathTrap stops any movement and just stares at target.
This is the most difficult problem while writing this mod. I spent over 12 hours on this and finally came up with a solution. I add a TimedFail to all melee attack, so when DeathTrap trying to melee and get stuck on that situation, the present melee attack will fail after several seconds, then DeathTrap will countinue the Prority sequence. This may seems a little bit stupid but it works really well. DeathTrap now could perform attacks smoothly.
I think this is because of the function WillowGame.Action_FlyAnimAttack:MoveToTarget. This may be called automatically.
I also modify the CanRunIf attribut of some attacks so DeathTrap won't try to use melee attack, Explosive Clap or Shock Ball against flying target. This is not perfect because of Bunker and Bloodwing.
I'm still new to modding so this mod is far from perfect. But it's already usable now.
ModCabinet is auto-generated based on information found in the BLCM Github. Information here could be wrong in various ways. The About ModCabinet Wiki page will have information about any errors encountered while building the wiki. If you see something amiss, please stop by the community Discords and let us know. (Apocalyptech is the maintainer of this code at the moment, if you wanted to @ him specifically.)
Wiki Links
Borderlands 2 Mods
- Major Overhauls and Mod Packs
- General Gameplay and Balance
- Characters and Skills
- Weapons/Gear
- Farming and Looting
- Enemies
- Maps and Public Transport
- Audio and Visual
- Quality of Life
- Other
Pre-Sequel Mods
- Major Overhauls and Mod Packs
- General Gameplay and Balance
- Characters and Skills
- Weapons/Gear
- Farming and Looting
- Enemies
- Maps and Public Transport
- Audio and Visual
- Quality of Life
- Other