Skip to content

TimeOfDayCondition ​

Inherits: EntityCondition < Condition < Resource

Is it between two hours of the game day? The condition of a schedule that is for a time of day: the guard walks his round from 8 to 18, goes home from 18 to 22 and sleeps from 22 to 8. The hours are the game clock (8.5 = half past eight); a range that goes past midnight (22 to 8) works; the same hour twice is all day. It does not look at the entity: the entity target is not used.

Properties ​

floatstart_hour8.0
floatend_hour18.0

Methods ​

boolcontains_hour( start: float, end: float, hour: float ) static
Stringclock_text( hour: float ) static
boolevaluate( _argument: Variant = null )
Stringget_description()
Stringget_function_description()
Stringget_expected_argument_type()

Property descriptions ​

float start_hour = 8.0 ​

The hour the time starts (0 to 24; 8.5 = 08:30)

float end_hour = 18.0 ​

The hour the time ends (0 to 24). Before this hour is over the condition is met; at this hour it is not

Method descriptions ​

bool contains_hour( start: float, end: float, hour: float ) ​

Is the hour inside the range? A range past midnight (start after end) is the two stretches around it; start equal to end is all day

String clock_text( hour: float ) ​

The hour as clock text: 8.5 -> "08:30"

bool evaluate( _argument: Variant = null ) ​

Is the game clock inside the range now?

String get_description() ​

A short text about the condition

String get_function_description() ​

The sentence the editor shows for the condition, with {placeholders} for its values

String get_expected_argument_type() ​

The kind of thing the condition is checked against