Scanners

Scanner Configuration

Scanners are the one and only basic element of NOML. They get executed every time a creature is about to spawn, and analyze the surrounding area, in search of specific features. If multiple scanners are present, they get executed in the order defined by their priorities. If more than one scanner has the same priority, their relative ordering is not guaranteed.

Top-level Scanners

The top-level scanners are triggered directly by creature spawn, and the scan a defined region of the map, surrounding the block the creature is spawning on, and checking all the blocks that are made of a defined list of materials, until one of the following conditions is met (whichever comes first):

  1. The block counter reaches the defined count limit, in which case the action is performed, or
  2. The absolute counter reaches the hard limit value, in which case the action is also performed, or
  3. The whole region is scanned but the count value is never met, in which case the fallback action is performed.

Both the action and fallback share the same list of possible actions to execute:

  • Prevent: Cancels the spawn event and exits the scanning process.
  • Allow: Exits the scanning process without cancelling the spawn event.
  • Continue: Cancels the current scanner, but lets the process continue with next scanner in the list (sorted by priority).

If the scanner chain ends and none of the scanners returned Prevent or Allow, the default action is assumed to be Allow.

Nested Scanners

Nested scanners are scanners that are run for each block of the parent scanner that matches one of the materials specified in the parent's list. The nested scanner will then preform it s own scanning and has the choice of controlling the parent's counter (allowing it to count the matched block or preventing that count), or to directly allow or prevent the spawn event from ocurring.

The conditions for a nested scanner to match are the same, but the semantics of the actions changes slightly.

As in the top-level scanners, both the action and fallback share the same list of possible actions to execute:

  • Prevent and Allow: They Work the same way as in top-level scanners. Exiting the scanner chain and performing the action.
  • Continue: Cancels the current scanner, but lets the process continue with next scanner in the list of nested scanners (sorted by priority).
  • Count: Exits the nested chain and makes the parent count the matched block.
  • Skip: Exits the nested chain and makes the parent skip the matched block.

In this case, if the continue action reaches the end of the nested list, or there was no nested scanners, the default action is to count the matched block in the parent.


Comments

Posts Quoted:
Reply
Clear All Quotes