MSTS - Helpful Facts and Links - Part 38 (Aliasing in MSTS (& Open Rails))

View previous topic View next topic Go down

MSTS - Helpful Facts and Links - Part 38 (Aliasing in MSTS (& Open Rails))

Post  slipperman12 on Mon 20 Feb 2017, 11:15 pm

The following is my understanding of how aliasing works, based on extensive testing for MSTS_Check.  It should not be taken as the definitive guide on the subject and if I've got anything radically wrong, please let me know, and I'd be pleased to make the appropriate corrections.  

May I offer my thanks to David (dforrest) for clarifying my understanding, particularly regarding Freight Animation aliasing, but also sorting out a few other niggles I had.  I have made some modifications to this document since it was first published (21 February 2017).

This is more correctly known as Relative Addressing and has been an integral part of MSTS since the early days.

I have seen many tutorials and Forum posts on how to do it for cabviews and sounds, but I've never seen any explanations of what ..//..// etc., mean.   The purpose of this article is to clarify how it works, for MSTS, although the general principles apply to Windows in general.

Before going any further, MSTS appears to use a selection of path separators - /, // and \\ but treats them all in the same way.  This document only uses the double forward-slash (..//) because  MSTS doesn't accept the Windows standard - single backward-slash (\), although, strangely, it uses them in error messages.

Cabviews and sounds are very similar, but there is one difference between them, so they will be taken separately.

In the examples shown below, and MSTS as a whole, the quotes ("") surrounding an entry are not essential if there are no spaces within it, but it has almost become an "industry standard" that they are used for all entries.  MSTS doesn't complain.

Cabviews
The entry in a .eng file may be :   Cabview ( gp38.cvf )
This means that file gp38.cvf is expected to be in the Cabview folder in the same folder as the .eng file.

Alternatively, it might look like this :  Cabview ( "..//..//Dash9//Cabview//Dash9.cvf" )
In this case, the cabview is aliased to that of the default Dash 9 locomotive (in the same TRAINSET folder).
NOTE : This entry is only an example; it won't work in practice because the individual .ace files in the Dash9's Cabview folder aren't aliased.

Or, it might look like this :  CabView ( "..//..//Common.Cab//Tanker//Tanker.cvf" )
where, the cabview file is expected to be in folder Tanker which is in folder Common.Cab, which is in the TRAINSET folder.

Within a cabview (.cvf) file, there will be many entries specifying texture (.ace) files.  The same system is used to locate these files. If it's shown like this : CabViewFile ( class50cableft.ace ), the .ace file is expected to be in the same folder as the .cvf file itself, or, if not there, in the loco's CABVIEW folder, if different.  
An alternative is this : CabViewFile ( ..//..//Scotsman//CabView//scothudleft.ace ), in which case the scothedleft,ace file will be looked for in the Scotsman's cabview folder.

If a .ace file is not in the loco's Cabview folder, its entry in the .cvf file must alias to its actual location.

Sounds
An entry may look like this :  Sound ( "d9eng.sms"  ) which means that file d9eng.sms is expected to be in the Sound folder, within the folder containing the .eng file.  If it's not in that folder, or that folder is missing, MSTS looks in the "global" SOUND folder (found in the root (Train Simulator) folder).  This often, but not exclusively, applies to wagons and coaches (.wag files), which don't normally have their own SOUND folders.  An example :  Sound ( "GenFreightWag2.sms" )
Alternatively, an entry like this : Sound ( "..//..//common.sound//2cyl_generic//2c-140b-eng01.sms" ) indicates that the .sms file is in the 2cyl_generic folder which is within the common.sound folder.

In a .sms file, there will be several "calls" to sound (.wav) files, like : StartLoop   ( 1 File ( "c50_power_cruise3.wav" -1 ) which shows that the required file is expected to be in either the same folder as the .sms file, or if not, in the global SOUND folder.  If it looks like this :  File ( "..//..//Dash9//Sound//x_d9_sand.wav" -1 ), the file is expected to be in the Sound folder of the Dash9 loco.

if a .wav file is not in the same folder as its calling .sms file and not in the global SOUND folder, its entry in the .sms file must alias to its actual location.

Freight Animations
An entry may look like this :  FreightAnim ( crew_20.s 1 1 )  or FreightAnim ( "..//common.crew//LIB_1//N2.s" 0.1 0.1 ).
The first is not aliased, so the shape file (crew_20.s) is expected to be in the same folder as the .eng file.  In the second example, the shape file is expected to be in the common.crew folder which is in the current folder's parent folder.


How it works



Relative addressing
Each ..// (or MSTS variation) moves into the folder one level above the current location, which I'll call the 'default' level.  

For .cvf (Cabview) and .sms (Sound) files, the 'default' level is the CABVIEW and SOUNDS folder respectively; for Freight Animations, it is the loco/wag folder.

In the above examples, Loco1's eng file has an entry : Sound ( "..//..//common.sound//locoID//locoeng.sms" ).   ..//..// means move up two folder levels - the first level is folder Loco1 and the second is TRAINSET.  The system is then instructed to look for folder common.sound within that second level folder and then to folder locoID within common.sound in which file locoeng.sms is expected to be found.

.ace files (Cabview textures)
The 'default' level is ALWAYS the current loco's CABVIEW folder. Any unaliased .ace files are expected to be in that folder, wherever the .cvf file is located.

.wav files (Sounds)
The 'default' level is the folder containing the .sms file.  Any unaliased .wav files are expected to be in either the folder containing the .sms file, or, if not there, in the global SOUND folder (in the MSTS root folder, which, by default, is Train Simulator).

.s (Freight Animation) files
The 'default' level is the folder containing the .eng/.wag file.


Intel i5 4690K (3.5GHz), Gigabyte GA-Z97P-D3 m/b, 8GB RAM, NVIDIA GTX 750ti (2GB), ASUS Xonar DS Sound Card, Win 7 Pro 64 bit.

slipperman12

Posts : 1222
Join date : 2013-01-29
Age : 75
Location : North Nottinghamshire

Back to top Go down

View previous topic View next topic Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum