Skip to content

Class

AgeService

Generated GDScript class reference for CalendarTime.AgeService.

Status
Current
Version
v2.1.1
Source updated
2026-08-09
Generated on
2026-09-26

AgeService: a Resource that advances an AgeState as game time progresses. Bound to a GameClock; the scene-tree AgeComponent reads its progress. Owned by the clock (clock.age_service); one service per clock. Drive modes (see AgeSettings.UpdateTime):

  • GAME_TIME_ELAPSED: advance per game_seconds_advanced, the sum of game seconds the clock moved.
  • DATE_CHANGED: advance once per crossed day boundary by the full day's game seconds, so day-aligned ageing doesn't drift on sub-day frames.
  • REAL_TIME_ELAPSED: not supported on a Resource service (no per-frame driver); configuring it fails validation and the service stays idle.

Source: addons/calendar_time/ageing/age_service.gd

Syntax

class AgeService extends Resource

Members

NameKindSummary
service_idPropertyUnique service identifier, serialized via `Keys.SERVICE_ID` and used to route debug output. The setter migrates the registered AgeState to the new key. Set before handing the service to consumers so two services don't collide on one clock's registry.
starting_agePropertyStarting age preset for newly created states.
age_settingsPropertyTiming and unit settings for how the service ages.
clockPropertyThe clock whose elapsed time and date changes drive ageing.
old_clockProperty
old_stateProperty
new_registryProperty
age_state_idPropertyKey under which this service's age state is serialized.
progress_ageMethod
seconds_to_game_unitsMethod
validateMethod
to_dictMethod
from_dictMethod
SCHEMA_VERSIONFieldOn-disk key schema version. v2 used "id"; v3 uses "service_id".
SERVICE_IDFieldSchema v3 key. Written by to_dict().
AGE_STATE_IDFieldAge state identifier serialized under this key.
LEGACY_IDFieldLegacy v1/v2 key, auto-migrated to SERVICE_ID (MIGRATION.md §5).
get_keysMethod