Companion System

v1.2.0

GC2 Integration

Instructions, Conditions, Events, and Persistence for GC2 visual scripting

All CPS operations are accessible through Game Creator 2's visual scripting system. Instructions, Conditions, and Events appear under the Companion System category in the GC2 node picker. No code required.

Node count: 41 Instructions / 37 Conditions / 21 Events / 1 Memory component — 100 total GC2 nodes. 93 of the 100 need only GC2 core + the Characters module; the remaining 7 sit behind the optional Inventory Bridge (2 Conditions) and Needs Bridge (1 Instruction + 4 Conditions/Events) — see the Mount, Inventory Bridge, and Needs Bridge sections below.
Upgrading from 1.1.0? In 1.1.0, 42 of these nodes — the whole Ability, Vitals, Target and Trait groups (20 Instructions, 14 Conditions, 8 Events), plus the CompanionAbility Instructions field — were excluded at compile time and never appeared in the node pickers. They are all present from 1.2.0 onwards. Nothing you built in 1.1.0 changes; the previously-missing nodes and field simply become available.

Instructions

Single Companion

InstructionDescriptionParameters
Summon CompanionSpawn a companion from a CompanionDefinitionDefinition, Position (optional), Owner
Recall CompanionRemove a companion from the sceneTarget Companion, VFX Delay (optional)
Companion WaitTransition companion to the Waiting stateTarget Companion
Companion FollowReturn companion to the Following stateTarget Companion
Issue CommandExecute a command on a specific companionTarget Companion, Command (SO reference)
Complete CommandMark the current command as complete (call from within command trigger)Target Companion
Change Companion OwnerReassign the companion to follow a different ownerTarget Companion, New Owner
Teleport Companion to OwnerInstantly move companion to owner positionTarget Companion
Store CompanionMove companion to persistent storageTarget Companion
Retrieve From StorageSpawn a stored companion back into the sceneDefinition, Position, Owner
Swap CompanionStores one active companion and retrieves a stored one in its place, in a single node. Stores before retrieving, so it works even at Max Active Companions.Stored To Activate, Active To Store, Swap In Place (default on)
Recruit Character As CompanionTurns a Character already in the scene into a managed companion — nothing is spawned, the Definition's Prefab field is ignoredCharacter, Definition, Owner
Dismiss CompanionRemoves a companion from the party but leaves its GameObject in the scene with its bond intact (unlike Recall, which destroys it)Companion, Destroy GameObject (default off)
Toggle Path VisualizerShow or hide the debug path gizmo for a companionTarget Companion, Enabled

Group Commands

Group instructions operate on all active companions simultaneously.

InstructionDescriptionParameters
Group Set StateSet all active companions to the same stateState (Following/Waiting/Idle)
Group Send CommandSend a command to all companions — companions that don't support it are skippedCommand (SO reference)
Group Set FormationChange formation type for all companionsFormation (Line / V-Shape / Circle)
Recall All CompanionsRecall every active companion simultaneously—
Naming Convention: CPS instructions are prefixed with the companion context to avoid confusion with GC2's native instructions. For example, "Companion Follow" is distinct from GC2's built-in follow actions.

Conditions

Core conditions cover party membership, companion state, proximity, and commands. System-specific conditions (Vitals, Abilities, Traits, Targeting, Bonding) are in their own sections below.

