Background for Starfield
Member of the Actor script
boolfunctionStartCombat(ObjectReferenceakTarget, boolabPreferredTarget=false)Native

Description

Wiki Description

Attempts to get this actor to initiate combat with the target.

Documentation Comment

Starts combat with the target reference - returns true if combat was started
abPreferredTarget - OPTIONAL (Def=false) True to set the target as the actor's preferred target


Caveats

CK Wiki - Notes

  • This function will fail and throw an error to the log when called on an actor that has come out of bleedout but has not

yet reached full health. At that point you must wait a few seconds before calling this function.


Parameters

ObjectReferenceakTarget

CK Wiki Description

Who to attempt to initiate combat with.

boolabPreferredTarget=false

CK Wiki Description

If true, set akTarget as the actor's preferred target

  • Default:false

Examples

; Have this actor initiate combat with the player
StartCombat(Game.GetPlayer())
; Get two of our aliases to fight each other
Vader.StartCombat(Luke)

Auto-Generated Example

ObjectReference myObjectReference__akTarget
bool myBool__abPreferredTarget

bool returnedValue = myActor__toCallFunctionOn.StartCombat(myObjectReference__akTarget, myBool__abPreferredTarget)

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.