TableValues
Gives its entity’s other components their values from a row of a table, with no code: an enemy’s Health and Damage from the Enemies table’s Slime row. Sets says which properties take which columns, one a line (Health.Max = Health); left empty, every property named like a column takes it (a column called “Speed” sets every Speed, one called “Health.Max” sets that one). The values are set as the entity starts in the game (spawned ones straight away), and again whenever the row changes while the game runs, so balancing a table while playing shows at once. A row renamed in the Tables panel is still found by its old name; a table or row that isn’t there is flagged in the Inspector, a line of Sets naming a property the entity hasn’t got is noted above its fields, and anything missing (a column too) is said in Output as the game starts.
Works with: Deck (a Deck makes its cards from a table’s rows, one with Table Values each)
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.
table: text = null. The table the values come from, e.g. “Enemies” (Assets/Tables/Enemies.table). (Names a table.) (Field: a name.)row: text = null. The row they come from, e.g. “Slime”. Empty takes the row named like the entity, so a Slime prefab finds the Slime row. (Names a row of a table.) (Field: a name.)savedRow: text = null. A name in the game’s save data (Game.SaveData) holding the row to read instead, e.g. “hero”: a menu’s Choice with Save As “hero” picks the class the hero plays. With nothing saved under it, Row is read. (Names a name in the save data.) (Field: a name.)sets: lines of text: an array of strings, or one string with line breaks = []. Which property takes which column, one a line: Health.Max = Health (a component’s property, then the column), Speed (every Speed on the entity, from the Speed column) or Patrol.Speed = Walk Speed. A number property given dice rolls them once, as the entity starts. Empty sets every property named like a column. (Which property takes which column, one a line: “Health.Max = Health” (a component’s property, then the column), or “Speed” for every Speed from the Speed column. Empty sets every property named like a column. The Inspector lists them a row each, picking the property from the entity’s and the column from the table’s.) (Field: its own editor: Table Sets.)applied: text = null. Set by the game: which values it set last, so a rewind (which brings back what they were) doesn’t set them again, rolling new dice, unless the row has changed since. Leave it be. (Plain text: which values the game set last: the game writes it.) (Field: text.)
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.
pickedRow: text. The row SavedRow picked as the game last set the values; null for none. Set by the game.rowName: text. The row it reads: the one SavedRow picked, else Row, or the entity’s name when that’s empty.
Scripts use it as TableValues: its methods, events and values that aren’t saved with the scene.