ActionType_AiSettings - Ellpeck/TinyLifeExampleMod Wiki

Tiny Life

TinyLife.Actions.ActionType

ActionType.AiSettings Struct

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

public struct ActionType.AiSettings

Fields

ActionType.AiSettings.CanDoAtAnyPoint Field

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

System.Boolean

ActionType.AiSettings.CanDoRandomly Field

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

System.Boolean

ActionType.AiSettings.NeedsFreeActionSpot Field

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

System.Boolean

ActionType.AiSettings.PassivePriority Field

A function that returns the passive priority of this action type.
By default, the passive priority is 0, 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.

public Func<Person,float> PassivePriority;

Field Value

System.Func<Person,System.Single>

ActionType.AiSettings.SolvedNeeds Field

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.
Defaults to null.

public NeedType[] SolvedNeeds;

Field Value

NeedType[]