add_rule
Add a conditional rule to the ARC world engine, specifying a trigger and effect code to control actor behavior with boolean logic.
Instructions
Attach actor ECE code. Use actor.value predicates and frame N effects.
condition_code supports and/or, for example:
actor.visible == true and (actor.color == 8 or action.id == 6).
ACTION6 coordinates are action.x and action.y. Effects use one
operation per line, for example frame 0: actor.recolor(8) followed by
frame 1: actor.rotate_to(actor_2, 1, -1). Invalid code is rejected with
an agent-facing line/column error. Legacy structured fields remain accepted.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| args | No | ||
| name | Yes | ||
| every | No | ||
| phase | No | ||
| action | No | ||
| effect | Yes | ||
| trigger | Yes | ||
| priority | No | ||
| conditions | No | ||
| effect_key | No | ||
| effect_code | No | ||
| condition_key | No | ||
| custom_effect | No | ||
| condition_code | No | ||
| owner_actor_id | No | ||
| condition_logic | No | all | |
| condition_value | No | ||
| source_actor_id | No | ||
| target_actor_id | No | ||
| collision_actor_id | No | ||
| condition_operator | No | none |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||