Skip to main content

Execute_AddTrait

Description

Grants an Aptitude-category trait to the BaseObject entity (e.g. from consuming an item such as a CatDonut). Only traits whose Trait.json Category is EB1TraitCategoryType::Aptitude are allowed; a Nature, Characteristic, Ambition, or HopeLife trait is rejected with a warning and skipped so that designers cannot accidentally grant a non-Aptitude trait through a script. The grant is idempotent (FB2TraitComponent::AddTrait no-ops when the trait is already owned) and fires the acquisition notification (activity feed / overhead alert) for the playing household/character.

Note

This command only registers trait ownership. The trait's own effects (modifiers, buffs, etc.) are applied by the trait's AddTraitScriptId, not by this command.

Parameters

ParamsDescription
BaseObjectTarget entity that will receive the trait (Self or Target)
CommandAddTrait
S1Trait ID to grant (Trait.json Id); must be Category == Aptitude

Examples

ExampleBaseObjectCommandCompareTypeS1S2F1F2Prob
Grant the CatDonut aptitude trait to SelfSelfAddTraitAptitude_CatDonut