Can't get HTML pages to display???

Matt996

Member
I'm trying to create a scenario and provide player instructions. I've got the conditional triggers figured out, but no matter what I try, I can't seem to get my HTML to display in the window. The window comes up when I want it to, but it's always blank!

I've been through the HTML tutorials and have followed all the instructions, substituting my own files and HTML code. I've been hand-coding Web pages since 1994 and know HTML intimately, so I'm almost certain my problem isn't in the HTML itself but in how I'm implementing it. What would cause the code to not display? Obviously, I'm doing something wrong, but I can't figure out what!
 
Trainz HTML is not the same as Web HTML.

Could you supply a sample of your html (text code) for us to look at?
 
Here ya go:

<html>
<body>

<font size=8>Slim Mountain & Sothern Diesel Freight Train</font>
<br>
<P>You have just climbed aboard locomotive #12 on the turntable lead at Slim Mountain. Your job is to make a round trip from Slim Mountain to Robertsdale and return, with a trip out the Slimview Branch on the way to Robertsdale. You'll have both local switching and over-the-road running to do. The SM&S is a challenging railroad with lots of hills and speed-restricted curves, so even the long stretches between switching stops is going to be a challenge.</p>
<P>You will need to make up your train in Slim Mountain. First, collect the two reefers from the Sackawanna Pickle Company, then get the six loaded coal hoppers on the Slim Mountain Mining Company's interchange siding. Finally, back on to caboose #103 by the roundhouse. You want the reefers<i>behind</i> the hoppers.</p>
<br><br>
<P>This is a difficult, challenging scenario that will take several hours to complete.</P>
<br><br>
</body>

</html>
 
To get the content of HTML assets to display, you will need to add a few rules to the session: "Display HTML Pages" rule and "Set HTML Pages" rule.
The HTML pages in the asset should only contain "pointers", not the actual text. The actual text is placed in the String table inside the config file.

My advise:
Go edit the rules of an existing session that uses HTML pages, check out how they call them and what the content is in those HTML assets.
 
Hello Matt,

Click on the blog link in my signature at the right top of this message to find a simple way to setup a html page for a session.

Note this is just for instructions at the session start. For messages arriving at certain activities on your route/session you will need triggers and such and is not covered there, but it's a start. :hehe:

Greetings from rainy Amsterdam,

Jan
 
The HTML pages in the asset should only contain "pointers", not the actual text. The actual text is placed in the String table inside the config file.

Sorry to contradict you there but the HTML page(s) can contain text (as HTML tagged code) and images (again as HTML tagged code). This is the technique that I use in all my sessions without any problems. You can use string tables inside the config.txt file but I have found that to be a more complicated method, particularly if you are already familiar with HTML

My advise:
Go edit the rules of an existing session that uses HTML pages, check out how they call them and what the content is in those HTML assets.

That is good advice.

Peter Ware
 
Matt,

I cannot see anything in the code you posted that I would expect to cause problems for Trainz particularly strange interpretation of HTML. The problem is more likely to be in the Set HTML Page and Display HTML Page rules added to your session.
 
Sorry to contradict you there but the HTML page(s) can contain text (as HTML tagged code) and images (again as HTML tagged code). This is the technique that I use in all my sessions without any problems. You can use string tables inside the config.txt file but I have found that to be a more complicated method, particularly if you are already familiar with HTML
This can (and will) work nice, but the reason why (or maybe when) you "should" do it with those pointers is for translations.
You can have multiple string tables in your config file for different languages. The language setting of the application will decide which string table to be used and so with which string the pointer is repaced. It will default to the standard string table if the specific language is not available.

But I agree:
If you want to stick to 1 language only, then hard-coding the text into the HTML files is a perfectly working solution.
 
Back
Top