Skip to main content

CreateTargetOperation

A static class in Root.Township, Alta.Intelligence.

Static factory for the common TargetOperation scoring rules used by actions in code and by the scoring components on prefabs. Server only, like the decider.

Fields​

1 private and internal field
MemberWhat it is
private static Logger loggerNLog logger used by Fail.

Methods​

MemberWhat it is
static TargetOperation Chance(float chance, float success = 1, float failure = 0)Makes a Chance rule: a fresh dice roll each evaluation.
static TargetOperation Fail(string message)Logs the message as an error and returns FailTargetOperation.Instance, which always scores 0.
static TargetOperation Formula<T>(string name, Func<T, ITarget, float> formula)Makes a Formula<T> rule that runs your own function on the agent and target.
static TargetOperation Grounded(float groundedValue, float airValue)Makes a Grounded rule: one value when the creature's walker is grounded, another in the air.
static TargetOperation Lifetime(float minimum, float maximum)Makes a Lifetime rule: the creature's age in seconds mapped from minimum to maximum onto 0 to 1.
static TargetOperation RaycastGrounded(float groundedValue, float airValue, Vector3 raycastOriginOffset, float raycastDistance, LayerMask layerMask, RaycastGroundedOperationType operationType)Makes a RaycastGrounded rule that checks for ground with a ray or sphere from the creature's body.
static TargetOperation RVOBlocked(float unblocked, float blocked)Makes an RVOBlockedValue rule: one value when the creature's walker is blocked, another otherwise.
static TargetOperation SameTarget(float sameValue, float differentValue = 1)Makes a SameTarget rule: one value if the target is the creature's current target, another if not.
static TargetOperation Sense(SenseOld sense, float from0 = 0, float to1 = 1, bool isTarget = true)Makes a rule mapping a sense on the target (or the creature itself) from from0 to to1 onto 0 to 1. Accepts a Sense asset or a SenseOld value.
static TargetOperation Sense(Sense sense, float from0 = 0, float to1 = 1, bool isTarget = true)Makes a rule mapping a sense on the target (or the creature itself) from from0 to to1 onto 0 to 1. Accepts a Sense asset or a SenseOld value.
static TargetOperation Stat(StatDefinition statDefinition, float from, float to, bool isTargetStat, bool isRatio)Makes a StatValue rule that maps a stat on the creature or target onto 0 to 1.
static TargetOperation VelocityLimit(float maximimumVelocitySquared, float withinLimitValue, float outsideLimitValue)Makes a VelocityLimit rule comparing the creature's rigidbody speed to a squared limit.