HTML asset for sessions tutorial

Don't forget that the best reference source for Trainz particularly peculiar brand of HTML is at http://online.ts2009.com/mediaWiki/i...p5/MiniBrowser

Peter Ware

Yes! There is also a "try it" link in the TD section that gives instant feedback on most formatting.

Context can also help with HTML formatting.

I've found formatting with N3V's HTML rather frustrating and requires a lot of "try and see". Take note of the comments on the wiki about using a empty row of data fields. That can be useful.

I find it helpful to pad out and indent HTML tags so that I don't miss closing tags. For example:

Code:
<html><body><table>
<tr>
  <td>
    <trainz-object id='br_buffers' style='browser' width=350 height=80>
   </td>
</tr>
</table></body></html>

This is part of some html I wrote for Mick Berg's Battery Loco recently.

Paul
 
Hi Pware,

I'm having an issue with the first p[art of your tutorial

I have followed you lead...
changed a few names for my purposes..


Error: The Tag 'string' is not permitted within a container of type 'html-asset'.
Error: The Tag '{' is not permitted within a container of type 'html-asset'.
Error: The Tag 'html-page-0' is not permitted within a container of type 'html-asset'.

my config file is as follows
Code:
kuid                                    <kuid:609955:100374>
username                                "port of brisbane"
trainz-build                            3.4
category-class                          "YP"
kind                                    "html-asset"

thumbnails
{
  0
  {
    image                               port.jpg
    width                               240
    height                              180
  }
}

string-table
 {
  html-page-0                           "port.html"
  
 }

so I"m not sure but I believe that the config is basically the same as yours...


I'm using TS12 as you can see.. I used context editor for my html and config as I can set it up to reflect the file type
 
OK Targaron, I cannot see much difference between the two (yours and mine) config.txt files except that I have quote marks around the name of the jpeg image file.

From your error messages it would seem that the problem is before the string table (since it rejected the string table) - so try putting the quotes around the port.jpg
 
Thanks, done it with ts2010, I changed the font color to yellow, it came out white and was much easier to read, to my eyes at least.
Could not change the background colour.
Rog
 
Could not change the background colour.
Rog

I don't think it is possible to change the background colour in a Trainz HTML asset. I use the tag ..

<body bgcolor="#000000">

at the top of the web page to change the background colour to black for viewing in Firefox (to simulate a dark page background). It has no effect in Trainz. I then set the font colour ..

<font color="#ffffff">

... to white to give an easier viewing white text on dark background in Trainz.

Peter Ware
 
Yes, with the config.txt and HTML files it is usually the simplest things that are the most annoying.
 
Sequential HTML Pages

I have been trying to figure out, but to no avail, how to set up html page instruction for operations in a yard. What I would like to do is have the first set of instructions remain on the screen so they can be followed until the task is complete. Then, upon completion of the task, have that set ofinstruction triggered to disappear and the next set of instructions to appear, to again remain on the screen until the second task iscompleted, and so on.


I am not sure where I am having the problem. It seems I can trigger them to appear but not disappear (i.e., the user has to close the page) when using “Display HTML Pages” with “Set HTML pages” or a specified time has to be entered when using “Timed HTML Pages”.


Any ideas?


Cayden
 
Any ideas?
You probably already tried this, but here it goes anyway:
Add this rule after the trigger that actives when the last part if finished: "Set HTML Pages". In the "Set HTML Pages", select the first option ("Instruct the sequince browser to...") and select "Page operation: Close".
 
It seems I can trigger them to appear but not disappear (i.e., the user has to close the page) ... or a specified time has to be entered ...

I think that that is the heart of the issue - closing the pages without using a timer or relying on user action. The "Set HTML Pages" rule has many different options that I have not explored (and for which there appears to be no documentation) and the solution, as suggested by Oknotsen, may lie there. Failing that you may have to rely on 3rd party rules to achieve the effect but some of the earlier (i.e. 2004/2006) 3rd party rules do not appear to work under 2009 and later.
 
Why not just use the "Set HTML Pages" rule with multiple pages. To get to the next page, user just clicks on the arrow at the bottom. You can set the window specs to keep it always open.

