EntityExists

Family: Studio · One form

What it does

Tells whether at least one entity of the scene matches an id, a name or a tag.

Syntax

EntityExists(entity string) → integer

Parameters

NameTypeMeaning
entitystringThe entity's id, name or tag, as the editor shows it. The match is exact.

Every form returns

integer

1 if at least one entity matches, 0 otherwise.

Good to know

  • The lookup tries the id first, then the name, then the tag. A match at one level hides the levels below it.

Example · generated

DO  Print(EntityExists("value"))  Sync()LOOP

EntityExists is called and its answer is printed every frame. The DO … LOOP is not decoration: a classic BASIC program ends the moment it runs out of lines, and Sync() is what draws the frame.

133 commands in Studio