Kingdom Come: Deliverance

File information

Last updated

Original upload

Created by

machinegod420

Uploaded by

machinegod420

Virus scan

Safe to use

About this mod

Adds an NPC follower that will follow you around.

Requirements
Permissions and credits
Requires AI Standalone Resource
https://www.nexusmods.com/kingdomcomedeliverance/mods/1110/

Brief


Adds an NPC who follows you everywhere. You can buy a follower from a merchant near Bernard's training yard outside of Rattay. There are three tiers of followers, 800 groschen and 3200 groschen, and an immortal follower for 6400 groschen. Immortal means they fall unconscious in battle instead of die, but you will need to revive them manually.

You are able to manage your followers stats as well as his equipment. Your follower will also ride a horse when you ride a horse.


Important note : Saving is prevented by default when your follower is on a horse for stability and AI reasons. This can be enabled in the script if you want, since it should be fixed from my testing. But it is still a dicey situation, where that functionality is mostly there to make sure it works when the game forces you to save on a horse.

There are three optional variables in the script file that are important.
preventSavingOnHorse - Prevents you from saving by default if your follower is on horse. Better for stability.
useHorse - If you want to disable the horse functions because they are buggy or something.
attemptReequipPolearm - This is not necessary if you have a mod that changes the polearm slot to shield or something. They will still work with it on, it just makes it a little strange looking if they dismount from a horse.

Uninstalling

Use the console command 'follower_uninstall'. This should wipe old controller instances. If you do not do this your save will crash.


How to manage your follower
E - Manage them through the player UI. This means you can look at their stats, assign perks, and tell them what items to equip. You cannot give them items in this UI but you can make them drop things.
X - Give/Take items - Actually give them items
X (hold) - Retire your follower
E (hold) - Heals them because they don't do that themselves. Also reorders the follow player order in case they get stuck.

Horse Customization
You can place a caparison (only caparisons for now) inside of your followers inventory. Your follower's horse will use the caparison you place inside of his inventory. You can now customize each horse per follower.



Known Issues

A Woman's Lot DLC does not work with him. This is probably due to henry specific references but I don't have the DLC so I'm not all that interested in fixing this.

He attacks bernard after training with him.

He can be teleported into weird scenarios. It is possible for him to teleport into a training yard if he is at the right distance.

Your horse can spawn on top of his horse if you are too close.

If he gets stuck, use the Heal command, or get on your horse and get off. The AI resets when they dismount from a horse.


Shit gets fucky with saving and loading. Be gentle with it and try to save when the AI is in a state and not transitioning (like being idle vs them getting off a horse).


Changelog
1.9.1
Attempted bugfix.

1.9
- Added immortal followers to hire. Still needs a lot of testing, but this is a much requested feature. You have to heal them if they fall in combat. Then they get back up again.
- Increased horse teleport distance so they don't teleport as much

1.8
-Completely revamped horse customization (in a good way)
-Gave followers axe and mace skill
-Bugfixes

1.7.1
- Fixed bug where sometimes horse would still exist, causing huge issues
- Removed last gasp perk which would cause issues with tracking follower health
- Made caparisons universal across all followers. It is complicated from a UX standpoint to manage all your followers horse equipment (although very much technically possible. The UI just isn't there)

1.7
- Added the ability to change your followers horse appearance. The follower merchant near rattay provides this functionality.
- Gave follower horses equipment to make them much faster, making it possible for them to keep up with a racehorse.

1.6.3
- Removes the ability for the ai to attack you if you hit him
- Heal should re-equip weapons.

1.6.2
- Add the AI to the player faction. This should make them attack the esoteric bandit factions they may not have before. This also has the side effect of making it so that you can take all of his items without stealing them.
- The reset function should also attempt to reinitialize the NPC. This might change, as there is a possibility for the AI to build up aggression against you if have hit him accidently.

1.6.1
- Attempt to get the AI to stop freezing on surrendering enemies

1.6
- Update to use AI Resource
- Added some edge cases for some lua errors

1.5.6
- another attempt at getting him to shut up after combat
- body should no longer disappear after death.

1.5.5
- mercenary should shut up after combat
- Heal should stop bleeding now

1.5.4
- Implemented 2 tiers of mercenary - regular (800 groschen) and expensive (3200)
- Changed voice

1.5.3
- Implemented hack to fix door locking issue
- Increased radius of teleportation to lessen chance of killing player

1.5.2
- Removed the subtitles that would actually make it harder to see. Now it is more clear what he is saying

1.5.1
- New command: You can tell him to sit in one place and follow you again.
- He now says lines every now and then to give him some personality

1.5
- He talks! He has a voice so he grunts in pain, and insults the enemy during a fight.
1.4.10
- Bugfix attempts. Finally refactored code to be a state machine so should be more stable in general. Think I got the bug where he tries to run to your old position after he glitches out.
- Follower Horse is more responsive and should be faster.

1.4.9
- I keep accidently breaking this. Spawns the initial mercenary trader at the right spot instead of on the player

1.4.8
- Fixed issue where the targeting was too far (engine only supports 5 meters) causing the AI to freeze
- Fixed issue where AI would disappear if player was dismounted off their horse.

1.4.7
- Changed name to custom name
- Bugfixes for horse
- Added message if your follower dies

1.4.6
- Found out that combat level exists. The AI should be way smarter and better at combat now.


1.4.5
- Accidentally included test code in previous release. It will only kick in when you are attempting to load a save with a follower on a horse so you probably won't ever see the issue
- Sends a new order every 10 seconds in case the old order fails

1.4.4
- Removed 1s wait to make AI more responsive
- Teleports horse now since there was a bug where if the AI got too far it would reset their AI due to LOD reasons and hide them


1.4.3
- Fixed a really awful programming typo

1.4.2
- Attempt to fix bug where AI would try to teleport while on a horse if you got too far away. They should only teleport on foot.
- theoretical AI performance boost

1.4.1
- Fixed saving on horse bug (but save prevention workaround implemented just in case)
- Fixed uninstall function
- Replaced RemoveEntity with DeleteThis, not sure what the difference is yet

1.4
- Follower spawns a horse if you are on a horse and rides along with you. This works around the awkward behavior where they would keep teleporting alongside you if you got too far.
- Adds uninstall function.
- Follower no longer teleports on top of you, but in a random circle around you.
- Follower should not take falling damage as they teleport to your horses location if they are too far away.

1.3
- Added follower management!
- You have to hold down now to buy a mercenary

1.21
- Increased stats and modified reset orders

1.2 - Stable
- Saving and loading works now
- Merchant will not spawn multiple times

1.1
- You can now buy followers instead of using a hotkey to spawn one.


Future Plans
reset follower AI for edge cases. talking and shouting behavior


<rant>
The reason why that this mod is rough around the edges is because it was ludicrously hard to test and develop. When I first saw that the mod tools were released, I was hoping for some mods like this but found none. After using the mod tools, I now see why. These mod tools are horrible to use. AI behavior modding has no abstraction whatsoever and is tightly coupled to a lot of things that are everywhere that have no documentation. Where you think it would be straightfoward to do something, the behaviors have miles of abstraction that have no documentation or any clean interface. On top of that, they are horribly unstable, making it impossible to experiment. If I could, I would take these mod tools and fly them directly into the sun. In the event I ever meet the developers, I would congratulate them for creating a game such as this. And then stab them.

Honestly, the video tutorials need to be more about ingame things rather than explaining everything in a vacuum. As of right now it is like teaching a kid to ride a bike on training wheels and then having him finish the Tour de France.
</rant>
That being said, this would have been impossible without the mod tools. So I don't mean to be unappreciative