add_attribute_to_set
Add a GameplayAttributeData variable to an AttributeSet Blueprint, set its base and current value, then compile and save it.
Instructions
Add one FGameplayAttributeData member variable to an AttributeSet Blueprint, with default_value as its BaseValue and CurrentValue, then compile and save it. A name that is already an attribute of the class is left as it is (added false, already_existed true); a name taken by a variable of another type fails. attribute_present and base_value are read from the compiled class; refused during PIE.
Returns: { attribute_set_path: string, attribute_name: string, default_value: number, added: bool, already_existed: bool, attribute_present: bool, base_value?: number, default_applied?: bool, saved: bool }
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| force | No | Optional. This command is REFUSED while a Play-in-Editor session is running: it either compiles a Blueprint (the reinstancer can retain a world, and CheckForWorldGCLeaks is Fatal -- it KILLS the editor) or writes to disk (Editor.AllowSavingAssetsDuringPIE=0 makes the engine refuse the write, so it would report success without writing a byte). Stop PIE and retry instead; force=true runs it anyway, at your own risk. | |
| default_value | No | Initial BaseValue and CurrentValue of the attribute, default 0; not applied to an attribute that already exists. | |
| attribute_name | Yes | Name of the new attribute member variable | |
| attribute_set_path | Yes | Full asset path of the AttributeSet Blueprint |