World Activity System

v0.3

Component Reference

Complete API reference for all components and ScriptableObjects.

Overview

This page provides a complete reference for all components and ScriptableObjects in the World Activity System. Use this as your API documentation when building activities and events.

Note: All components integrate seamlessly with Game Creator 2 visual scripting. No C# coding required for basic usage.

WorldActivityManager

MonoBehaviourCentral singleton that manages all activities, events, and player state.

Inspector Properties

PropertyTypeDescription
Time Provider TypeTimeProviderTypeHow time is measured (GameTime, RealTime, CozyWeather, Custom)
Player TagstringTag used to identify player GameObject (default: "Player")
Use Camera FallbackboolUse Camera.main if no player tag found
Proximity Checks Per SecondintFrequency of proximity checks (default: 10)
Max Proximity Check DistancefloatMaximum distance to check for activities (default: 200)
Debug LoggingboolEnable console debug logs
Show Proximity GizmosboolDraw gizmos in Scene view

Public Methods

DiscoverActivity(WorldActivity activity, bool executeCallbacks)

Marks an activity as discovered. Optionally executes OnActivate callbacks.

CompleteActivity(WorldActivity activity, bool autoDiscover, bool executeCallbacks)

Marks an activity as completed. Can auto-discover if not yet discovered.

IsActivityDiscovered(WorldActivity activity) → bool

Returns true if activity has been discovered.

IsActivityCompleted(WorldActivity activity) → bool

Returns true if activity has been completed.

TriggerEvent(TemporalActivity event) → bool

Attempts to trigger an event. Returns true if successful.

EndEvent(TemporalActivity event)

Ends an active event immediately, executing completion callbacks.

IsEventActive(TemporalActivity event) → bool

Returns true if event is currently running.

SpatialActivity

ScriptableObjectDefines a discoverable encounter in the world with fixed location.

Create: Right-click in Project → Create → World Activity System → Spatial Activity

Properties

PropertyTypeDescription
Display NamestringName shown to players
DescriptionstringOptional description for UI/journals
IconSpriteVisual representation
CategoryActivityCategoryType of encounter (see categories below)
Requires DiscoveryboolMust be discovered before interacting
Is RepeatableboolCan be completed multiple times
Trigger ObjectGameObjectScene GameObject with SpatialActivityAnchor
PrerequisitesConditionListGC2 conditions required for discovery
On ActivateInstructionListGC2 instructions executed when discovered
On CompleteInstructionListGC2 instructions executed when completed
Show On MapboolDisplay on map once discovered
Map IconSpriteOptional different icon for map
Reveal RadiusfloatMap fog-of-war reveal distance

Activity Categories

Shrine
Dungeon
Landmark
FastTravel
EliteBoss
WorldBoss
Secret
Treasure
Collectible
NPC
Merchant
HazardZone
RestArea
Custom

TemporalActivity

ScriptableObjectDefines a time-based or conditional event that can be automated.

Create: Right-click in Project → Create → World Activity System → Temporal Activity

Properties

PropertyTypeDescription
Display NamestringName shown to players
DescriptionstringOptional description
IconSpriteVisual representation
Trigger TypeEventTriggerTypeWhen event triggers (see types below)
Conditional BehaviorConditionalBehaviorOneShot or Temporal (for Conditional type)
Event DurationfloatHow long event lasts (seconds)
Event PriorityfloatQueue priority (0.0-1.0, higher = first)
Cooldown SecondsfloatTime before re-trigger allowed
Is Global EventboolAffects entire world
Incompatible EventsList<TemporalActivity>Events that cant run together
Spawned EncountersList<GameObject>Anchors activated during event
Chained EventTemporalActivityEvent triggered when this ends
PrerequisitesConditionListGC2 conditions required
On ActivateInstructionListGC2 instructions when event starts
On CompleteInstructionListGC2 instructions when event ends
On Event EndInstructionListAdditional instructions on end

Event Trigger Types

Interval

Triggers at fixed time intervals (e.g., every 10 minutes).

Additional Properties: Interval (seconds), Start Delay, Max Occurrences

TimeOfDay

Triggers at specific times: Dawn, Noon, Dusk, or Midnight.

Additional Properties: Time of Day, Days Between, Max Occurrences

Conditional

Triggers when custom GC2 conditions are met.

Conditional Behavior: OneShot (triggers once, then disables) or Temporal (can trigger multiple times)

Manual

Only triggered via GC2 Instruction or code.

Use case: Story-driven events, boss fights, scripted sequences

EventScheduler

MonoBehaviourAutomated scheduling system for temporal events. Created automatically by WorldActivityManager.

PropertyTypeDescription
Scheduler EnabledboolEnable/disable automatic scheduling
Enable Event HistoryboolLog all event activity for debugging
Dawn TimefloatHour for dawn events (default: 6.0)
Noon TimefloatHour for noon events (default: 12.0)
Dusk TimefloatHour for dusk events (default: 18.0)
Midnight TimefloatHour for midnight events (default: 0.0)
Check IntervalfloatFrequency for conditional checks (default: 1.0s)
Debug LoggingboolEnable detailed scheduler logs

Performance: EventScheduler uses smart caching for conditional events, achieving 80-95% cache hit rate. See Debug Window → Performance tab.

SpatialActivityAnchor

MonoBehaviourScene component that links a SpatialActivity to a world position with trigger collider.

PropertyTypeDescription
ActivitySpatialActivityReference to SpatialActivity asset

Setup Requirements

  • Must have a Collider component (Sphere/Box/Capsule)
  • Collider must have Is Trigger checked
  • GameObject must be active in scene
  • Activity reference must be assigned

Custom Inspector Features

  • Shows linked activity name (read-only)
  • "Edit Activity Asset" button for quick access
  • Automatic validation warnings
  • Auto-fix buttons for common issues