Jump to content

Get reference to current companion


SKKmods

Recommended Posts

I need to get the Object or Actor reference(s) for player's current companion(s).

 

The event OnCompanionDismiss is documented but there doesn't seem to be a corresponding add event to register for or GetCompanion query function.

 

Tried GetPlayerFollowers, but stuck how to test a follower is a current companion ...

Link to comment
Share on other sites

There are also a couple of factions that you can test against: "CurrentCompanionFaction" and "HasBeenCompanionFaction". I tend to use these in Conditional tests to check if an NPC is a follower or not (using the GetInFaction condition), or in scripts, using the IsInFaction() function.

Link to comment
Share on other sites

Lovely thanks as Game.GetPlayerFollowers( ) sometimes returns ex companions that are in the same location using .IsInFaction(pCurrentCompanionFaction) to filter is perfect.

 

As a list of companion ObjectReferences doesn't seem to be published, and the naming convention is inconsistent, having dug 'em out of their starting worldcells:

 

PiperRef
DeaconRef
CaitRef
Codsworth1Ref
CurieRef
BoSPaladinDanseRef
HancockREF
CompMacCreadyRef
NickValentineREF
PrestonGarveyRef
CompanionStrongRef
CompanionX6_88Ref
Edited by SKK50
Link to comment
Share on other sites

  • 3 months later...

Old, but gold I finally found the current active companion Ref in the basegame Followers quest Companion alias ... for search posterity:

 

Alias_FollowersQuest_Companion.GetReference()

Link to comment
Share on other sites

Old, but gold I finally found the current active companion Ref in the basegame Followers quest Companion alias ... for search posterity:

 

Alias_FollowersQuest_Companion.GetReference()

 

While true and good, it doesn't find Dogmeat. It was unclear if the OP cares about Dogmeat or not. But I thought it should be mentioned. If using the alias method to find Dogmeat you would use Alias_FollowersQuest_DogmeatCompanion.GetReference().

 

Also if the player is using a mod to support multiple companions it won't work right. Depending how those mods are made they may have their own quest with a Ref Collection, or they may use some array elsewhere.

Link to comment
Share on other sites

 

Old, but gold I finally found the current active companion Ref in the basegame Followers quest Companion alias ... for search posterity:

 

Alias_FollowersQuest_Companion.GetReference()

 

While true and good, it doesn't find Dogmeat. It was unclear if the OP cares about Dogmeat or not. But I thought it should be mentioned. If using the alias method to find Dogmeat you would use Alias_FollowersQuest_DogmeatCompanion.GetReference().

 

Also if the player is using a mod to support multiple companions it won't work right. Depending how those mods are made they may have their own quest with a Ref Collection, or they may use some array elsewhere.

 

I'm pretty sure thats because bethesda was planning to allow additional companion together with dogmeat initially.

Edited by shavkacagarikia
Link to comment
Share on other sites

  • Recently Browsing   0 members

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