ShowWhen
Shows its entity only while a flag holds, with no code: a HUD whose tools appear one by one as goals are met, a sign that’s put up once the guard has been talked to. While NeedsFlag holds the entity is shown, and otherwise it’s hidden with everything inside it, looked at again every frame: it appears as soon as a trigger’s Set Flag, a dialogue’s “[set Name]” or a script’s Game.SetFlag sets the flag, and goes again when the flag is cleared or a New Game forgets it. It can also (or instead) show the entity only while the camera is zoomed in (ZoomBelow). A hidden button can’t be clicked and its shortcut does nothing.
It decides whether its own entity is shown, so to hide it some other way, hide what it’s inside. Name a flag starting “run.” (“run.Contracts”) for one that lasts only while the game runs: it isn’t kept for the next time the game starts, so an unlock doesn’t carry over (see Game.SetFlag). For a panel, use its own Needs Flag, which says when it can open. The Scene view shows the entity as ever; it’s only hidden while the game runs.
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.
needsFlag: text = null. The flag that has to be set for the entity to show, e.g. “run.Contracts” (set by a trigger’s Set Flag, a dialogue’s “[set run.Contracts]” or a script’s Game.SetFlag), or “not Tutorial” to show it only while that isn’t set. Several joined with “or” show it while any holds: “run.Contracts or run.Work”. Empty leaves the entity as it is. (Names a flag: “Name” holds while it’s set, “not Name” while it isn’t.) (Field: a name.)zoomBelow: a number = 0. Shows the entity only while the main camera is zoomed in this far: while its Size is at most this (a smaller Size is closer in), and hides it when the camera pulls out past it. A label under each worker with 7 shows while the camera’s Size is 7 or less, so a busy floor isn’t drowned in words when seen from afar. 0 ignores the zoom. With a NeedsFlag too, both have to hold. Hidden as the flag hides it, with everything inside it. (Field: a number.)
Scripts use it as ShowWhen: its methods, events and values that aren’t saved with the scene.