Table of Contents

Struct ActionType.AiSettings

Namespace
TinyLife.Actions
Assembly
Tiny Life.dll

A set of settings that ActionType.TypeSettings uses to determine how PersonAi should deal with this ActionType

public struct ActionType.AiSettings
Inherited Members
Extension Methods

Constructors

AiSettings()

Creates a new ActionType.AiSettings instance with default settings.

public AiSettings()

Fields

CanDoAtAnyPoint

A value that determines whether or not this action can be started randomly, at any point, by the AI. Whereas CanDoRandomly actions can only be started when the ActionQueue is empty, an action with this flag can always be started randomly. If this value is false, but SolvedNeeds is true, this action will still be started if the need set is low. Note that, for this value to have an effect, the PassivePriority needs to be greater than 0.

public bool CanDoAtAnyPoint

Field Value

bool

CanDoRandomly

A value that determines whether or not this action can be started randomly by the AI. A random action will only be started if the corresponding person's ActionQueue is empty. If this value is false, but SolvedNeeds is true, this action will still be started if the need set is low. Note that, for this value to have an effect, the PassivePriority needs to be greater than 0.

public bool CanDoRandomly

Field Value

bool

EnqueuePriority

Whether the action should be enqueued at the start of the action queue when the AI starts it, rather than at the end.

public bool EnqueuePriority

Field Value

bool

IgnoreAiDisabled

A value that determines whether this action can be started (based on CanDoRandomly and CanDoAtAnyPoint), even if the starting person's AI is currently disabled.

public bool IgnoreAiDisabled

Field Value

bool

NeedsFreeActionSpot

A value that determines whether this action needs to find a free ActionSpot on the object that it is invoked on. This value only has an effect if this action can be executed on any Furniture. This value defaults to true.

public bool NeedsFreeActionSpot

Field Value

bool

PassivePriority

A function that returns the passive priority of this action type. By default, the passive priority is unset, meaning this action will never be executed randomly. The higher the passive priority, the more likely it is that this action will be invoked randomly by a person. This function is usually only queried through GetPassiveActionPriority(ActionType), as personality modifiers and the like get applied there. The passive priority only has an effect if SolvedNeeds, CanDoRandomly, or CanDoAtAnyPoint is true, or if a person's LotEmployment contains this action.

public Func<Person, float> PassivePriority

Field Value

Func<Person, float>

SolvedNeeds

The need that this action solves when invoked. The action doesn't need to actually solve this need in its implementation, but instead, this value is used to determine which actions to choose from if a person's needs are low. Note that, for this value to have an effect, the PassivePriority needs to be greater than 0. Defaults to null.

public NeedType[] SolvedNeeds

Field Value

NeedType[]