Script compiled but isn't functioning.

Post » Thu Feb 13, 2014 2:40 am

So... I FINALLY managed to make a script that in theory, would remove an NPC from a faction... This time it EVEN compiled unlike my last failed attempt. I had to alter it more than I thought.

Scriptname AlectraRemoveFollower1 extends ReferenceAlias    Faction Property PotentialFollowerFaction AutoActor Property NewProperty  Auto  Function SomeFunction()    (GetReference() as Actor).RemoveFromFaction(PotentialFollowerFaction)endFunction

I simply went to properties, the faction was auto filled and seemingly no problem, and then I clicked "add property" made it type Actor, and then selected the potentialfollowerfaction/currentfollowerfaction NPCs in question, but even after drinking the potion that sets off this script, the NPCs still remain friendly, and still remain optional companions, when they are intended to stop being companions, and attack the player for drinking the potion.

Here is a screenshot as well if it helps. http://i.imgur.com/0ieujxn.png

Can someone please help me with this scripting mystery?

Edit: made a slightly updated version of the script still doesn't work.

User avatar
Amy Masters
 
Posts: 3277
Joined: Thu Jun 22, 2006 10:26 am

Post » Thu Feb 13, 2014 5:51 am

Nothing is calling SomeFunction.

I can't think of an event where this could be applicable, so I'll use a custom function:

Actor property PlayerRef autoActor property Follower autoFaction property CurrentFollowerFaction autoFunction ForceCombatOnPlayer()    if Follower.IsInFaction(CurrentFollowerFaction)            Follower.RemoveFromFaction(CurrentFollowerFaction)            Follower.StartCombat(PlayerRef)    endifEndFunction

You don't need the 'function'. Just the statements. But this can be called in an event by simply placing ForceCombatOnPlayer() inside of it.

Had to do a ton of editing there. >_>

User avatar
Katharine Newton
 
Posts: 3318
Joined: Tue Jun 13, 2006 12:33 pm


Return to V - Skyrim