Trying to Port to WebUI

So I figured tonight it was time to try recompiling a recent game of mine (written in 3.1) as a WebUI project.

To start the process, I created a new project, using the WebUI option in the opening “start a new game” dialog boxes. I chose an Advanced WebUI game. When I compile this starter game using “Compile & Run”, the game-testing/player window opens twice. One of the two windows has a little red banner at the bottom that says, “Error - Details | Ignore”. This is not encouraging, as it strongly suggests that Workbench does not actually know how to run even a bare-bones starter version of a WebUI game.

Now that I’ve imported all of my source files into the new project and arranged them nicely so they compile, what I find is that each time I use Compile & Run, an additional interpreter window opens. The previous one is not closed; instead, it acquires the little red banner at the bottom.

This is with Workbench HT-22, build Win116, TADS 3.1.0. I’m not seeing any text in the TADS website that suggests a more recent version of Workbench exists. I’m using Windows 7.

The error is:

User error? Workbench bug? Suggestions welcome.

Not sure why it would launch the game twice on the first Compile & Run. What you’re seeing on subsequent runs is an artifact of the client / server model that Web UI uses. When you click Run, Workbench loads the server in the background and opens a browser window that connects to that server.

When you click Run a second time, Workbench stops the old server and starts a new one. But if you left the old window open, then the browser catches the shutdown event that the old server sent out when it was stopped. It shows an error message because it treats this as an error condition - it’s as though you were playing on an Internet server and the server shut off halfway through your game session. There’s nothing the client can do about this; all the game logic is on the server and now the server’s gone. All it can do is report what happened and wait for you to close the window.

You didn’t specify but I assume that the “new” window that appears every time you click Run works correctly, and only the “old” windows show the red error bar. If the game never shows up in any window, that’s a different and much more serious problem.

I am mixing the terms “client” and “window” and “browser” freely and I apologize for any confusion that causes. Think of the window that appears when you click Run as an Internet Explorer browser window with the address bar and all the interface buttons hidden. This is the client; you won’t actually see the server unless you start the game through the command prompt.