TryToAddToFaction - ReferenceAlias

Member of: ReferenceAlias Script

This is a convenient way to add an actor in an alias to a faction without calling GetActorReference() on it. It's mostly useful in cases where you have lots of aliases that may or may not be filled and you want to call AddToFaction() on them without having to test for a reference being present first.

SyntaxEdit

bool Function TryToAddToFaction(Faction FactionToAddTo)
	Actor ActorRef = GetActorReference()
	if ActorRef
		ActorRef.AddToFaction(FactionToAddTo)
		Return True
	EndIf
	Return False
EndFunction

ParametersEdit

  • FactionToAddTo: The faction to add the actor to

Return ValueEdit

True if the actor was added to the faction, false if no actor existed to be added.

ExamplesEdit

; Try to add the boss to the bandit faction
BossAlias.TryToAddToFaction(BanditFaction)

See AlsoEdit