-
Notifications
You must be signed in to change notification settings - Fork 0
Component API Overview
Component API v3 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 |
| Keywords |
ComponentKeywordRuntimeApi, IComponentKeywordRuntimeAdapter
|
Projects stable custom keyword IDs into game cards and tips |
| Character host |
ExternalComponentCharacterApi, ExternalChaosCardModel
|
Connects fixed card models to run-scoped generated definitions |
| Host services |
ComponentRunSettingsApi, ComponentGenerationProgressApi, ComponentTriggerApi, ComponentSurpriseApi
|
Reuses settings, progress, trigger, and concealment behavior without reflection |
| Naming | CardNameGenerator.RegisterExternalParts |
Registers reviewed same-character bilingual name morphology |
- Runtime semantics use lowercase ASCII IDs and
OperationRuntimeSpec; localized prose is output only. - Named localization templates bind directly to RuntimeSpec value/text slots instead of matching rendered numbers or words.
- 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 != 3 || ComponentPackageApi.ApiVersion != 3
|| ComponentRuntimeApi.ApiVersion != 1 || ExternalComponentCharacterApi.ApiVersion != 3)
throw new NotSupportedException("Unsupported AutoAnthony Component API version.");This is the minimum guard for the core integration path. Check every additional surface your adapter calls and see
the complete API Changelog version matrix. The services introduced in 0.3.32 also require that
mod version even though the top-level ComponentApi was already v3.
Register in this order during your mod initializer:
ComponentPackageApi.Register(...)- Optional:
CardNameGenerator.RegisterExternalParts(...) -
ComponentRuntimeApi.RegisterPackage(...)for custom opcodes -
ComponentPresentationApi.RegisterPackage(...)for optional hover tips -
ComponentKeywordRuntimeApi.RegisterPackage(...)for custom keyword projection ExternalComponentCharacterApi.Register(...)- Optional:
ExternalComponentCharacterApi.RegisterRuntime(...)
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