Difference between revisions of "AddToFaction - Actor"

528 bytes removed ,  05:47, 5 November 2016
m
→‎Examples: Removed example and moving it to the talk page instead.
imported>Lisselli
(→‎Examples: Added a nice little example code for changing reactions to multiple factions using an array.)
imported>Lisselli
m (→‎Examples: Removed example and moving it to the talk page instead.)
Line 31: Line 31:
</source>
</source>
<br>
<br>
<source lang="papyrus">
Faction property PlayerFaction auto
Faction[] property EnemyFactions auto
; BanditFaction, CreatureFaction, FalmerFaction, as examples in the array.
Function SetFactionReactions(Faction akFaction, Faction[] akFactionReactionToChange, Int iReaction=0)
Int iIndex = akFactionReactionToChange.Length
While iIndex
  iIndex -= 1
  akFaction.SetReaction(akFactionReactionToChange[iIndex], iReaction)
EndWhile
EndFunction
; Use this like so:
SetFactionReactions(PlayerFaction, EnemyFactions, 3)
</source>


== Notes ==
== Notes ==
Anonymous user