TrainzOnline:Using AsetX to create MOSIGNAL Config Files

From TrainzOnline
Revision as of 22:28, 17 April 2018 by Glt0145 (Talk | contribs)

Jump to: navigation, search


AssetX - Mosignal Tutorial

This tutorial is a how to guide on using AssetX to create config files for mosignal assets for the Trainz simulator. Each tag is added by right-clicking on the appropriate word in the config file and then selecting “add tag to container" from the popup menu. Doing this will display the primary dialog box where all the tags are listed. This is the best way to add tags to the config file.

1.Select Asset Menu and the select New Asset

2. In the dialog box You need to add the following information

2.1 The KUID for the asset. This will your user id and the actual Id of the item. Example 00000:0000001. The second part of the number must be unique. It must not have been used before in any type of asset you have created. The actual sting you enter must be <kuid:xxxxx:yyyyyy> or <kuid2: xxxxx:yyyyyy:z>. The xxxxx is your userid. The yyyyyy is the number you are going to use. The z is the version number of the asset. If this is the first version the z must be set to 0.

2.2 The asset kind must be selected from the drop-down box. Make sure you select the appropriate type. In the case of a signal asset it is mosignal.

2.3 Location. I use a subdirectory in the folder where I am creating the asset. You cannot use the editing folder in the Trainz installation. It is locked by Trainz and AssetX does not allow this folder to be used.

2.4 Enter a folder name for the folder to be created in the location you have selected.

3 When you are happy with the selections you have made, press OK to create the basic config file.

4.You should now show on the screen the basic config file with two lines in it. It is now a matter of adding the rest of the tags.

5. Right click on the word config.txt it the top right pane. This is where each of the tags will be added to complete the config file. From the selection in the dialog box select "username". Enter a username in the right of the dialog box. try to use a name that is not to long but is descriptive enough to allow a user to be able to work out what the asset is. This name is what is seen in the Trainz simulator when you add an asset to a map. When you have entered the username press OK to add to the config file.

6. Next add trainz-build tag. You have to select 3.5 and above to meet the minimum standard to be able to upload to the Trainz Download Station. Any number lower than this is rejected by the download station.

7. Next we will add the “function” tag. Right click config.txt. From the dropdown box select function from the dropdown list. press the Ok button to add the new tag. This tells Trainz that the asset is a signal.

8. Next add the “trackside” tag. Right click config.txt. You can use the spinners to change the value or you can type it in. A positive number puts the item on the right-hand side of the track. A negative number puts the asset on the left-hand side of the track. The left and right is as seen by the driver when looking out of the locomotive in the direction of travel.

9.Now add we need to add a “light” tag. Right click config.txt. This is different to the light tags used under "lights" container. Set this value to 1. This is the link [[1]] to go the Wike trainzonline if you want to know more about this tag.

10. Next to add is the main “mesh-table” container. Right click on the config.txt. Select it from the dialog box and add it. You will notice that this shows a "+" sign in the config file next to it. This means there are sub tags to go within the container.

10.1 Right click the mesh-table tag and select "add tag to this container" from the pop-up menu. The dialog box that displays should have "default" as the selected item. In the right-hand side, the word "default" is entered in the text box. Press of to add the tag to the config file.

Before you go any further, copy your files that make up the asset to the directory you are creating the config file in. These will include any graphics files used by the asset, the actual im file and any text files that reference the graphics files. If you are using Blender to create the signal, the Trainz exporter will create some of the text. The ones that won't be created are the reference files to the coronas (signal lights). These will need to be created separately. in a text editor. See this link to learn about "texture.txt" files. See [Wikipedia:online.ts2009.com/mediaWiki/index.php/.texture.txt_Files|texture files]] . Once you have all the files copied you can continue creation the config file.

10.2 Right click on the word "default" in the config file. Now in the dialog box select "mesh-table". A dialog box will display. In the dialog box use the drop-down box arrow on the right side to select the mesh (im) file for the asset. If it is not listed in the drop-down box, you have not copied the files to the directory that contains the config file. See previous paragraph. Now click Ok to add the mesh information to the config file.

10.3 Next you need to add auto-create to the config file. Right click "default". In the dialog box select "auto-create". The value for this is 1. When setting the value to 1 the asset is visible by default. If you set it to 0 the signal will not appear in the map when it is loaded. Setting it to 0 allows it’s visibility to be controlled by scripts.

10.4 All of my signals have name plates on them so we need to reference these nameplates so you can add a name to a signal in Trainz. Select the “default" tag under the "mesh=table" and right click it open the pop-up menu. Select "add tag to container". In the list select "effects". This is a sub container of "default".

10.5.1 Select "effects" and right click to show pop-up menu. Again select "add tag to container". In the popup dialog box, you only have one choice. This is "effects-name". On the right-hand side of the dialog box enter the number 0. This the first used by Trainz. All Trainz list start with 0.

10.5.2 Now right click the number tag and select add tag to container. This time in the drop-down list select "kind". On the right-hand side of the dialog box select "name" Press OK to add.

10.5.3 Do the same again select the "0" and right click and select "add tag to container". In the dialog box select "att". in the right-hand side drop down list select the attachment point name. this attachment point name must conform to Trainz standard naming convections or it will not work. In this case it has to be "a.name0".

10.5.4 Do the same again select the "0" and right click and select "add tag to container". This time select "name". In the right-hand side of the dialog box leave the word "name". This allows it to be changed in the simulator. Changing it to anything else will not allow it to be changed in the simulator.

10.5.5 We need to specify the font and colour of the text. Do the same again select the "0" and right click and select "add tag to container". This time select "fontsize". Use the spinners to adjust the fontsize. From experience 0.07 is the right size for the font.