NameDescription
Has Active CompanionTrue if at least one companion is currently active in the scene
Is Companion ActiveTrue if a specific CompanionDefinition is currently summoned
Active Companion CountCompare the number of active companions against a value (supports >, <, >=, <=, ==)
Can Summon MoreTrue if the active companion count is below the configured max
Storage ContainsTrue if a specific CompanionDefinition is in persistent storage
Companion In StateTrue if a specific companion is in a given state (Following/Waiting/Idle/Commanded)
Any Companion In StateTrue if any active companion matches the specified state
Is Companion IdleTrue if companion state is Idle
Is Companion MovingTrue if companion motor reports active movement
Is Visiting POITrue if companion is currently navigating to an interest point
Companion In RangeTrue if companion is within a given distance of its owner
Proximity StateTrue if companion proximity matches Beside / Near / Far (maps to FollowProfile radius tiers)
Is Owner StationaryTrue if the owner has not moved for the configured idle threshold
Has Active CommandTrue if companion is currently executing a command
Character Is CompanionTrue if this GameObject is currently an active companion — summoned or recruited. Goes false again after Dismiss Companion
Can Recruit CharacterTrue if Recruit Character As Companion would succeed right now — use it to grey out a dialogue choice

Events

Core companion lifecycle events. Use these to drive dialogue, UI updates, VFX, and game logic. System-specific events (Vitals, Abilities, etc.) are in their own sections below.

NameDescription
On Companion SummonedFires when a companion is summoned — optionally filter by Definition
On Companion RecalledFires when a companion is recalled — optionally filter by Definition
On Companion StoredFires when a companion is moved to storage
On Command ReceivedFires when a companion receives an Issue Command instruction — filter by Command SO
On Command CompletedFires when Complete Command is called — filter by Command SO to distinguish commands
On State ChangedFires when any companion transitions state — optionally filter by companion or target state
On Companion StuckFires when a companion's stuck detection triggers
On Companion Stuck RecoveredFires when a companion successfully recovers from a stuck state
On Proximity ChangedFires when a companion crosses a proximity tier boundary (Beside → Near → Far) — AnyState flag fires on all transitions
Inspector Events: CompanionBrain also exposes UnityEvents in the Inspector (Events foldout) for per-companion event wiring without visual scripting.

Bonding Nodes

Bonding nodes let you read and modify the relationship between owner and companion. Bond grows passively via proximity and actively via commands, POI visits, and these instructions. The four tiers — Stranger → Familiar → Loyal → Bonded — gate abilities, traits, reactions, and dialogue.

On Bond Tier Changed is the key hook for progression systems: play a cutscene, unlock a new ability slot, or write a journal entry when the player's companion reaches Bonded.
Instructions
InstructionDescriptionParameters
Modify BondAdd or subtract bond points from a companionTarget Companion, Amount (positive = add, negative = remove)
Set Bond LevelSet the companion's bond to an exact valueTarget Companion, Value
Conditions
NameDescription
Bond TierTrue if the companion's bond tier is at or above the specified threshold (Stranger / Familiar / Loyal / Bonded)
Compare Bond LevelCompare the companion's bond level against a value using >, <, >=, <= operators
Events
NameDescription
On Bond Tier ChangedFires when a companion advances to a new bond tier — use this to unlock dialogue, abilities, or cutscenes

Vitals Nodes

Vitals nodes give full control over companion health and resources through visual scripting. CPS's vitals system is standalone — it does not require GC2 Stats. Use these for combat, traps, healing spells, death sequences, and resource management.

Death Behavior: When a companion dies (health reaches zero), CompanionBrain automatically transitions to the Recalled state. Use Revive Companion to bring it back — this also sets the state back to Following.
Instructions
InstructionDescriptionParameters
Damage CompanionDeal damage to a companion's healthTarget Companion, Amount, Source (optional)
Heal CompanionRestore a companion's health by a flat amountTarget Companion, Amount, Source (optional)
Set Companion HealthSet health directly by value, percent, or fill to maximumTarget Companion, Mode (Value / Percent / Full), Amount
Kill CompanionInstantly kill a companion — triggers death state and OnCompanionDeath eventTarget Companion
Revive CompanionRevive a dead companion, restoring health to a given percentTarget Companion, Health Percent
Set InvulnerableEnable or disable damage immunity on a companionTarget Companion, Enabled
Spend ResourceDeduct from a companion's Mana / Energy / Stamina / RageTarget Companion, Amount
Restore ResourceReplenish a companion's resource by an amountTarget Companion, Amount
Conditions
NameDescription
Companion HealthCompare companion health as a flat value or percent using >, <, >=, <= operators
Companion Is DeadTrue if the companion's health is zero
Companion Is AliveTrue if the companion has health greater than zero
Companion In CombatTrue if the companion has taken or dealt damage recently (combat timeout per VitalsProfile)
Has ResourceTrue if the companion has at least the specified amount of its resource
Events
NameDescription
On Companion DamagedFires when a companion takes damage — provides damage amount and source
On Companion HealedFires when a companion is healed — provides heal amount and source
On Companion DeathFires when a companion's health reaches zero
On Companion RevivedFires when a dead companion is revived via Revive Companion instruction

