css syles and adv3lite

Before I started with lite, I was getting introduced to IF with the original library and I found that I could utilize the typography trick of having an enlarged initial cap at the beginning of a story section…

roomFirstDesc = "<.p> <style> p:first-letter { font-size: 300%; } p:first-line { line-height: 100%; } </style> <p>Harry barely glanced at the sparsely decorated lobby---threadbare carpet; dirty stained couch and matching chair with worn upholstery that might once have been plush, now flattened and lumpy with age and too many rumps. A tarnished brass floor lamp with a once fashionable now tattered fabric shade stood between couch and chair. </p>

That produces a paragraph of text where the beginning H is 3x the size of the rest of the text, magazine style. I liked that. But I have been unable to get the same results with lite. When I copy that exact same text into a lite project, the game window displays the markup, not the stylized text the markup is supposed to represent.

Is that something that could be restored with the flip of a switch or would it take too much coding effort?

(BTW, I have downloaded adv3lite08 and Workbench 3.1.3; looking forward to it.)

I can’t get this to work with the original library either. According to the HTML-TADS documentation (see http://www.tads.org/t3doc/doc/htmltads/deviate.htm#unimplementedTags) the tag isn’t implemented in HTML-TADS, so I’m a bit mystified how you were managing to get it to work in adv3. There shouldn’t be any difference between adv3 and advLite in this respect in any case, since it’s the interpreter that does the HTML rendering, not the library.

Actually, your version with the tag does work if you compile the game for the WebUI, so this may have been what you were doing with the original (adv3) library. If you set up an adv3Lite WebUI game it’ll work there too (I just tested it).

One difference between adv3 and adv3Lite that would be relevant to the code you posted, however, is that there’s no roomFirstDesc property in adv3Lite, so defining this property on a location won’t do anything (unless you explicitly add your own code to display it somewhere).

If you’re not writing a WebUI game, you may be able to get at the effect you want with a tag; this seems to do something like what you’re asking for:

 desc = "<font size=6>H</font>arry barely glanced at the sparsely decorated
            lobby---threadbare carpet; dirty stained couch and matching
            chair with worn upholstery that might once have been plush, 
            now flattened and lumpy with age and too many rumps. A
            tarnished brass floor lamp with a once fashionable now tattered
            fabric shade stood between couch and chair. "

(I assume you’re aware of the distinction between the WebUI and the traditional interface as discussed in the TADS 3 System Manual; exactly the same distinction exists in adv3Lite as in adv3).

Great! I hope you get on with them well!

Yes, that must be it. When I began working in Workbench, I was selecting web template but I kept getting frequent workbench crashes related to the web UI. I stopped using the web template, and the crashes disappeared.

I’m not sure why the initial cap styles still work, but they do.

The font tag works, though, that’s good enough. Thanks.

re: roomFirstDesc, yes I just found that out. I’m working on a work around as we speak :slight_smile:

I imagine you’ve already found a work around by now, but what I imagined people would do (and why I therefore took roomFirstDesc to be redundant) was simply to make use of a <> <> construction in their room descriptions, like so:

somePlace: Room  'Some Place or Other'
   "<<one of>>"This is the initial room description, shown the first time.<<or>>This is the room description that's shown thereafter.<<stopping>>. "
;

Incidentally I note that you’ve been putting a lot of tags in your room names to make them display as green. If you want them all to display in green, you might want to consider modifying the roomnameStyleTag instead, like so:

modify roomnameStyleTag
    openText = '\n<b><font color=green>'
    closeText = '</font></b><br>\n'
;

The advantage of this is that you only have to do it once in your game, which then saves you the bother of having to add tags to each and every room name. (This isn’t peculiar to adv3Lite, btw; you could do exactly the same in adv3).

I did find a workaround for roomFirstDesc—description is defined as “<>” and getDesc() returns different text depending on condition of true/false properties and gRevealed() flags—but I think I like your <> <> construction suggestion at least as well if not more than my solution.

But I did not know about <> <>.

Is there a comprehensive list somewhere in the documentation of valid << >> syntax?

Thanks for the roomnameStyleTag modification trick. Works great.

Yes, but it’s documented in the TADS 3 System Manual (some way down the page), not the adv3Lite docs, as it’s part of the TADS 3 language, not of one or other library.