Is there a way to separate the output from the input?

Suwonian
13 Nov 2012, 12:10
I love how Quest separates the input box from the output window but every time an input is executed the "input prompt" and "input" appears in the output window. This really breaks up the readability of the developing story. Is there a way to prevent the "input prompt and inputted text" from appearing in the output window?

Pertex
13 Nov 2012, 13:33
Yes, click "Filter" in the left bottom corner and choose "Show library elements". Then find the function "HandleCommand" and copy it to your game (upper right button). Now remove this command in this function:
Call function msg with parameters ">"+SafeXML(command)
from the gui


or in codeview:
msg( ">"+SafeXML(command))

Suwonian
13 Nov 2012, 17:08
Pertex,

Thank you for the quick reply. It works!

The Pixie
16 Nov 2012, 14:18
Here is a slightly better version:
  <function name="HandleCommand" parameters="command"><![CDATA[
msg ("")
if (StartsWith (command, "*")) {
msg (SafeXML (command))
}
else {
if (GetBoolean (game, "hideinput")) {
Hidden ("> " + SafeXML(command))
}
else {
msg ("> " + SafeXML(command))
}
commands = Split(command, ".")
if (ListCount(commands) = 1) {
HandleSingleCommand (Trim(command))
}
else {
player.commandqueue = commands
HandleNextCommandQueueItem
}
}
]]></function>

<!--
Use this to print hidden text (i.e., in the background colour).
-->
<function name="Hidden" parameters="str"><![CDATA[
if (HasAttribute(game, "defaultbackground")) {
bg = LCase (game.defaultbackground)
}
else {
bg = "white"
}
msg ("<color color=\"" + bg + "\">" + str + "</color>")
]]></function>

Firstly, it captures all input starting with * and puts it straight to output without processing it, allowing players to put in comments (this is an improvement on my earlier version as it can handle full stops and not get overridden).

Secondly, all the input goes to the output, the player just cannot see it. This means it will be visible in transcripts (vital for beta-testing), and if the player forgets what he typed, he can drag a mouse across it and see it.

It can be turned on and off; to turn on set game.hideinput to true.

The Pixie
16 Nov 2012, 16:02
Stopping the cruft from a show menu command is not straightforward...
    // First grab the foreground and background colours, simple enough
if (HasAttribute(game, "defaultbackground")) {
bg = LCase (game.defaultbackground)
}
else {
bg = "white"
}
if (HasAttribute(game, "defaultforeground")) {
fore = LCase (game.defaultforeground)
}
else {
fore = "black"
}
// set the foreground to the same as the background
SetForegroundColour (bg)
// now it gets complicated...
show menu ("Select one:", Split ("One;Two;Three", ";"), true) {
s = "Result = " + result
}
on ready {
SetForegroundColour (fore)
msg (s)
}

When a menu chose is made, Quest shows the question text on one line, and the chosen response on the next. The question response is fine, but if you change the foreground colour inside the block, the response gets displayed in that colur too (I guess quest buffers the output of the block together, but changes the colour straight away).

Thus, you have to use on ready to ensure the block is completed, and then change the colour, and only then can you print stuff from the block.