10.5.6 Do the same again select the "0" and right click and select "add tag to container". This time select "fontcolor". When the dialog box opens the right-hand side shows 0,0,0. This is the RGB values these values would show the text in black. What we need is white so the values need to read 255,255,255. You can press the little button between the drop-down list box and the text box and a colour dialog box will appear allowing you to select a colour from the charts or use the sliders to create a custom colour. clicking OK will close the dialog box and add the font colour entry to the dialog box.

Okay that is our mesh container taken care of. Next, we will move onto Lights container. this container holds the information about what collar corona is displayed for each signal lamp. Your signals need to be number consecutive starting at a.light0 - to a.lightXXX. I have found that Junction route indicator lights must be referenced first in the mesh then the main signal lamps.

11.1. Right click "config.txt" at the top of the config file and from the pop-up menu select "add tag to container". From the dialog box select "lights". Make sure you do not select "light". Press OK to add to file.

11.2.1 Right click "lights" that was just added to the config file and from the pop-up menu select "add tag to container". In the dialog box that pops up the right-side shows "light number". In the left side the words "light number" appears. Delete the text and enter a number, starting at "0" for the first light. Again light numbers are entered sequentially starting a 0.

11.2.2 Right Click on the number tag you have just created. Select "add tag to container". The dialog box that opens will allow you to select a texture file that references a signal corona. Repeat this process until you have added all the lights. So for a 2 aspect signal there would be only two.

12.1 Once adding the lights is complete the next container to add is "signals". Right click the config.txt text and again select "add tag to container" from popup menu. Select "signals". This container is used to tell Trainz which coronas to display for each signal state.

12.1.1 Now select the word "signals" and right click to display the popup menu. Select "add tag to container". When the dialog box opens you need to select "signal number". This corresponds to the aspect (state) of the signal you want it to show. The link below takes you to the page with the information about the different signal aspects that can be displayed. See this link [aspects]

12.2 You now need to add to the config file what coronas to display for the given signal aspect (state). Right click on the number you just added to your config file. Select "Add tag to container". From the dialog box you can now add the coronas that you want to light up for that signal state. If there is more than one corona to display then each has to be separated by a coma. These numbers are the ones you create under the "lights" container. See 11.1 to 11.2.2 above.

13. Next we will add the "category-class" to the config file. Right click on the config.txt text at the top of the config file and from the popup menu select "add tag to container". In the dialog box select "category-class" from the dropdown list box on the right half of the dialog box. Now in the left-hand side of the dialog box, from the drop-down list box you need to select "WA-Signalling". This is the only code that will allow the signal to work.

14. Next you need to add the category-era. Right click on the config.txt text at the top of the config file and from the popup menu select "add tag to container". In the dialog box select "category-era" from the dropdown list box on the right half of the dialog box. In the right had side of the dialog box is a list of eras. Click on each on you want to add to the category-era. Clicking them a second time will deselect them. Press Ok when you have the eras selected that you want.

15. Next you need to add the category-region. Right click on the config.txt text at the top of the config file and from the popup menu select "add tag to container". In the dialog box select "category-region" from the dropdown list box on the right half of the dialog box. In the right had side of the dialog box is a list of regions. Click on each on you want to add to the category-region. Clicking them a second time will deselect them. Press Ok when you have the regions selected that you want.

16.1 The last item you need to add to make the minimum required is to add a "thumbnails" container. this contains the information about the thumbnail image. They are generally 240 wide x 180 high pixels. Normally they will be a jpg file. If you are using PEV Mesh viewer you can use it to make a thumbnail image. Right click on the config.txt text at the top of the config file and from the popup menu select "add tag to container". Select "thumbnails". Press Ok to add to config file. A thumbnail is a small image of your asset that is used to view what your asset looks like with the simulator addition window.

16.2 Right Click on the word "thumbnails" and then select "add tag to container" from the popup menu. When the dialog opens enter a number for the first thumbnail in the right-hand text box. The first number to use is "0". Click Ok to add the number.

16.3.1 We need to add three sub tags under this container. They are height, width and image name. Right Click on the number and then select "add tag to container" from the popup menu. In the dialog box on the left side select "height" in the right-hand text box type in or use the spinners to adjust the height of the thumbnail image. The height is normally 180. Click Ok to add text to config file.

16.3.2 Now we will add the width to the config file. Right Click on the number and then select "add tag to container" from the popup menu. In the dialog box on the left side select "width" in the right-hand text box type in or use the spinners to adjust the width of the thumbnail image. The width is normally 240. Click Ok to add text to config file.

16.3.3 Now we will add the image name to the config file. Right Click on the number and then select "add tag to container" from the popup menu. In the dialog box on the left side select "image" in the right-hand dropdown list box. In the left-hand dropdown list box will be a list of all the images contained in your directory. The image is normally called "thumbnail.jpg". You can name it anything you like. as long as it is in the same directory as the config file. Click Ok to add text to config file.

These are the minimum tags that need to go into a config file for a signal. I always add the following tags so as there is more information about the creator, license and a description of the asset. All these tags can be added in the same way as we have done in the above example.

You have completed the creation of your asset. The next thing to do is to import the new asset into Trainz.

17. Open Trainz Content Manager and from the File Menu select “Import Content”. A “Browse for Folder” dialog box opens up. Once you have selected the location of your files press the OK button to import the new asset. If it imports without any error you have succeeded in creating your new asset.

17.1 Always use the Content Manger to check to make sure there are on asset errors. Right click the new asset and from the popup menu select “Errors and Warnings”. If it comes up with any error you need to fix them before trying to use the asset in the simulator.

I hope this tutorial is helpful in creating Asset config files using AssetX

Personal tools