A couple of questions about setting up a GUI

I’m new to IF and TADS, except for having played some games a while ago. I’m interested in trying TADS3 to create a graphical adventure and I am having a hard time finding instructions to do this.

I have a couple of questions on what I want to setup as skeleton code, and I was wondering if anyone here can post a couple of entries.

I created a brand new project. I am using ADV3 Advanced as my project.

I would like to create 1 room, 1 item and I would like the player to be able to pick the item up and look at it. Also, most important, I would like to display an image. I found this link

tads.org/t2doc/doc/tads-12.html

but I have not been able to follow the directions to setup TADS3 to display the image.

and one last question. If someone can give me the example code I am asking for, can you do one more thing. It’s a bit advanced for me. On the same link above, there is an entry for banner positioning. Do I understand correctly, that I can create a TOP banner, LEFT banner and INPUT banner and I can always have an image showing up for example in the top banner? so the screen does not scroll away as the player reads and looks at the graphics? No pun intended, but like a Magnetic Scrolls Game, Like Guild of Thieves? If yes, please add an example of how I can setup the initial project for this. Everything else, I will of course go through the tutorials and as much of the books (manuals) as I can digest. Right now, I just want to make sure TADS is the system that I would like to use for such a project.

Hello, this thread was my first post, so I had to wait for it to become visible. In that time, I started going through the documentation and I am happy to say, that TADS is very intuitive, so I was able to solve most of the basic problems, such as picking up and dropping items and moving from room to room.

Also I found another thread here in this forum that had a great example for the graphics, but I still have trouble with that.

https://intfiction.org/t/how-to-add-graphics-and-split-the-screen/2476/1

The actual documentation does not easily compare to the examples in that threads recommendation.

For example, I am not even sure I know what I am doing regarding banners and graphics. The example was too customized and not based on a default project. I would still appreciate some insight on how to get graphics and banners up as a minimal project of ADV3 Advanced. If you can help, please let me know.

You are saying you are using ADV3 project (so you are using TADS 3), but this link is for TADS 2 documentation which is older and very different version of the system. Didn’t you accidentally mixed both versions? If you are new to TADS, you really should start using TADS 3, which is current and most powerfull version. Documentation for TADS 3 is hosted here: http://www.tads.org/t3doc/doc/index.htm

The example seems minimal and well written to me. I will happily explain anything about it, but please be sure you are really using TADS 3 first.

OK, I had to reinstall TADS. I have the latest TADS3 installed. I am following instructions to the best of my ability, but if you can help that would be great.

So I started an ADV3 Advanced project. I’m not going near any of the include files to make sure I only edit the file that is created with the starting room.

I would like to strip that file and make sure I only have a banner setup, with the top half being a picture and the lower half being the text. The status at the top is implied I think so I do want that there.

Even though I now know how to create rooms and items (I followed the included tutorial) - I would like to get a fresh perspective. So if you can give an example minimal example of that file with the banner setup and 2 rooms that display an image each, I would be able to take it further and get a better idea of how to correctly do this. Also, I’m a little confused if I have to use an extension. If I can do this without adding anything, since the banner file is already included in the project, that would be fine.

Something else I was looking at was the explanation that, I could write this with any text editor and use the command line compiler. Even though that’s not necessary since I am using windows, I would like to get experience trying that. That is one of the other reasons, I would like to make sure I edit as few files as necessary. I have a little programming experience in another language, but I am still new to this.

Compilation is done using t3make.exe. Project files (*.t3m) are in fact nothing more than a list of command-line options for t3make.exe.

“t3make.exe -help” will list available options.

ADV3 advanced project should generate practically minimal game source for you. Stripping comments (and unnecessary GameID properties) you should have basically this:

#charset "us-ascii"

#include <adv3.h>
#include <en_us.h>

versionInfo: GameID
;

gameMain: GameMainDef
    initialPlayerChar = me
;

startRoom: Room 'Start Room'
    "This is the starting room. "
;

+ me: Actor
;

This is smallest complete game you can compile and run, of course without banners. It has one room, player character and nothing else.

Now if you look on source code of the bannerdemo made by RealNC, you should realize that it is actually exactly what you are asking for. That is a minimal game source using banner with picture for each room. Lets look on the source code together. Following bits of code are those interesting:

First there is a pictureWindow object which is a definition of the picture banner. This piece of code you need to teach TADS to use layout with banner window between top navigational banner and bottom game window:

pictureWindow: CustomBannerWindow {
    // Is the interpreter able to display JPEG images?
    canDisplay = (systemInfo(SysInfoJpeg));

    // Banner properties.  These are documented in lib/adv3/banner.t.
    //   The banner has no parent (nil).
    //   Put the banner after (BannerAfter) the statusline (statuslineBanner).
    //   Make it a text banner (BannerTypeText) - can also display images.
    //   Display the banner above the main window (BannerAlignTop).
    //   Don't use an initial size for the banner (nil).
    //   Use absolute size units (BannerSizeAbsolute) - we don't care about this, since
    //     the previous argument is nil, but we still need to specify this argument.
    //   Use a visible border to visualy seperate the banner (BannerStyleBorder).
    bannerArgs = [nil, BannerAfter,  statuslineBanner, BannerTypeText,
                  BannerAlignTop, nil, BannerSizeAbsolute, BannerStyleBorder];

    // Make the banner automaticaly rerize to fit its contents.
    autoSize = true;

    // Initial graphics.
    currentContents = '<img src="img/path.jpg">';
}

Next you need to define enteringRoom method on every room to instruct TADS to change pictures every time player moves between rooms:

    enteringRoom( traveler )
    {
        pictureWindow.updateContents('<img src="img/path.jpg">');
    }

And that’s all you need to do in source code to incorporate such picture banners. Rest of the banner demo source code is plain simple minimal game such as shown above. There are however two additional needs. First you must add customBanner.t extension to the build and second you must add images as resources to the project.

I’m sorry it took this long for me to respond. I want to say thank you, I followed the directions and everything works great. I did come up with a question though.

When running the project, the initial window size of the built in TADS Interperter is not the right size. This is ok, I just manually resize the window, but is there a way to get the window to open up at the correct size to display the starting image? Title?

Also as a side note if another beginner is reading this. I got a whole bunch of compile errors which I was stuck with until I read (lol) the error message. You have to move the extension that you include, to after the main game file. The order of compilation depends on how it is in the source outline.