ConveyorPort
Where a machine meets a Conveyor, at the cell it stands on: an In port takes what reaches the end of a belt pointing into its cell (or ending on it) into the machine, and an Out port puts what the machine made onto the belt on its cell, or one next to it leading away. Put one on the machine, or on an entity inside it where its way in or out is, so a machine’s prefab brings its ports with it.
It takes into and gives from what holds items on its entity or the one it’s inside (an Inventory), so a machine with an inventory needs no code: an In port with Holds stops taking once the machine has that many, and the line backs up behind it. With nothing holding items, an In port takes everything it’s offered (for a script listening to Received), and an Out port puts only what a script hands it with Give. An item it won’t take waits at the belt’s end (it’s Blocked) until something takes it off.
Works with: Conveyor (the belts it takes from or puts on); Inventory (what it takes into and gives from)
Properties
Section titled “Properties”Each is listed as its key in the scene file and the MCP tools, then its kind of value, its default and what it does.
kind: one of In, Out = “In”. In takes items off a belt’s end; Out puts them on a belt. (Field: one of its values.)items: text = null. The items it takes or puts, e.g. “Deck, Report”; empty for any. An In port leaves others waiting at the belt’s end; an Out port with none named puts whatever its inventory holds. (Names items: their names, separated by commas.) (Field: a name.)holds: a whole number = 0. For an In port: it stops taking an item once the machine holds this many of it, so the line backs up until the machine uses some. For an Out port: how many items handed it with Give it keeps waiting for room on the belt (a machine’s out tray); once it has that many it’s Full and takes no more. 0 for no limit. (Field: a number.)open: true or false = true. While ticked it takes or puts items; untick it (or switch it off) to hold the line. (Field: on or off.)message: text = null. A message sent as it takes or puts an item, with the item’s name as its data (a Counter can count them). (Names a message.) (Field: a name.)
While the game runs
Section titled “While the game runs”Not saved with the scene; scripts read them, and entity_get shows them as live while the game plays.
blocked: true or false. True if in the last step it held the line up: an In port left an item waiting it wouldn’t take (the wrong item, or the machine’s full), or an Out port had something to put on a belt that had no room.waiting: lines of text: an array of strings, or one string with line breaks. What a script has handed an Out port with Give that isn’t on the belt yet, first first (Withdraw takes one back).full: true or false. True if an Out port with Holds has that many items waiting: its machine can stop making more until there’s room.
Scripts use it as ConveyorPort: its methods, events and values that aren’t saved with the scene.