Skip to content

ContextualConditionUserFactCount

16.11

Inheritance 1 ancestor · 62 siblings

Class Documentation

Edit documentation

A condition that counts recent user facts of the unit and compares the count with Count.

A user fact is a hash that a ContextualActionUserFactAction records on the unit, together with the game time and, optionally, a unit. Each unit keeps its last 128 facts. A new fact replaces the oldest one.

The condition walks the facts from the newest to the oldest. It stops at the first fact that is older than TimeWindow seconds. It counts the facts whose hash equals UserFact and that pass the unit filter. Then it tests count <op> Count.

The unit filter uses CharacterType. A fact passes the filter when it was recorded without a unit, or when its unit is the unit that CharacterType selects. If CharacterType selects no unit, every fact passes the filter.

Properties

CharacterType

Option<U8> = null
Edit documentation

The unit of the filter, chosen with the unit selector table on ICharacterSubcondition. A fact that was recorded with a different unit is not counted.

Count

U32 = 1
Edit documentation

The number that the count of matching facts is compared with.

TimeWindow

F32 = 8
Edit documentation

Age limit, in seconds. Facts recorded more than TimeWindow seconds ago are not counted.

UserFact

Hash = "0x0"
Edit documentation

The fact hash to count: the FactName of the action that records the fact.