I have an Object called 'Memories', that I would like to store the Screen to every time the Screen is Cleared.
Using 'Memories' should allow me to Read through the entire Record of my Playthough.
'Memories' should be updated regardless of whether or not I have it in my Inventory, or where it was Dropped, or if it exists inside another Container Object.
How would I go about this?
I like having my Screen Cleared every time I Use an Exit but would still like to be able to Read through the Sequence of Events of the Game Session if I have my 'Memories' with me.
There is a transcript included in the game; but that often has stability issues with the online player (because the entire transcript is stored in the web browser, and has to be sent back to the server when you save).
One alternative might be… (assuming you're using the desktop editor) to modify two built-in functions, OutputTextRaw
and OutputTextRawNoBr
. These are used whenever text is sent to the screen. Which means that you could use them to store a copy of all text you output into a string attribute, which can then be displayed when the player uses the memories object.
If you want to put it in the description for the object, your modified functions might look like:
<function name="OutputTextRawNoBr" parameters="text">
<![CDATA[
JS.addText("<span style=\"" + GetCurrentTextFormat("") + "\">" + text + "</span>")
RequestSpeak (text)
memories.look = memories.look + text
]]>
</function>
<function name="OutputTextRaw" parameters="text">
<![CDATA[
format = GetCurrentTextFormat("")
JS.addText("<span style=\"" + format + "\">" + text + "</span><br/>")
if (GetString(game, "commandbarformat") <> format) {
ResetCommandBarFormat
}
RequestSpeak (text)
memories.look = memories.look + text + "<br/><br/>"
]]>
</function>
However, I would still beware of putting all of the text into a single attribute. It's possible that sending so much text at once could still create issues, especially if the player is on a slow connection.
I wold suggest making a list attribute, and putting each room's text into a new string. That way, the memories object can display a list of "pages", and allow the player to display one at a time.
If you're interested in this solution, I could probably put some code together for it fairly quickly.
Definitely go with mrangel's alternative methods.
There are serious issues with the transcript in the desktop player, and different serious issues with it when using the web player. (This will all be fixed in the next release of Quest.)
Also, his alternatives would probably just work better for this, anyway.
Oh… I notice that looking at memories will cause a copy of the text to be printed to the screen. This would be problematic, because it could make the size of the save file increase exponentially.
It might be necessary in this case to give the object a look script which suppresses the recording of new memories before printing the old ones.
I wold suggest making a list attribute, and putting each room's text into a new string. That way, the memories object can display a list of "pages", and allow the player to display one at a time.
If you're interested in this solution, I could probably put some code together for it fairly quickly
It might be necessary in this case to give the object a look script which suppresses the recording of new memories before printing the old ones.
I would appreciate that, thank you. ... If it isn't any trouble.
I hardly know anything of what is possible, so please excuse my ignorance (and my lack of ability)...
Essentially, I wanted the 'Memories' object so that I could scroll back to read what had happened...
When setting up the 'Game' under 'Room Descriptions', I ticked:
'Clear screen when entering a room'
Simply because it made everything look neater and more pleasing to the eye - aesthetics is very important to me, and this way I can write each room to fit within the space available.
Is there a way to have a second instance of the Game Running where that option isn't ticked, and looking at 'Memories' opens a separate window containing that Game instance? (Or switches Focus)
Perhaps I have another object called 'Focus' that switches to the Game Instance where 'Clear Screen when entering a room' is ticked.
... Using 'Focus' while in this instance does nothing.
... Using 'Memories' while in the other instance does nothing.
And One could play the Game in either instance, with full Memory Recall, or with Full Focus... and it's still the same Game?
Is this Possible?
That's pretty much what the transcript does; it makes clearing the screen hide text rather than deleting it, so that it can be displayed again later. The problem with this method is that because the text is still present but hidden, it needs to be saved whenever a player saves the game. This can become unstable with longer games or players on a slow commection; making loading and saving fail.