Remove NPC from faction... Think I almost have the script.

Post » Wed Feb 12, 2014 5:45 am

So the final scripting part of updating my mod, is about removing NPCs from the potentialfollowerfaction/currentfollowerfaction after the player drinks a specific potion, the NPCs in question, are optional companions for the player, but if the player drinks this potion, they consider it to be an act of betrayal and turn hostile towards the player. Seeing as how being in those two factions prevents hostility towards the player, it is necessary to make some script that removes the NPCs from those said factions.

I'm 99% certain that the problem is somewhere here in this script "game.GetPlayer().RemoveFromFaction", probably at least the Getplayer bit but maybe more, I tried to replace it with (Actor akActor), and similar things, but it doesn't work... Thing is I know how to make this work for the player, but not NPCs.

The script goes like this...

Scriptname RemoveFromFaction extends activemagiceffect  Faction Property PotentialFollowerFaction  Auto  Event OnEffectStart(Actor Target, Actor Caster)game.GetPlayer().RemoveFromFaction (PotentialFollowerFaction)EndEvent

I've tried to make variations of this replacing GetPlayer with something that instead, removes a chosen NPC from a faction, but I must be making some very simple mistake I don't realize or something.

If anyone knows how to solve this dilemma thanks in advance.

User avatar
GEo LIme
 
Posts: 3304
Joined: Wed Oct 03, 2007 7:18 pm

Return to V - Skyrim