Class PersonAi
This class holds the artificial intelligence implementation for a PersonLike. The AI automatically selects actions based on their ActionType.AiSettings.
public class PersonAi
- Inheritance
-
PersonAi
- Inherited Members
- Extension Methods
Methods
StartAutomatically(PersonLike, ActionType, bool, bool, params ActionArgument[])
Causes a person to start the given action automatically with the same behavior that it would have if started by the PersonAi
public static bool StartAutomatically(PersonLike person, ActionType type, bool priority = false, bool force = false, params ActionArgument[] chosenArguments)
Parameters
person
PersonLikeThe person who should start the action
type
ActionTypeThe action to start
priority
boolWhether to add this action to the start of the action queue rather than the end. This is passed to EnqueueAction<T>(ActionType, ActionInfo, bool, bool, bool, params ActionArgument[]).
force
boolWhether to force-start the action. This is passed to EnqueueAction<T>(ActionType, ActionInfo, bool, bool, bool, params ActionArgument[]).
chosenArguments
ActionArgument[]The set of ActionArgument values to pass to EnqueueAction<T>(ActionType, ActionInfo, bool, bool, bool, params ActionArgument[]). If this is empty or null, arguments will automatically be generated randomly.
Returns
- bool
Whether the action was successfully started