Class StoryGoalHandler
A handler class for interacting with all of the major goal systems in Subnautica, which are essential for the's game progression.
Allows for important game events to be triggered after a specified action is completed.
public static class StoryGoalHandler
- Inheritance
-
StoryGoalHandler
- Inherited Members
Methods
RegisterBiomeGoal(string, GoalType, string, float, float)
public static BiomeGoal RegisterBiomeGoal(string key, GoalType goalType, string biomeName, float minStayDuration, float delay = 0)
Parameters
key
string- The unique identifier, required for all types of StoryGoals.
goalType
GoalType- If assigned a value other than 'Story', this will determine the automatic response to being triggered. Can add a PDA log, Radio message or Databank entry.
biomeName
string- The biome that must be entered to trigger this goal.
minStayDuration
float- The minimum amount of time the player must stay in the given biome.
delay
float- StoryGoal listeners will not be notified until this many seconds after the goal is completed.
Returns
- BiomeGoal
- The registered Story.BiomeGoal.
RegisterCompoundGoal(string, GoalType, float, params string[])
public static CompoundGoal RegisterCompoundGoal(string key, GoalType goalType, float delay, params string[] requiredGoals)
Parameters
key
string- The unique identifier, required for all types of StoryGoals.
goalType
GoalType- If assigned a value other than 'Story', this will determine the automatic response to being triggered. Can add a PDA log, Radio message or Databank entry.
delay
float- StoryGoal listeners will not be notified until this many seconds after the goal is completed.
requiredGoals
string[]- The list of all goals that must be completed before this goal is marked as complete.
Returns
- CompoundGoal
- The registered Story.CompoundGoal.
RegisterCustomEvent(Action<string>)
public static void RegisterCustomEvent(Action<string> customEventCallback)
Parameters
customEventCallback
Action<string>- The method that is called when any goal is completed. The name of the goal will be passed as a parameter.
RegisterCustomEvent(string, Action)
public static void RegisterCustomEvent(string key, Action customEventCallback)
Parameters
key
string- The key of the goal that triggers the
customEventCallback
. customEventCallback
Action- The method that is called when the associated goal is completed.
RegisterItemGoal(string, GoalType, TechType, float)
Registers a goal that is completed when an object with the given TechType is picked up, equipped, or crafted through the Mobile Vehicle Bay.
Important: This method can be called as many times as needed to add different goals to the same TechType.
public static ItemGoal RegisterItemGoal(string key, GoalType goalType, TechType techType, float delay = 0)
Parameters
key
string- The unique identifier, required for all types of StoryGoals.
goalType
GoalType- If assigned a value other than 'Story', this will determine the automatic response to being triggered. Can add a PDA log, Radio message or Databank entry.
techType
TechType- The TechType that causes this goal to trigger, when picked up, equipped or crafted through the Mobile Vehicle Bay.
delay
float- StoryGoal listeners will not be notified until this many seconds after the goal is completed.
Returns
- ItemGoal
- The registered Story.ItemGoal.
RegisterLocationGoal(string, GoalType, Vector3, float, float, float)
public static LocationGoal RegisterLocationGoal(string key, GoalType goalType, Vector3 position, float range, float minStayDuration, float delay = 0)
Parameters
key
string- The unique identifier, required for all types of StoryGoals.
goalType
GoalType- If assigned a value other than 'Story', this will determine the automatic response to being triggered. Can add a PDA log, Radio message or Databank entry.
position
Vector3- The center of the sphere that must be occupied.
range
float- The radius of the sphere that must be occupied.
minStayDuration
float- The minimum amount of time the player must stay for this goal to be completed.
delay
float- StoryGoal listeners will not be notified until this many seconds after the goal is completed.
Returns
- LocationGoal
- The registered Story.LocationGoal.
RegisterOnGoalUnlockData(string, UnlockBlueprintData[], UnlockSignalData[], UnlockItemData[], Id[])
Registers a new Story.OnGoalUnlock object for an existing goal. Handles complex actions that occur with the goal's completion.
Important: Since these are stored in a dictionary, only oneStory.OnGoalUnlock object can be added for each specific goal key. Therefore, be careful when adding unlock data to base-game features.
public static void RegisterOnGoalUnlockData(string goal, UnlockBlueprintData[] blueprints = null, UnlockSignalData[] signals = null, UnlockItemData[] items = null, GameAchievements.Id[] achievements = null)
Parameters
goal
string- The goal that is associated with this action.
blueprints
UnlockBlueprintData[]- Array of blueprints that are unlocked alongside the given goal. The class has no constructor, so make sure you assign every field properly.
signals
UnlockSignalData[]- Array of signals that are unlocked alongside the given goal. The class has no constructor, so make sure you assign every field properly.
items
UnlockItemData[]- Array of items that are unlocked alongside the given goal. The class has no constructor, so make sure you assign every field properly.
achievements
Id[]- Array of achievements that are unlocked alongside the given goal.
UnregisterCustomEvent(Action<string>)
public static void UnregisterCustomEvent(Action<string> customEventCallback)
Parameters
UnregisterCustomEvent(string, Action)
public static void UnregisterCustomEvent(string key, Action customEventCallback)