Skip to main content

Change Resource (Entity Action Type)

A legacy action that changes the value of an apoli:resource or apoli:cooldown. Use apoli:modify_resource in new packs. This action is kept so older packs keep working.

Type ID: apoli:change_resource (origins:change_resource is accepted too). Both are read as apoli:modify_resource.

Legacy packs

Many existing data packs written for Apace's Apoli use origins:change_resource with its old field shape, so this Apoli reads both names.

apoli:change_resource is a type alias of apoli:modify_resource, and its change and operation fields are translated into a modifier when the pack loads. Old packs don't need updating.

Fields (legacy schema)

FieldTypeDefaultDescription
resourceIdentifierrequiredThe resource or cooldown power to change.
changeInteger or ExpressionrequiredThe amount. The result never goes past the resource's min or max while enforce_limits is on. An expression is evaluated each time the action runs, with value bound to the resource's current value.
operationString ("add" or "set")"add""add" becomes add_base_early and "set" becomes set_base.

Examples

"entity_action": {
    "type": "apoli:change_resource",
    "resource": "namespace:example",
    "change": 1
}

This adds 1 to the namespace:example apoli:resource (data/namespace/powers/example.json).

change also accepts an Expression:

"entity_action": {
    "type": "apoli:change_resource",
    "resource": "namespace:example",
    "change": "namespace:example_max / 10",
    "operation": "add"
}

This tops the resource up by a tenth of its own maximum. value is bound to the resource's current value, and <id>_max and <id>_min read any resource's limits.