Ability Nodes

Ability nodes let you trigger and manage the companion's 8 ability slots from visual scripting. Each Use Ability call automatically validates cooldown, resource cost, bond tier requirement, and range before executing — you don't need to check conditions manually unless you want early exits.

Companions do not trigger abilities autonomously by default — issue them from GC2 visual scripts using Use Ability, or attach them to input events in your player controller. Since 1.2.0 you can opt into autonomous casting by adding a Companion Ability Auto Caster component, which casts through this same path — see Components → Autonomous Abilities.

Typical Ability Trigger Flow

  1. Event: On Key Press (GC2 native)
  2. Condition: Can Use Ability — slot 0, Target Companion
  3. Instruction: Use Ability — slot 0, current target
Instructions
InstructionDescriptionParameters
Use AbilityActivate an ability slot on a companion — validates bond tier, cooldown, and resourceTarget Companion, Slot (0–7), Target
Set AbilityAssign a CompanionAbility to a specific slot at runtimeTarget Companion, Slot (0–7), Ability (SO reference)
Reset CooldownsClear all active cooldowns on a companionTarget Companion
Cancel CastInterrupt an in-progress cast without triggering effectsTarget Companion
Conditions
NameDescription
Ability On CooldownTrue if a specific ability slot is currently on cooldown
Can Use AbilityTrue if the ability slot passes all validation checks (cooldown, resource, bond tier, range)
Is CastingTrue if a companion is currently in a cast animation
Events
NameDescription
On Ability UsedFires when a companion activates an ability — provides companion reference and ability SO

Trait Nodes

Trait nodes let you build loot-style trait assignment, class progression, and random companion generation without code. Use Assign Random Trait with a TraitPool ScriptableObject to pull a weighted random trait from a rarity-weighted list.

Incompatibility & Requirements: Can Add Trait checks MinBondTier, IncompatibleTraits, and RequiredTrait automatically. Always run this condition before assigning to prevent invalid combinations.
Instructions
InstructionDescriptionParameters
Assign TraitAdd a specific CompanionTrait to a companionTarget Companion, Trait (SO reference)
Remove TraitRemove a specific trait from a companionTarget Companion, Trait (SO reference)
Assign Random TraitPick a trait by weighted rarity from a TraitPool and assign itTarget Companion, TraitPool (SO reference)
Clear All TraitsRemove every trait from a companionTarget Companion
Conditions
NameDescription
Has TraitTrue if the companion has a specific trait assigned
Can Add TraitTrue if the trait passes all requirement checks (bond tier, incompatibility, required trait)
Trait CountCompare the number of assigned traits against a value
Events
NameDescription
On Trait AssignedFires when a trait is successfully added to a companion — provides trait reference
On Trait RemovedFires when a trait is removed from a companion

Target Nodes

Target nodes drive the companion's targeting system — useful for click-to-target UI, tab-cycling, and AI-driven target acquisition. Any GameObject with a Targetable component is eligible. Target Nearest uses the faction filter to ignore allies or enemies as needed.

Click-to-Target Setup (GC2)

  1. Event: On Mouse Down on an object with Targetable
  2. Instruction: Set Target — Target Companion, this GameObject
  3. Optionally follow with Use Ability to auto-attack
