SpawnMessage

local SpawnMessage = require("encompass").SpawnMessage

A SpawnMessage is a kind of message that is consumed by Spawners to spawn new entities.

Function Reference

SpawnMessage.define(name, required_field_types, optional_field_types)
Arguments:
  • name (string) – The name of the SpawnMessage prototype.
  • required_field_types (table) – A table where the keys are field names and the values are types. If one of these fields is missing when the SpawnMessage is instantiated, or a field is passed to the message with an incorrect type, an error is thrown.
  • optional_field_types (table) – A table where the keys are field names and the values are types. If a field is passed to the message with an incorrect type, an error is thrown.
Returns:

A new SpawnMessage prototype.