Look at some of the built-in routes HTML files for examples.

I really like yard operations. Just out of curiosity, what type of things are you displaying?
 
I think that that is the heart of the issue - closing the pages without using a timer or relying on user action. The "Set HTML Pages" rule has many different options that I have not explored (and for which there appears to be no documentation) and the solution, as suggested by Oknotsen, may lie there. Failing that you may have to rely on 3rd party rules to achieve the effect but some of the earlier (i.e. 2004/2006) 3rd party rules do not appear to work under 2009 and later.

I've tried the "close" under the "Set HTML Pages" every way I can think of and haven't got t to work. I am inclined to think pware is right when he says "closing pages [i.e., either close or move to the next page] without using a timer or relying on the user action [is not possible]."

To answer dap's question, I am attempting to set up sessions for the MBC 2010 route for a new release. The new version of the route has:
• Fixes and improvements
• A signalling system
• Interactive industries
• New portals for the Connaught and Macdonald Tunnels and the Shaughnessy Viaduct by bnsf50 (see DLS).
 
Hi Peter,
I just wanted to say thank you for this tutorial. You done a magnificent job in explaining how to create this asset. Adding html instructions and warnings has given a brand new dimension to my sessions. Without this Tutorial I could not have done it. Your work and imput has been much appreciated
Charles
 
Hi Peter,

I need your help if you don't mind -- for the last hour or so I have been trying to figure this html out, etc to no avail -- back in the old T04, etc I had it all worked out, but that was a long time ago -- instead of using notepad to document everything I would like to use images -- back with T04 I used photoshop, with all of the current info, and then saved it as a webpage image, etc ... but it's not working here! I tried a jpeg image to see if the html will bring it up, and this too has failed! The html does display in driver but it's empty ... no info! CMP commits without any errors, too!

In a nutshell, I would like to use images (with the info display instead) and have the html work that way!!!

Any help and/or gudiance would well recevied and appreciated it!

(It's for my Marsz Presentations layout, in which I am making models at this time)

Thank you for reading this post!
Ish
 
Ish,

A couple of obvious questions on points that have caused issues before - forgive me if they are "Homer Simpson" DUH type questions.

Are the html page(s) and image(s) saved as files in the HTML-Asset you have created? JPEG images work just fine in TS12 - PSP and PNG do not.
Are the images correctly tagged in the html file?
Have you correctly named and tagged the html files in the config.txt string-table ?

Could you post your config.txt and a sample .html file here in this forum for me to look at?

Peter
 
Ish,

A couple of obvious questions on points that have caused issues before - forgive me if they are "Homer Simpson" DUH type questions.

Are the html page(s) and image(s) saved as files in the HTML-Asset you have created? JPEG images work just fine in TS12 - PSP and PNG do not.
Are the images correctly tagged in the html file?
Have you correctly named and tagged the html files in the config.txt string-table ?

Could you post your config.txt and a sample .html file here in this forum for me to look at?

Peter

Hi Peter,

Below are screenshots of what I have in the config file, and in the explore window in CMP!
Yes, sir, all images are jpeg extensions!

PETE1.jpg


PETER2.jpg


I am going to assume that in the config file, the html string-table will displayed the html images, in that, a html file is not needed then? Please let me know if I am wrong or right on issue!

Thanks a lot Peter
Ish
 
Last edited:
The .html file is needed. Because it is in the string-table Trainz will load and display it - if the file is empty then nothing will be displayed. The thumbnail image you have created, "marz presentations.jpg", is NOT the image you will be displaying in the web page - it is the image that the DLS will use when showing your asset for others to download and it will be used by CMP when displaying the installed assets.

Using your example, I would create the html file "marz presentations.html" with the following contents - and using an image file I have named "marz instructions 1.jpg" containing your instructions with width and height (arbitrarily selected for the example) at 600x450).

<html>
<body>
<img src="marz instructions 1.jpg" width="600" height="450" border="0">
</body>
</html>

Let me now how this goes.

Peter Ware
 
Back
Top