CalculateEncounterLevel - ObjectReference

From the Fallout4 CreationKit Wiki
Jump to navigation Jump to search

Member of: ObjectReference Script

Calculates the reference's encounter level, based on the player's level, the area's level, and the passed-in difficulty.

Syntax[edit | edit source]

int Function CalculateEncounterLevel(int aiDifficulty = 4) native

Parameters[edit | edit source]

  • aiDifficulty: The difficulty to adjust the counter level for
    • Default: 4 (None)
    • The following values are acceptable:
      • 0: Easy
      • 1: Medium
      • 2: Hard
      • 3: Very Hard
      • 4: None (default)

Return Value[edit | edit source]

The level of the reference, taking into account the player's level, area's level, and difficulty

Examples[edit | edit source]

; Figure out what level the bandit should be (using his default encounter level)
int calculatedLevel = Bandit.CalculateEncounterLevel()


; Figure out what level the bandit should be if he was 'hard'
int calculatedLevel = Bandit.CalculateEncounterLevel(2)

See Also[edit | edit source]