Jump to content

Help with a Faction script

Recommended Posts

Hello, I've been using a custom script effect spell I created to remove NPCs from any factions they are on, but it seems it is causing other actors with the same cell to also be removed from factions,

I'd like to know if there's something that isn't right or whatever is causing this odd behaviour of the script.


EDIT: The issue I'm having happens when I recast said spell on an actor that already had their factions removed.


Here is the script.


scn FactionCheckR

ref me


ref fac1
ref fac2
ref fac3
ref fac4
ref fac5


Begin ScriptEffectStart


    set me to GetSelf


    set fac1 to me.GetNthFaction 0
    set fac2 to me.GetNthFaction 1
    set fac3 to me.GetNthFaction 2
    set fac4 to me.GetNthFaction 3
    set fac5 to me.GetNthFaction 4


    printC "Original Factions: F1 %n, F2 %n, F3 %n, F4 %n, F5 %n" fac1 fac2 fac3 fac4 fac5


     me.SetFactionRank fac1 -1
     me.SetFactionRank fac2 -1
     me.SetFactionRank fac3 -1
     me.SetFactionRank fac4 -1
     me.SetFactionRank fac5 -1




Link to comment

Actually, it seems actors identical to those who had the spell cast on seem to already be in no faction, so if I cast it on a bandit, the next bandit that is the same spawned due to a leveled list, will already be out of the faction, is there a way to have the desired effect only on the targeted actor and is there a way to revert the just now mentioned issue?

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...