Hotspot
Something in an adventure to look at and use with the mouse, with no code: a door, a key on the floor, a painting, a character to talk to. Hovering over it shows its Name by the pointer and changes the pointer to its Cursor; clicking it sends the player’s Walker to stand by it (at StandAt), and then looks at it (a right click, or a left click with the walker’s verb on Look) or uses it (a left click). Each verb can say a line (the walker says it over its head), do an action (a door’s Open, a dialogue’s Start, a switch’s Toggle…), set or clear a flag and send a message; using it can start its Dialogue. Something with nothing to use is looked at instead. Its shape is its Points, or else its collider, its sprite, or a square a unit across.
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.
NeedsFlag keeps it out of reach until a flag is set (a hidden drawer), or while one is (not TookKey, for a key that’s gone once taken), and HideWhenGone hides it then too. Using it can put items in the walker’s inventory (UseGives), and items from the InventoryBar are used on it by its UseWiths (anything else gets its WrongItemLine). Looking and using are counted (TimesLooked, TimesUsed), for a Counter or a trigger. Its Look and Use actions do the same as a click, for a trigger or a script, and Use Item uses an item on it. With GoesTo it’s a way to another room: using it goes to that scene, where the walker arrives at ArriveAt.
Works with: Walker (the character that walks over and looks at it or uses it); Dialogue (started when it’s used, with Use Talks); UseWith (what each item used on it does)
Needed by: UseWith
Draws itself over the whole world, under what’s pinned to the screen.
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.
name: text = null. What it’s called by the pointer, e.g. “Old Door”; empty uses its entity’s name. Read as the “Name” output. (Plain text: what the pointer calls it, its own words.) (Field: text.)points: text = null. Its shape, as “x y” pairs separated by semicolons round the entity in its own units, its points dragged in the Scene view, for something painted into the background (a window, a crack in the wall). Empty uses its collider, or else its sprite, or else a square a unit across. (Points: “x y” pairs separated by semicolons, e.g. “4 0; 4 3”. The Inspector lists them a row each to set, add, remove and reorder.) (Field: its own editor: Points.)standAt: [x, y] = [0,0]. Where the walker stands to look at or use it, from its entity, in world units: (0, -1.5) is in front of a door 1.5 below its middle. A spot off the floor walks as close as it can. (A point offset from the entity, in world units: with Distance Handles the Scene view puts a knob on it to drag.) (Field: a vector.)walkThere: true or false = true. Walks over to it before looking or using; untick it for something seen from afar (the moon, a distant ship). (Field: on or off.)cursor: one of Arrow, Hand, Cross, Look, Hidden = “Hand”. The pointer shown over it. (Field: one of its values.)needsFlag: text = null. A flag it needs to be there, e.g. “OpenedDrawer”, or “not TookKey” for one that’s gone once a flag is set: until then the pointer passes over it and clicks walk past. Empty is always there. (Names a flag: “Name” holds while it’s set, “not Name” while it isn’t.) (Field: a name.)hideWhenGone: true or false = false. Hides its entity while its NeedsFlag keeps it out of reach, and shows it again once it doesn’t: a key that’s gone once taken, a ladder that’s there once it’s put up. (Field: on or off.)
lookLine: text = null. What the walker says on looking at it, e.g. “A rusty old key.” (Plain text: what the walker says, its own words.) (Field: text.)lookDo: text = null. An action done on looking at it, on its LookTargets (or itself): a dialogue’s “Start”, a switch’s “Toggle”, a sound player’s “Play”… (Names an action of the entities lookTargets 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.)lookTargets: text = null. What Look Do is done on, by name, separated by commas (those inside this one first). Empty does it on this entity. (Names entities: their names, separated by commas.) (Field: an entity’s name.)lookWith: text = null. What Look Do is done with, for an action that takes a value (Damage 2). Empty uses the action’s own default. (The value the action lookDo 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.)lookFlag: text = null. A flag set on looking at it, e.g. “SawCrack”; “not Name” clears one. (Sets a flag: “Name” sets it, “not Name” clears it; other fields can name it.) (Field: a name.)lookMessage: text = null. A message sent on looking at it, with the walker as its data. (Names a message.) (Field: a name.)
useLine: text = null. What the walker says on using it, e.g. “It won’t budge.” (Plain text: what the walker says, its own words.) (Field: text.)useTalks: true or false = false. Using it starts the Dialogue on its entity: talking to a character. (Field: on or off.)useDo: text = null. An action done on using it, on its UseTargets (or itself): a door’s “Open”, a switch’s “Toggle”, a dialogue’s “Start”, a spawner’s “Spawn”… (Names an action of the entities useTargets 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.)useTargets: text = null. What Use Do is done on, by name, separated by commas (those inside this one first). Empty does it on this entity. (Names entities: their names, separated by commas.) (Field: an entity’s name.)useWith: text = null. What Use Do is done with, for an action that takes a value. Empty uses the action’s own default. (The value the action useDo 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.)useFlag: text = null. A flag set on using it, e.g. “TookKey”; “not Name” clears one. (Sets a flag: “Name” sets it, “not Name” clears it; other fields can name it.) (Field: a name.)useMessage: text = null. A message sent on using it, with the walker as its data. (Names a message.) (Field: a name.)useGives: text = null. Items put in the walker’s inventory on using it, separated by commas, each with how many if more than one: “Key”, “Coin 3, Map”. For something taken once, give it a Use Flag and Needs Flag “not” that flag, with Hide When Gone. (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.)
goesTo: text = null. A scene using it goes to, once the walker is there, e.g. “Garden”: a door or a path to the next room. The screen fades out and in, and the walker there arrives at ArriveAt. (Names a scene.) (Field: a name.)arriveAt: text = null. Where the walker arrives in the GoesTo scene: the name of a hotspot there (it stands at that one’s Stand At: the door back), or of anything else (it stands where that is). Empty leaves it where that scene has it. (Only used when goesTo is set.) (Names something in the scene goesTo names (a hotspot there, or any entity): the Inspector lists that scene’s to pick from, and flags a name it doesn’t have.) (Field: its own editor: In Scene.)
wrongItemLine: text = null. What the walker says when an item it has no UseWith for is used on it, e.g. “The dog sniffs it and looks away.” Empty uses the inventory bar’s Wrong Line. (Plain text: what the walker says, its own words.) (Field: text.)
timesLooked: a whole number = 0. How many times it has been looked at. The game counts them. (Field: a number.)timesUsed: a whole number = 0. How many times it has been used. The game counts them. (Field: a number.)
Actions
Section titled “Actions”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”).
Look. Walks the player’s walker over and looks at it, as a right click on it does.Use. Walks the player’s walker over and uses it, as a left click on it does.UseItem(done with a name, its item: a trigger’s with). Walks the player’s walker over and uses item on it (if the walker has one), as picking it from the inventory bar and clicking this does.
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.
Name(a name). What it’s called by the pointer, e.g. “Old Door”; empty uses its entity’s name. Read as the “Name” output.TimesLooked(a whole number). How many times it has been looked at. The game counts them.TimesUsed(a whole number). How many times it has been used. The game counts them.
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.
called: text. What it’s called by the pointer: its Name, or its entity’s name.canUse: true or false. True if using it does anything; with nothing to use, a click to use it looks at it instead.standPoint: [x, y]. Where the walker stands to look at or use it, in the world (before walking as close as it can get).
Scripts use it as Hotspot: its methods, events and values that aren’t saved with the scene.