Unusual Faction Issue

Post » Wed Dec 04, 2013 6:22 am

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. :smile:



User avatar
Nims
 
Posts: 3352
Joined: Thu Jun 07, 2007 3:29 pm

Post » Wed Dec 04, 2013 4:55 pm

Just create a faction and set the disposition to 100 among faction members. Make them all members of that faction, in addition to player faction. Have a look at a faction like AnvilGuards for an example of how to make fellow faction members friendly. Here's the http://cs.elderscrolls.com/index.php?title=Faction on the wiki for more information.

If you get the factions fixed up, you probably don't need that bit about friendly fire in the script.

User avatar
Dale Johnson
 
Posts: 3352
Joined: Fri Aug 10, 2007 5:24 am

Post » Wed Dec 04, 2013 6:51 pm

Ah, yes, got it. I thought it would be something simple, but I just needed a push in the right direction. Thanks so much AndalayBay.

User avatar
Nicola
 
Posts: 3365
Joined: Wed Jul 19, 2006 7:57 am


Return to IV - Oblivion