Background for Starfield
Member of the Actor script
eventOnDifficultyChanged(intaOldDifficulty, intaNewDifficulty)

Description

Wiki Description

Event sent to the player when the game's difficulty is changed.

Documentation Comment

Event received when the player changes their difficulty
Type is as follows:
0 - Very Easy
1 - Easy
2 - Normal
3 - Hard
4 - Very Hard
5 - Survival


Caveats

CK Wiki - Notes

Difficulty settings are as follows:

  • 0 - Very Easy
  • 1 - Easy
  • 2 - Normal
  • 3 - Hard
  • 4 - Very Hard
  • 5 - Survival (no Hardcore) DEFUNCT
  • 6 - Survival w/ Hardcore

Parameters

  1. intaOldDifficulty

  2. intaNewDifficulty


Examples

Event OnDifficultyChanged(int aOldDifficulty, int aNewDifficulty)
  if (aOldDifficulty == 6) && (aNewDifficulty != 6)
    Debug.Trace("Player no longer wants hardcore mode...")
  endEvent

Auto-Generated Example

Scriptname MyCoolScript extends Actor

event OnDifficultyChanged(int aOldDifficulty, int aNewDifficulty)
    Debug.trace("Event received - OnDifficultyChanged: aOldDifficulty = " + aOldDifficulty + " aNewDifficulty = " + aNewDifficulty)
endEvent

Related Pages


Additional References

View this event’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.