Skip to content

InventoryBar

An adventure’s inventory, with no code: a bar along the bottom of the screen showing what the walker’s Inventory holds, each item’s icon and name. Click an item to pick it up (the pointer turns into it), then click a hotspot to walk over and use it there (the hotspot’s UseWith for that item says what happens) or another item to put the two together (Combinations); a right click on an item looks at it (its Descriptions line), and a right click, or a click on it again, puts it back. Anything that doesn’t go together gets the hotspot’s Wrong Item Line or this bar’s WrongLine. Taps do the same on a touch screen, and the keys and a controller go over the items with the walker’s Items, Use, Look and Cancel actions.

Part of the Adventures module: Point-and-click adventures: walk areas a character finds its way round (WalkArea), the character that walks where the player clicks (Walker), things to look at and use (Hotspot), and items to pick up, use on things (UseWith) and put together (InventoryBar), with Create Walk Area, Create Hotspot, Create Walker and Create Item in the Entity menu.

Items come from the Inventory (a hotspot’s Use Gives, a Use With’s Gives, a combination, a Pickup or a script put them there). Each item’s icon is its row in Icons, its row of the Table, the picture of a hotspot in the scene that gives it, or else a tile with its name. Combinations can come from a table too (CombinationsTable). What’s on the pointer (Holding) is kept with the scene, so rewinds and saves keep it.

Requires: Inventory (what it shows)

Works with: Walker (on the same entity: says what’s looked at, and walks over to use what’s picked); UseWith (on a hotspot: what an item used on it does)

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.

  • descriptions: lines of text: an array of strings, or one string with line breaks = []. What the walker says on looking at each item, one per row: the item, a colon and the line, e.g. “Key: A rusty old key.” (A line for each item, one per row: the item, a colon and what’s said, e.g. “Key: A rusty old key.”. The Inspector lists them a row each, the item picked from what the game gives.) (Field: its own editor: Item Lines.)
  • icons: lines of text: an array of strings, or one string with line breaks = []. Each item’s picture, one per row: the item, a colon and an image in Assets, e.g. “Key: Sprites/key.png”, or a frame of a sprite sheet with its columns and rows and the frame, “Rope: Sprites/items.png 4x2 5”. An item with none uses the picture of a hotspot in the scene that gives it, or a tile with its name. (Each item’s picture, one per row: the item, a colon and an image in Assets, or a frame of a sheet with its frames across and down and the frame, e.g. “Key: Sprites/key.png” or “Rope: Sprites/items.png 4x2 5”. The Inspector lists them a row each with the picture picked from the project’s.) (Field: its own editor: Item Icons.)
  • combinations: lines of text: an array of strings, or one string with line breaks = []. Items that go together, one per row: what they make, “=”, the two items joined with “+”, and after a colon what the walker says, e.g. “Grappling Hook = Rope + Hook: I tie the rope to the hook.” Both are used up and what it makes is put in; to keep one, make it again (“Knife + Short Rope = Knife + Rope”). (Items that go together, one per row: what they make, “=”, the two items joined with “+”, and after a colon what’s said, e.g. “Grappling Hook = Rope + Hook: I tie the rope to the hook.”. The Inspector lists them a row each, the items picked from what the game gives.) (Field: its own editor: Combinations.)
  • table: text = null. A table of items, e.g. “Items”: a row for each, named like the item, whose Description column is what’s said on looking at it and whose Icon column is its picture (as in Icons). The rows above win over it. (Names a table.) (Field: a name.)
  • combinationsTable: text = null. A table of combinations, e.g. “Combinations”: a row for each, named like what it makes, whose Combine column is the two items (“Rope + Hook”) and whose Line column is what the walker says. Combinations win over it. (Names a table.) (Field: a name.)
  • wrongLine: text = “That doesn\u0027t work.”. What the walker says when an item is used on a hotspot that has no UseWith for it (and no Wrong Item Line of its own), or two items that don’t go together are put together. Empty says nothing. (Plain text: what the walker says, its own words.) (Field: text.)
  • place: one of Bottom, Top = “Bottom”. Along the bottom of the screen or the top. (Field: one of its values.)
  • slots: a whole number = 7. The most items shown at once, up to 12: arrows at its ends scroll through more. (Field: a number.)
  • showEmpty: true or false = false. Shows the bar while it has nothing in it too; otherwise it shows up with the first item. (Field: on or off.)
  • showNames: true or false = true. Writes each item’s name under its icon. (Field: on or off.)
  • barColor: a color, “#RRGGBB” or “#RRGGBBAA” = “#161A24D8”. The color of the bar behind the items. (Field: a color.)
  • textColor: a color, “#RRGGBB” or “#RRGGBBAA” = “#F2ECDAFF”. The color of the items’ names, and of the line round the one the keys are on. (Field: a color.)
  • getSound: text = null. A sound played as an item is put in it, e.g. “Sounds/get.wav”. (A sound in Assets, e.g. “Sounds/hit.wav”.) (Field: a sound.)
  • pickSound: text = null. A sound played as an item is picked up onto the pointer. (A sound in Assets, e.g. “Sounds/hit.wav”.) (Field: a sound.)
  • combineSound: text = null. A sound played as two items are put together. (A sound in Assets, e.g. “Sounds/hit.wav”.) (Field: a sound.)
  • holding: text = null. The item on the pointer, picked from the bar to use on something; empty for none. Read as the “Holding” output. (Plain text: the item on the pointer: the game sets it as items are picked.) (Field: text.)
  • scroll: a whole number = 0. How far the bar is scrolled: the first item shown, counting from 0. (Field: a number.)
  • cursor: a whole number = -1. The item the keys or a controller are on, counting from 0, while they’re on the bar; -1 while they’re not. (Field: a number.)

What anything can make it do with no code: a Trigger’s do when its message arrives, a Contraptions Wire’s input as its signal comes on, a script’s Game.Do(entity, “Name”).

  • Pick (done with a name, its item: a trigger’s with). Picks item up onto the pointer, if the inventory holds one, as clicking it does.
  • PutBack. Puts back the item on the pointer.
  • Combine (done with a name, its items: a trigger’s with). Puts two items together, “Rope + Hook”, as clicking one with the other does, at the start of the next frame.
  • LookAt (done with a name, its item: a trigger’s with). Has the walker look at item and say its description, at the start of the next frame.

What anything can read with no code: a Counter’s, Bar’s or Text’s output, a Contraptions Wire’s output as its signal; Text shows names too, the rest read numbers, true as 1.

  • Holding (a name). The item on the pointer, picked from the bar to use on something; empty for none. Read as the “Holding” output.

Scripts use it as InventoryBar: its methods, events and values that aren’t saved with the scene.