This question comes in two parts. But first, a bit of background.
My recent games were written in TADS 2; a great platform, which I was able to learn by stepping through code as it ran, and thus learned what to override and how. Recently, I’ve begun using TADS 3, which is not nearly as small, simple, and/or easy to step through - making figuring things out a wee bit tougher.
So, my first question: The player’s window is a split screen, left and right. Is it possible to tie each screen to an NPC, so that everything sensed by that NPC is displayed in that screen? That is, if the player types “open door”, NPC 1 opens the door (“Opened.”), and NPC 2 sees it opening (“You see a door open.”)
Obviously, the first NPC is easy, but what about the second NPC? I’m assuming I’d need some sort of PromptDaemon to write it all down in the right window, but I’m a bit at a loss as to how to do it.
My second question is, how possible is it to attach the command prompt to two screens at once? That is, NPC 1 is controlled by clicking on screen 1 and typing, and NPC 2 is controlled by clicking on screen 2 and typing. Obviously, if the first part is impossible, this won’t apply; however, if this part is impossible, I can always write a simple workaround (make the ‘switch to’ command not take any turns, etc.)
I don’t think the TADS screen model allows line input in anything but the main game window. Banner windows (what you call screens) can take character input, but that doesn’t help you much.
One approach to separating the output would be to have two global window variables (gPlayerWindow and gObserverWindow) and two banner windows (npc1Window and npc2Window). Whenever you promote NPC1 to the PC, set gPlayerWindow to npc1Window and gObserverWindow to npc2Window. And vice versa when you make NPC2 the PC.
Then just write two responses in every one of your action() methods, one that prints to gPlayerWindow to acknowledge the command, and one that prints to gObserverWindow to report what happened.
You’ll need to deal with the default library messages at some point, but I’d get a proof of concept up and running first.
That’s pretty much what I’d assumed… I’ll probably end up using three banners, one for the command prompt, one for NPC1, and one for NPC2. Good idea about the variables, though, that’s definitely how I’ll do that.
The fun part will be hacking the response library… I’d like to make the interpreter do as much for me as possible, but I’m not completely sure how to get it to parse the command and show all the appropriate information for the player, then go back and show it all again with the player as an NPC. I’ve got an idea, but right now the programming prospects aren’t entirely pleasant. Hopefully that will change