Welcome to the Creatures Wiki! Log in and join the community.


From Creatures Wiki
(Redirected from Enum)
Jump to navigation Jump to search

ENUM is a CAOS command which controls flow.


Syntax: ENUM family (int) genus (int) species (int)

This marks the start of an enumeration loop, which must be ended by NEXT. It cycles through every agent which matches the classifier: first setting TARG, then evaluating the content of the loop, then going on to the next agent, and so on until all agents of the given class number have been exhausted.

Any or all of the arguments may be 0, which is a wildcard. So ENUM 0 0 0 will loop through all agents.

At the end of the loop, TARG is set to OWNR - so store the original TARG somewhere else if it's important.


Destroy all badbugs:

ENUM 2 14 0

Limit elasticity of all toys:

ENUM 2 21 0
  DOIF ELAS gt 50
    ELAS 50

Age all creatures to adult:

ENUM 4 0 0
  SETV va00 4
  SUBV va00 CAGE
  DOIF va00 gt 0
    AGES va00

Show the bounding boxes of everything:

ENUM 0 0 0
  DCOR 1

Make ENUM stop counting after a certain number

See also[edit]

  • ESEE - 'visible' enumeration loop
  • ETCH - 'touching' enumeration loop
  • EPAS - vehicle's passengers
  • ECON - port connections