-
Notifications
You must be signed in to change notification settings - Fork 0
Component API Overview
mewcodex edited this page Sep 2, 2026
·
6 revisions
Component API v2 separates the responsibilities that were previously coupled inside card generation:
| Layer | Main types | Owner |
|---|---|---|
| Generation |
ComponentGenerationProfile, IComponentCatalog
|
Describes card shells, component inventory, names, and policies |
| Balance |
IComponentOccurrencePolicy, IComponentValuePolicy, IComponentValuation
|
Selects effects, samples values, and prices finalized effects |
| Runtime |
ComponentRuntimeApi, IComponentRuntimeHandler
|
Executes custom structured opcodes |
| Presentation |
ComponentPresentationApi, IComponentHoverTipProvider
|
Adds tips for custom references and named mechanics |
| Character host |
ExternalComponentCharacterApi, ExternalChaosCardModel
|
Connects fixed card models to run-scoped generated definitions |
- Runtime semantics use lowercase ASCII IDs and
OperationRuntimeSpec; localized prose is output only. - Occurrence probability and numeric/effect value are independent.
- Registration happens during mod initialization and freezes before generation or execution begins.
- A profile ID is the external identity. Its
GeneratedCharacteris only the closest built-in balance and legality archetype. - The character mod continues to own its
CharacterModel,CardPoolModel, card classes, run lifecycle, portraits, rarity counts, and authoritative save/multiplayer synchronization.
Reference AutoAnthony.dll plus the normal STS2/Godot assemblies.
- Generator contracts live in
ChaosCardGenerator. - Runtime, presentation, and external-card contracts live in
AutoAnthony.
Check the versions before registering:
if (ComponentApi.ApiVersion != 1 || ComponentRuntimeApi.ApiVersion != 1)
throw new NotSupportedException("Unsupported AutoAnthony Component API version.");Register in this order during your mod initializer:
ComponentPackageApi.Register(...)-
ComponentRuntimeApi.RegisterPackage(...)for custom opcodes -
ComponentPresentationApi.Register(...)for optional hover tips ExternalComponentCharacterApi.Register(...)
At new-run or restore time, create complete ChaosCardDefinition records and call
ExternalComponentCharacterApi.InstallDefinitions(profileId, definitions). On run cleanup, call
ClearDefinitions(profileId).
Continue with Authoring a Component Package.
Source · Steam Workshop · AutoAnthony 0.3.32 · API v3