Background for Starfield
Member of the Actor script
voidfunctionSetPlayerTeammate(boolabTeammate=true, boolabCanDoFavor=true, boolabGivePlayerXP=false)Native

Description

Wiki Description

Flags this actor as a teammate of the player or not.

Documentation Comment

Sets or clears this actor as a teammate of the player
abCanDoFavor - OPTIONAL default is true the teammate can do favors
abGivePlayerXP - OPTIONAL default is false the teammate will give the player XP for kills and unlocks


Caveats

CK Wiki - Notes

Once an NPC becomes a teammate, the following becomes true:

  • NPC will sneak if the player sneaks, stop sneaking if the player stops sneaking.
  • NPC will draw a weapon if the player draws a weapon. (they must have the TeammateReadyWeapon_DO keyword on them to do this)
  • NPC will equip their best armor (instead of wearing their default Outfit)
  • Crimes committed by the NPC are considered crimes the player has committed.
  • (Optional) NPC can be issued commands.

Parameters

  1. boolabTeammate=true

    CK Wiki Description

    Whether to set or clear the actor's teammate status.

    • Default:True
  2. boolabCanDoFavor=true

    CK Wiki Description

    Whether to set or clear the actor's ability to do favors when he is the players teammate.

    • Default:True
  3. boolabGivePlayerXP=false

    CK Wiki Description

    Set this to true if you want this actor to give the player some experience points when another actor is killed or he is commanded to unlock something.

    • Default:False

Examples

; Set Buddy as a teammate
Buddy.SetPlayerTeammate()
; Clear buddy's teammate status
Buddy.SetPlayerTeammate(false)

Auto-Generated Example

bool myBool__abTeammate
bool myBool__abCanDoFavor
bool myBool__abGivePlayerXP

myActor__toCallFunctionOn.SetPlayerTeammate(myBool__abTeammate, myBool__abCanDoFavor, myBool__abGivePlayerXP)

Related Pages


Additional References

View this function’s page on the Fallout 4 Creation Kit Wiki

Some data provided by the Fallout 4 Creation Kit Wiki. Licensed under the Creative Commons Attribution-Share Alike 4.0 license.