Jump to content

Amulet/Faction Help


MadTod

Recommended Posts

I would like to make an amulet that - when equipped - would add the player to a faction and - when unequipped - would remove the player from said faction.

 

I know enough to know that this probably requires a script but I know not what that script is.

 

Any help would be much appreciated, thanks.

Link to comment
Share on other sites

I would like to make an amulet that - when equipped - would add the player to a faction and - when unequipped - would remove the player from said faction.

 

 

It seems there is no default script that could be used for that. So you need to make your own, like this:

 

Scriptname YourScriptName extends ObjectReference

Faction Property SomeFaction auto

Event OnEquipped(Actor akActor)
	if akActor == Game.GetPlayer()
		akActor.AddToFaction(SomeFaction)
	endif
EndEvent
 
Event OnUnequipped(Actor akActor)
	if akActor == Game.GetPlayer()
		akActor.RemoveFromFaction(SomeFaction)
	endif
EndEvent

To make it actually work, the property value needs to be filled with the faction you want to add/remove.

Edited by Ghaunadaur
Link to comment
Share on other sites

The script isn't working, the faction in question is KynesPeaceFaction, I'm trying to make an amulet that while equipped will make animal not attack me.

 

EDIT: I've sorted it now, I had accidently put a comma in (Actor, akActor) instead of (Actor akActor)

 

The script works but there's no effect in-game, animal will still attack and or flee from me.

Edited by TanisDuncan
Link to comment
Share on other sites

The script isn't working, the faction in question is KynesPeaceFaction, I'm trying to make an amulet that while equipped will make animal not attack me.

 

EDIT: I've sorted it now, I had accidently put a comma in (Actor, akActor) instead of (Actor akActor)

 

The script works but there's no effect in-game, animal will still attack and or flee from me.

Just so we know, did you remember to assign the factions in the properties window?

Link to comment
Share on other sites

Just so we know, did you remember to assign the factions in the properties window?

 

Yes.

Link to comment
Share on other sites

The script isn't working, the faction in question is KynesPeaceFaction, I'm trying to make an amulet that while equipped will make animal not attack me.

 

Adding the player to the faction is possibly not enough. If you look at the Kyne's Peace shout, it has three magic effects and one of it is scripted. I guess you would need to recreate those magic effects as constant effects and attach them to an enchantment. But that was not your initial question, maybe start another thread for this.

Link to comment
Share on other sites

Just so we know, did you remember to assign the factions in the properties window?

 

I just double checked the property and it would seem that it did not save it assigned for some reason, so I just did it again and it works fine now, thanks.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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