Which calls throw and which return false

This is the full list of what the API gives you. Text in brackets at the end of a note is extra detail for experienced modders, and you can skip it on a first read.

ScreenFx whether the field of view override works

IsAvailable tells you whether the field of view override works. Every ScreenFx call returns false when it could not do its job, and throws only for a bad value.

public static class ScreenFx
{
    public static bool IsAvailable { get; }
}
Property Type What it means
IsAvailable bool false when the field of view override could not be set up.

Things to know

  • Every call returns true when it did its job and false when it could not. It returns false when the game part it needs is not there yet, for example on the main menu or while a level is loading. (The missing parts are CameraShake.instance, BlackCanvas.instance, BlackCanvas.fadeCanvasGroup and DeathMessage.instance.)
  • Shake, FadeToBlack and SetDeathMessage also return false while a save is loading or being written. FadeIn always runs, so the screen can clear during a save.

Limits

  • A bad value throws an ArgumentException. duration must be above 0, amount must not be negative, speed must be above 0, and text must not be null. Numbers must be real numbers. An owner must be a valid mod id, 1 to 64 letters, digits, dots, underscores or dashes (Mod.Id always is). Nothing else is thrown to you.
  • If the game itself fails, you get false and one line in the log. The call does not throw.