HTML index

Ben1337

Trainz operator
I've recently created a session series for multi player called "Hawes Automatic" based on the Hawes Junction map, but my friends are struggling to find their way around it as they don't actually know it.

Soo, what I thought was creating a HTML asset, containing maps of the track layout of the various locations around the map including Wharton, Dent, Garsdale, Hawes and eventually, AisGill.

And a wild idea struck me, what if there was some sort of "Index", you know, a page with all of the locations of the route summarised, with links to view the actual track layout in detail. :D

Soo, I went digging and found this http://forums.auran.com/trainz/showthread.php?82205-HTML-asset-for-sessions-tutorial, http://members.westnet.com.au/nightcrawler/trainz/tut-html-page.htm, http://htmldog.com/guides/html/beginner/, http://htmledit.squarefree.com/.

Which is a great start, because it taught me how to read the HTML code that other people have written, see how they were built and how they function within the asset.

The problem is, most sessions are built with a set-sequence in mind, which makes the "Next" / "Prev" / "Done" page system incorportated, by default, into trainz 12, is not ideal for a multi player session, where you make up your own jobs based around the industries.

I notice in a lot of the older sessions, that they have placeholder "$0", "$1" and "$2" tags in the .html file, which are then referenced in the config string file, along with a link.

I assume that the link refers to a link based in trainz itself, due to the "live://" root, which isn't documented anywhere within any of the resources I've been able to find and use.

So, I'm not sure how to refer to other .html pages in trainz in order to make the index work within the "Home" and child pages.

Are there any examples that you've herd of which I can learn from, or could you advise me on what I could use to refer to other pages within the same .html file?
 
Some information on the minibrowser used by Trainz is available HERE (Minibrowser) and HERE (Scripting).

Peter
Hmm, it does mention about the live:// issue I had, I'll do some experiments with HTML to see if I can make the indexing work
Hi

The other thing you could do is download the PDF Guide "S&C Track Plans" http://www.trainzclassics.co.uk/ which has all the trackplans for the S&C route.

Regards

Brian
And here I was trying to build my own map
JZ9bTxb.png

Like a good Samaritan, trying to keep to the old british signal box diagram style http://www.signalbox.org/diagrams.php?id=699 whereas I could simply download the .pdf file, and use the very same program I used to create this to extract the images and use them in the project.

Also, I can't help but notice Wharton isn't noted anywhere, but then again, it is Trainz Classics 3 and not Hawes Junction, but other then that, and the missing Junction at Garsdale, to allow access from the exchange sidings to the loop, dent has additional cattle and refuge sidings, AisGill sidings don't have the facing junctions junctions from the main onto the refuge sidings.

But other then that, they're good to use.:)
 
Last edited:
I had a pretty good go at the HTML code, but I'm afraid that I'm still not exactly getting it.

I got all of the .html files to appear sequentially in the MiniBrowser, along with all of the sub windows and their text.

The links seemed to format correctly, but remain unclickable (I click on it, but nothing happens), and I don't exactly know where I went wrong, but I feel it's something to do with the links.

Since I don't really expect you to guess what the problem is, I'll jsut send you the HTML code I quickly made up as an experiment, showing you the exact code would help find my problem sooner.

So, I will show you the main config file, the home page and the child page:


  • Config File:
    Code:
    kuid                                    <kuid:127291:100004>
    username                                "Hawes Junction Automatic HTML"
    trainz-build                            3.4
    kind                                    "html-asset"
    category-era                            "1960s"
    category-region                         "00;UK"
    category-class                          "YH"
    
    
    string-table
    {
      html-page-0                           "home.html"
      html-page-1                           "hawes.html"
      html-page-2                           "dent.html"
      html-page-3                           "garsdale.html"
      html-page-4                           "aisgill.html"
      html-page-5                           "wharton.html"
    }
    
    
    thumbnails
    {
      0
      {
        image                               "images/thumbnail tut_2i_coalheap.jpg"
        width                               240
        height                              180
      }
    }
  • Home HTML:
    Code:
    <html>
        <body>
            Home<br>
            <a href=live://html-page-1>Hawes</a><br>
            <a href=live://html-page-2>Dent</a><br>
            <a href=live://html-page-3>Garsdale</a><br>
            <a href=live://html-page-4>AisGill</a><br>
            <a href=live://html-page-5>Wharton</a>
        </body>
    </html>
  • Child HTML:
    Code:
    <html>    <body>
            Hawes<br>
            <a href=live://html-page-0>Home</a>
        </body>
    </html>

Edit: Please also note that I have also tried:
Code:
<html>	<body>
		Hawes<br>
		<a href=live://home.html>Home</a>
	</body>
</html>
Which was equally unsuccessful.

I don't really know where I went wrong, I hope you can guide me to the problem.:confused:
 
Last edited:
You need a script, which has to handle the messages sent by the browser. The minibrowser has only limited capabilities, and requires a script to handle references.

Peter
 
As p-dehnert says, the mini browser built into Trainz has very limited capability. You cannot add links in its pages in the same way that a normal web page/browser works. The left arrow and right arrow buttons at the bottom of a page that move you to the next or previous pages use a script to perform their actions.
 
Lets be honest here, I've always wanted to try to avoid using trainzscript, due to its complexity with producing "Hello World" on the screen.

For example: http://online.ts2009.com/mediaWiki/index.php/Hello_World,_Setting_Up_An_Asset_Script.

In order to produce the "Hello World" message, you need to produce an error as a result, compared to using a "print(String)" function in other languages, to put in the message box.

Also, there doesn't seem to be any ability for you to comment on your script.

Apart from that, trainzscript tends to produce script errors, which, while I admit produces hilarious results (trainz overrunning stations, other trains getting lost, and the portal script breaking, causing trains to be ejected in random formations.), makes the simulator as a whole, less serious.

I guess, as a whole, I'd really love to see trainz implement a more professionally done scripting language, like LUA, and get a commercially done engine, trainz JET is far too old for this kind of work.
 
Back
Top