Jump to content

A bit of trouble trying to make a script to make the player become allied with another faction


szaumoor

Recommended Posts

It's the first time I write a script. This script is inside a Magic Effect, which then is cast by a Spell. I tried to make it so wolves become allies towards the player. But this does not work, at all. I can't find any solutions to this. I just followed the CreationKit website mini tutorial, but it didn't work, what gives? thanks

 

Essentially the spell makes nearby wolves friendly and helpful in combat by using the CommandAnimal script that Bosmer have. I added another effect to hopefully make it so the rest of wolves are friendly towards the player but it doesn't work. I filled the properties and checked that the player does indeed become part of the wolf faction. But any wolves I spawn are hostile.

Faction Property WolfFaction Auto
Faction Property PlayerFaction Auto
Actor Property PlayerRef Auto

int OriginalReaction

Event OnEffectStart(Actor akTarget, Actor akCaster)
    OriginalReaction = PlayerFaction.GetReaction(WolfFaction)    
    PlayerRef.AddToFaction(WolfFaction)
    PlayerFaction.SetReaction(WolfFaction, 3)
EndEvent

Event OnEffectFinish(Actor akTarget, Actor akCaster)
    PlayerFaction.SetReaction(WolfFaction, OriginalReaction)    
    PlayerRef.RemoveFromFaction(WolfFaction)
EndEvent
Edited by szaumoor
Link to comment
Share on other sites

I would go with SetRank()

 

Setting rank will add to the faction automatically if they are not already in it

 

As for hostilities, theres a faction called DunPrisoner, that if you add player to it, most enemies are not hostile. I might suggest creating a faction doing something similar but apply it only to the enemies you want to be not hostile. Just another route to consider. I have never encountered a need to modify reactions via script

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...