Instructions
InstructionDescriptionParameters
Set TargetAssign a specific GameObject as the companion's current targetTarget Companion, Target GameObject
Clear TargetRemove the companion's current targetTarget Companion
Target NearestAutomatically target the nearest Targetable in range matching a faction filterTarget Companion, Faction (Player / Enemy / Neutral / Any), Range
Cycle TargetsAdvance to the next valid Targetable in the scene (same filtering as Target Nearest)Target Companion, Faction Filter
Conditions
NameDescription
Has TargetTrue if the companion has an active target assigned
Target Type IsTrue if the current target's Targetable faction matches the specified type
Target In RangeTrue if the current target is within a given distance of the companion
Events
NameDescription
On Target ChangedFires when the companion acquires or loses a target — fires with null when cleared

Mount Nodes

Metadata only — CPS contains no riding code. Companion Is Mountable reads the Is Mountable flag on the Companion Definition so you can gate your own mount interaction without writing C#. See Components → CompanionDefinition for the Mount Point field and FindMountPoint(...).

Conditions
NameDescription
Companion Is MountableTrue if the companion's Definition has Is Mountable on. Assign a Definition to check a specific companion type, or leave it empty to check the Companion GameObject (defaults to Self)

Inventory Bridge Nodes

Requires the optional Companion Inventory Bridge (GC2 Inventory module). For adding or removing items, use GC2's own Bag Instructions targeting the companion GameObject — this bridge only adds CPS-aware read queries. See Components → Bridges.

Conditions
NameDescription
Companion Has InventoryTrue if the companion has an Inventory Bridge with a valid GC2 Bag
Companion Has ItemTrue if the companion's Bag contains at least a given amount of a specific Item

Needs Bridge Nodes

Requires the optional Companion Needs Bridge (GC2 Stats module). Drives configurable decay of GC2 Stats Attributes (hunger, happiness, energy, etc.) and fires threshold events. See Components → Bridges.

Instructions
InstructionDescriptionParameters
Feed CompanionAdds value to a companion's need Attribute via CompanionNeedsBridge.SatisfyNeedTarget Companion, Attribute, Amount
Conditions
NameDescription
Companion Need LevelCompares a need's current value ratio (0–1) against a threshold using >, <, >=, <=
Companion Need Is CriticalTrue if a need has dropped below its configured critical threshold
Events
NameDescription
On Companion Need CriticalFires when a need drops below its critical threshold — optionally filter by Attribute
On Companion Need SatisfiedFires when a need rises above its satisfied threshold — optionally filter by Attribute

Banter Nodes

On Companion Banter does nothing without a Companion Banter Trigger in the scene — without one this Event never fires. Optional filters: Any Cause (default on; turn off to react only to Timer, Bond Tier Up, or Manual) and an optional Speaker Filter Companion Definition. See Components → Companion Banter Trigger.

Events
NameDescription
On Companion BanterFires when two active companions should exchange a line — requires a Companion Banter Trigger in the scene; the Trigger runs on the speaker

Persistence (Remember)

CPS integrates with GC2's Remember system for save/load. Add theCompanionRemember component to your CompanionManager GameObject — no further configuration is required.

What Gets Saved

  • Active companions: definition, bond level and tier, active traits, command cooldowns, current state
  • Stored companions: full CompanionData including last state and bond level
  • Vitals: current health, resource, and in-combat flag
  • Active companions are re-summoned at the owner's position on load

State Restore Logic

Transient states are mapped to sensible defaults on load:

  • Following / Waiting → restored as-is
  • Idle → restored as Following (will auto-idle when owner stops)
  • Commanded → restored as Following (command context is lost on save)
  • Recalled → restored as Following (shouldn't be active when saved)
Owner Fallback: If no owner is found at load time (e.g., player hasn't spawned yet), active companions are automatically moved to storage instead of being lost.