ETCH is a CAOS command which controls flow.
Syntax: ETCH 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 AND is touching the OWNR object. Whether one agent 'touches' another is decided if their bounding boxes are touching. ETCH first sets TARG, then evaluates the content of the loop, then goes on to the next agent, and so on until all agents of the given class number that are touching the object have been exhausted. In install scripts, when there is no OWNR, TARG is used instead.
Any or all of the arguments may be 0, which is a wildcard. So ETCH 0 0 0 will loop through all agents touching that object.
At the end of the loop, TARG is set to OWNR - so store the original TARG somewhere else if it's important.
|This article about a CAOS command or function needs further examples.|