UseWith
What using an item on a Hotspot does, with no code: a key on a door, a coin given to a beggar, a bone thrown to a dog. Put one on the hotspot for each item that does something there. When the walker uses its Item on the hotspot (picked from the InventoryBar), it walks over and says its Line, does its action on its targets, sets its flag, sends its message, starts the hotspot’s dialogue (Talks), gives up the item (unless it KeepsItem) and gets what it Gives.
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.
An item with no Use With on a hotspot gets its Wrong Item Line, or the bar’s Wrong Line. With NeedsFlag, it only counts while a flag is set (or isn’t): put two on a door for the same key, one needing “DoorLocked”.
Requires: Hotspot (what the item is used on)
Works with: InventoryBar (on the walker: where the item is picked 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.
item: text = null. The item that’s used on the hotspot, e.g. “Key”; several separated by commas each do the same. (Names items: their names, separated by commas.) (Field: a name.)needsFlag: text = null. A flag it needs to count, e.g. “DoorLocked”, or “not DoorOpen”; while it doesn’t hold, the item is the wrong one here. Empty always counts. (Names a flag: “Name” holds while it’s set, “not Name” while it isn’t.) (Field: a name.)
What It Does
Section titled “What It Does”line: text = null. What the walker says, e.g. “The key turns. It’s open!” (Plain text: what the walker says, its own words.) (Field: text.)talks: true or false = false. Starts the Dialogue on the hotspot’s entity: giving something to a character. (Field: on or off.)do: text = null. An action done on its Targets (or the hotspot itself): a door’s “Open”, a switch’s “Toggle”… (Names an action of the entities targets names, or this entity without any: one component_describe lists under Actions, e.g. “Damage”, or “Health.Damage” for one component’s.) (Field: an action’s name.)targets: text = null. What Do is done on, by name, separated by commas (those inside the hotspot first). Empty does it on the hotspot’s entity. (Names entities: their names, separated by commas.) (Field: an entity’s name.)with: text = null. What Do is done with, for an action that takes a value. Empty uses the action’s own default. (The value the action do names is done with, as the action takes it: a number (“2”), true or false, or a name (a flag for Set Flag, a scene for Load Scene). Empty uses the action’s own default. The Inspector gives a box, a tick or a list as the action wants.) (Field: its own editor: Action Value.)flag: text = null. A flag set, e.g. “DoorOpen”; “not Name” clears one. Flags are kept in the save data. (Sets a flag: “Name” sets it, “not Name” clears it; other fields can name it.) (Field: a name.)message: text = null. A message sent, with the walker as its data. (Names a message.) (Field: a name.)keepsItem: true or false = false. Keeps the item rather than giving it up: a key that opens more than one door, a torch to light things with. (Field: on or off.)gives: text = null. Items put in the walker’s inventory, separated by commas, each with how many if more than one: “Coin 3, Map”. (Items and how many of each, separated by commas, e.g. “Coin 3, Map” (one Map). The Inspector lists them a row each, the item picked from the project’s and the count set.) (Field: its own editor: Counts.)sound: text = null. A sound played, e.g. “Sounds/unlock.wav”. (A sound in Assets, e.g. “Sounds/hit.wav”.) (Field: a sound.)
timesUsed: a whole number = 0. How many times it has been done. The game counts them. (Field: a number.)
Outputs
Section titled “Outputs”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.
TimesUsed(a whole number). How many times it has been done. The game counts them.
Scripts use it as UseWith: its methods, events and values that aren’t saved with the scene.