Hello everyone.
I've just recently returned to Oblivion and the CS and I have a Faction issue that I was wondering if anyone could shed some light on.
I have a number of creature companion mods under the name Maigrets and I released a new mod last week called Maigrets Gnoll Archer.
http://oblivion.nexusmods.com/mods/44606/?
All of my companions are in the Player Faction only which doesn't cause any issues except occasionally if I have more than one of them at a time in my game they may fight each other. It happens rarely enough that's it's not much of a problem, at least for me. It usually resolves itself fairly quickly when either one will knock the other out, I summon them away or change cells.
The problem with my Gnoll Archer is since he's ranged, he will hit my other companions with arrows enough times when they are engaging enemies that they will understandably retaliate with extreme force. This happens because they will be in his line of sight when attacking enemies and will unavoidably be hit. It's getting to be very annoying because in this situation if they do stop it happens again as soon as we encounter enemies.
I need to create a faction that I can apply to all of my companions so they don't fight each other if the archer is in the group, but I'm at a bit of a loss as how to go about it. I guess the other solution is to only have the Gnoll Archer as a follower and none of the others which I don't really want to have to do. I don't have all of them in game at once of course, but just one other with the archer is problematic.
They all have Friendly fire in their script, but that only applies to the player. This is the script they all use.
Also a minor question re the script - Is the last part which also regards friendly fire actually necessary? I was originally advised to leave it in by Jumonji who helped me with my first ever mod, but someone else said it was redundant, so I'm not sure. It doesn't cause any problems.
scn AAGnollArcherScriptref rEnemyshort doOnceref GetSelf;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;begin OnActivate if IsActionRef player SetIgnoreFriendlyHits 1 if doOnce == 0 Player.addspell AAGnollSummon set doOnce to 1 endif if (GetSelf.GetForceSneak == 0) && (player.IsSneaking == 1) GetSelf.SetForceSneak 1 elseif (GetSelf.GetForceSneak == 1) && (player.IsSneaking == 0) GetSelf.SetForceSneak 0 endif if GnollFollow == 1 set GnollFollow to 0 Message "'Bonesplitter, wait for me.'" elseif GnollFollow == 0 set GnollFollow to 1 Message "'Bonesplitter, come with me.'" endif EvaluatePackage playGroup Idle 1 else activate endifend;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;begin OnStartCombat;make sure not to attack friends after accidental hits. set rEnemy to getCombatTarget if GetShouldAttack rEnemy == 0 && Player.GetShouldAttack rEnemy == 0 StopCombat StopCombatAlarmOnActor playGroup Idle 1 return endifend
As far as the Faction issue goes I can't see a way around it since it affects my other stand alone mods which is the big problem, unless somehow there's a scripted solution which would need to be added to the existing script for all of them. The reason for that is I use Global Values in their packages which affects their AI. I don't want a menu system for a couple of reasons - they lose their idle animations and personality and for creatures I find it unnecessary.
This all probably sounds confusing so if other info is required I'll do my best to supply it.
Thanks for your time,
Maigrets.