Skip to content

Instantly share code, notes, and snippets.

@kevinwright
Last active September 5, 2023 19:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kevinwright/984f2bc2474e2e3668283997effbea46 to your computer and use it in GitHub Desktop.
Save kevinwright/984f2bc2474e2e3668283997effbea46 to your computer and use it in GitHub Desktop.

To test your current state

get self then match against PoweredDown, PathBlocked, etc.

To see if you have an empty slot

Check if you have available space for something you'd normally never pick up

To test if a parameter is undefined

Compare Item against blank

To avoid a behaviour auto-running on copied buildings

Test self for PoweredDown, exit if true

On Entities vs Items vs Numbers and comparing things

A parameter or variable can refer to an Entity - a single specific instance of a vehicle, building, etc. or an Item/Value pair (e.g. 10 Metal Bars, it doesn't matter which ones)

Other abstract concepts are also considered Items. Such as Resource, PoweredDown, PathBlocked, Bot, Dropped Item and Explorable. These are listed under the Information tab when selecting an item in the UI, as they're pairs they can have a number. These are especially useful as filter for the radar and Entities in Range

A number is always such an item/value pair "under the hood", just with the item part left unspecified.

Hence the different comparison nodes

  • Compare Entity to determine if this dashbot is the same as that dashbot
  • Compare Item to determine if the value refers to any number (including 0) of non-specific dashbots, or Metal Bars, or whatever
  • Match is most useful for comparing an item to one of the information types. Such as determining if it's on the power grid, path blocked, or dropped
  • Compare Number looks at just the numeric part of an Item/Value pair, ignoring the Item part
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment