vitaeexmorte wrote: ↑
Tue Oct 02, 2018 6:10 am
Not sure that is possible, the game lacks several things that would make me believe that can be done.
First, no difficulty option that generally disables friendly fire, second, no metamagic Selective Spell or Sculp Spell, which would allows a caster to change spells to only target enemies.
In short, there is most likely no funktion in the game code to do it easily. Even the spell Controlled Fireball hits your party, just not as hard as the enemies. Next best thing would be increased damage resistance, saving throws or outright invulnerbility, things you don't seem to want to begin with.
I just added a NoFriendlyFire cheat mod to KingmakerMods.pw.
Spells and abilities have a TargetType property, which is either Enemy, Ally, or Any. AoE spells and abilities use the AbilityTargetsAround component of unit ability logic (UnitLogic.Abilities.Components.AbilityTargetsAround) to select nearby targets.
Disabling friendly fire for AoE attacks was straightforward. I changed this:
Code: Select all
IEnumerable<UnitEntityData> source = GameHelper.GetTargetsAround(anchor.Point, this.m_Radius);
// source = source.Where(context.MaybeCaster.IsEnemy);
source = source.Where(context.MaybeCaster.IsEnemy).Where(u => !u.IsPlayerFaction);
I was looking for a solution last night, but I passed out. Reading your post inspired me to look again.
No clue how this would look in assembly.
NukeZen wrote: ↑
Tue Oct 02, 2018 11:08 am
Can you explain how to get this to work? Do i have to put the ini file somewhere and that's it? Or there are some more things to do?
There are no binaries yet. If there were binaries (i.e., if I released them or you compiled them), you would place KingmakerMods.ini and INIFileParser.dll in the root of your game path, and INIFileParser.dll again in the Kingmaker_Data\Managed folder. Then, you would run the PatchworkLauncher, add KingmakerMods.pw.dll as an active mod, and click the big Launch with Mods button.