Advanced Text Functionality, using simple logic principles
Similar to another idea: https://forums.indreams.me/hc/en-gb/community/posts/360015870017-Text-wires But this is to expand on my own thoughts on the topic.
Text ID
The core idea is to have some sort of text ID. 0 would be an empty string.
Any text input (eg. on a text displayer) would output some sort of signal (see below). Wiring that into another text displayer's text input would make it use that same text to render. So there we get easy re-use of the same text in different.
If the source gadget is off, it would just send a 0 as normal--which would make the destination use an empty string to render. You'd probably restrict the input wire-blend mode to "overwrite," so it would use the highest value from the input wires. Then this would just work as we'd want it to.
This means we can turn different sources on and off to change the text rendered by a given text gadget. A classic example is showing an RPG-style dialogue box. Instead of having a ton of displayers, which means any change in style would need fiddly/exhausting work to ensure it's all changed across our scenes and characters, etc.... we have 1 box, and wire in what we want it to say.
Text Source
We could also have a separate gadget specifically for these "text sources" whose soul purpose is to hold text and output such an ID for use in text displayers, etc. That would save having to use particular settings when we don't want the text to display from the gadget, but for it to just hold text.
This gadget could also take multiple inputs and combine them into a new string. For example input 1 = source("Hello"), input 2 = source("World"). The text source gadget itself has the text "\1 \2!" The \1 would be replaced by the string coming in as the first input, \2 from the second input, etc. So, easy string formatting and concatenation.
Text Input trigger
The last step would be to have the ability to ask the player for text--a character name, for example. Perhaps a max characters setting for that, and an input to trigger the prompt by wire. When triggered, the PS keyboard is shown on-screen, overlaying the frozen scene--which would allow the creator to display a message, a question, whatever. What would be shown just above the keyboard.
Whether that's a new gadget or not... that would just output a new ID for that specific string. Allowing us to, again, insert it into other text. For example input 1 = the user-set string as their character name. Formatting text: "Hello \1, nice to meet you." Very useful for RPGs and such.
This gadget could then have a switch to make it persistent, so that the character name(s) could be stored locally for that dream--like variables, and the last-played scene.
String Interning
Regarding the ID... this could use "string interning"--a term from programming where all strings that are identical are just stored once in memory. Here, it would mean you could use an ID to reference a specific string of characters. Just an idea for how this could be implemented, anyhow. Or perhaps the ID could be completely opaque so the creator doesn't have direct access to it--but this wouldn't change all these benefits as explained above.
Please sign in to leave a comment.