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

Difference between revisions of "ETCH"

From Creatures Wiki
Jump to navigation Jump to search
(Created page with "'''ETCH''' is a CAOS command which controls flow. ==Usage== Syntax: ''ETCH family (int) genus (int) species (int)'' This marks the start of an ''enumeration loop'', whic...")
 
(recategorize)
Line 20: Line 20:
 
*[[TTAR]]
 
*[[TTAR]]
  
[[Category:C2 CAOS]]
+
[[Category:C2 CAOS Commands]]
 
[[Category:C3 CAOS Commands]]
 
[[Category:C3 CAOS Commands]]

Revision as of 23:30, 15 March 2018

ETCH is a CAOS command which controls flow.

Usage

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.

Examples

Editnorn.png This article about a CAOS command or function needs further examples.

Helen's Cob Creation Tutorials covers the ETCH concept in tutorial 7.

See also