Restoring cleared text

CrisisSDK
21 Oct 2011, 11:03
OK, I'm not sure how to phrase this question properly, but,

Is it possible to clear the scrollback of all the commands and output, but then restore it at a later time?
Basically I have a part of a game that I want to keep separate, without all the previous actions that aren't really to do with it being in the way, but after that section is completed I want to be able to restore all the stuff that was there before.
Knowing that I'm pretty sure I'd be able to have it both ways so that you could effectively swap between the two.

It's actually something I would like to do for a couple games for a couple different situations.
The one currently is because I have a computer system with a CLI based on DOS that you can use at one point, and having all the non-DOS stuff there just looks weird, but I want it so that when you stop using the CLI it will be replaced with all the text that was there before you used it, because just clearing the screen again would be annoying because you can no longer see your previous actions.

The other one is for a game I haven't started on yet that had two separate characters that you would swap between in certain circumstances, but I don't even know if I'll make that one.

A different unrelated question is, is it possible to hide/show the status bar (inventory, objects, compass, etc) during play?

Alex
21 Oct 2011, 11:33
You could do this with some custom HTML and Javascript.

Look at the twohalves.aslx demo for an example (you can play it online) - it's in the Source Code at http://quest.codeplex.com. Go to Browse, then navigate to /WebPlayer/Examples/twohalves. I've written a bit about it in the final section of the tutorial at http://quest5.net/wiki/Using_Javascript

What you want to do is pretty similar to the demo. You would want to override the addText function to write text to the currently active <div> element. Then you would need to create Javascript functions to allow you to swap between them (just toggling their visibility using jQuery), which you would call using a RunScript request.

You can toggle the panes during play using the Hide request - twohalves.aslx again has an example in its start script (because it was written before this was a Core option). Turn them on again using the Show request.

This is pretty advanced stuff so I'm happy to guide you through this if you need more help.

CrisisSDK
21 Oct 2011, 14:07
Thankyou!

It works well.