Talk:AddToFaction - Actor

Active discussions
Revision as of 06:14, 5 November 2016 by imported>Lisselli (Added a function for adding an actor to many factions and optionally changing those faction's reaction.)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Does this make the player friendly with a normally hostile faction if added to it?

--PsiSoldier 09:32, 23 April 2012 (EDT)

Unforunately, it does not. You need to change the factions' reaction to friendly. --Lisselli (talk)

AddToFactionsEdit

This function is for adding the player or an actor to many factions and optionally changing that faction's reaction.

Function AddToFactions(Actor akActor, Faction akFaction, Faction[] akFactions, Bool abSetReactions=False, Int aiNewValue=0)

	; Adding the actor to many factions first.
	Int Index = akFactions.Length
	While (Index)
		Index -= 1
		akActor.AddToFaction(akFactions[Index])
	EndWhile
	
	; Setting the faction reactions to be neutral, an enemy, or friendly with the calling faction. (0,1,2,3)
	; Note: Adding the player to ,for example, a Wolf Faction will not make them friends. You must change the Wolf faction's faction reaction to 3.
	if !abSetReactions	
		While Index
			Index += 1
			akFaction.SetReaction(akFactions[Index], aiNewValue)
		EndWhile
	endif


EndFunction
  1. Advantages
    1. Don't need to make multiple AddToFaction calls, or make a lot of Faction properties.
    2. Can choose rather to change reactions or not.
  2. Disadvantages
    1. Cannot be used to remove the actor from all factions at once(yet).
Return to "AddToFaction - Actor" page.