Adding cab

General Trainz discussion and questions.
Post Reply
User avatar
MF01
Milepost 5
Posts: 52
Joined: Fri Oct 20, 2017 3:02 pm
Trainz Version: T:ANE
Trainz Build: 90946

Adding cab

Post by MF01 »

Hello,

I have a train without a cab and I added one but the problem is that the cab is litteraly at the track level so I would like to know if there's a possibility to ajust the height of the cab. Thanks

Regards
Image
User avatar
Jacks trainz
Past 100!
Posts: 112
Joined: Sun Feb 26, 2017 4:57 pm
Trainz Version: TRS2022
Trainz Build: 4
Author KUID: 672927

Re: Adding cab

Post by Jacks trainz »

The cab attaches at an attachment point. If the locomotive did not originally have a cab it could be that the attachment point doesn't exist on the mesh.

Best to try and contact the original author of the engine and see what they say about it. It might not a be a straight forward fix.

One possible fix could be to use an application called attachment maker. But before you do that it would be a good idea to try and contact the author of the content. The authors contact email should be in the config file.


Hope this helps.

Regards Jack
User avatar
Shippy2013
Past 100!
Posts: 128
Joined: Sat Apr 02, 2016 10:04 am
Trainz Version: TS12
Trainz Build: 61383
Location: Nottinghamshire

Re: Adding cab

Post by Shippy2013 »

I’ve had a similar issue before. I replaced a cab on an asset with a more suitable one. It was a while back but if I remember correctly. Go into the config for the cab and adjust the value of the attachment by 0.x up or down and keep checking it’s position. X being 1,2,3 etc
User avatar
MF01
Milepost 5
Posts: 52
Joined: Fri Oct 20, 2017 3:02 pm
Trainz Version: T:ANE
Trainz Build: 90946

Re: Adding cab

Post by MF01 »

Thanks to all !!! I'll try that.

Regards
Image
User avatar
Nexusdj
Forum Veteran
Posts: 3096
Joined: Sun Dec 12, 2010 3:02 pm
Trainz Version: TRS22
Trainz Build: 123794
Author KUID: 45317
Location: West Midlands
Contact:

Re: Adding cab

Post by Nexusdj »

The cab config requires a "position" entry adding into the mesh table to adjust its height .
Remember though that unless the cab has been cloned you will also affect all the other loco's that use this cab .
At this point I'll mention checking license agreements before cloning , it will cause groans from some reading this , but that's what I do ;)

As for the position tab the mesh table entry looks like this :

Code: Select all

mesh-table
{
  default
  {
    mesh                                "XXXX.im"
    auto-create                         1
    position                            0,0,0
  }
}
XXXX is the mesh name .
The entry you want to amend is the last 0 in the "position" line ,
This is the height in metres which can also have a minus before it to position below its original height
you can use a decimal point to reduce the movement to centimetres :
0,0,0.56 = lowered by 56 centimetres
0,0,1.20 = raised by 1 metres and 20 centimetres .

The commas dividing the 3 entries are important !

Easiest way to get the cab at the correct height is to check the cab attachment height of a existing loco that uses the same cab
(double check in game to make sure that loco's cab also sits at the right height )
Open the loco's .im file in Pev's mesh viewer program
(http://trainz.shaneturner.co.uk/tutoria ... h-viewer-2 )
Right click on the loco and select "Show attachments" ,
Click through the list (bottom left with up down arrows) and find the entry "a.cabfront" (if the loco has 2 cabs then there should be another entry "a.cabback")
Once selected the second box should show "Posn: 0.000,XXXX, YYYY"
XXXX = The position of the cab in metres & centimetres from the centre of the loco along a horizontal axis
YYYY = The position of the cab in metres & centimetres from a 0 metre floor height

(Gary's 56 is shown below and the "a.cabfront" entries show that the cab attachment point is -8.173 metres from the centre of the loco
and set at a height of 2.874 metres off the 0 ground level .
"a.cabback" shows "Posn: 0.000, 8.173, 2.874" so the other cab is 8.173 metres the other way from the centre of the loco and set at the same height)


It's the YYYY (orange underline in screenshot below) coordinates that you require , write them down or copy and paste to a notepad file .

Next do the same for the loco you are trying to add this cab to , once again note down the YYYY height coordinates .

Finally work out the difference in height between the two and there's the amount you need to add to the "position" tag in the cloned cabs mesh table .
You do not have the required permissions to view the files attached to this post.
High visibility pixels must be worn when on or about the line !!
User avatar
MF01
Milepost 5
Posts: 52
Joined: Fri Oct 20, 2017 3:02 pm
Trainz Version: T:ANE
Trainz Build: 90946

Re: Adding cab

Post by MF01 »

Thanks nexus it works ( I can't use the software because it's a .exe and I'm on MAC ) I can ajust the cab height but the camera won't move it's still "above the tracks" if I send you the cab file can you figure it out ?
Image
clam1952
Forum Veteran
Posts: 1528
Joined: Sun Dec 12, 2010 3:16 pm
Trainz Version: TRS22
Trainz Build: 116243
Author KUID: 425700
Location: Crewe, Cheshire, UK

Re: Adding cab

Post by clam1952 »

When doing adjustments like that you probably need to delete it in game and then add it back again as its previous setup will more than likely be cached.
Cheers

Malc

Member of Trainz Carriage and Wagon Works
http://www.trainz-carriage-wagon-works.com/
User avatar
Nexusdj
Forum Veteran
Posts: 3096
Joined: Sun Dec 12, 2010 3:02 pm
Trainz Version: TRS22
Trainz Build: 123794
Author KUID: 45317
Location: West Midlands
Contact:

Re: Adding cab

Post by Nexusdj »

MF01 wrote:Thanks nexus it works ( I can't use the software because it's a .exe and I'm on MAC ) I can adjust the cab height but the camera won't move it's still "above the tracks" if I send you the cab file can you figure it out ?
In that case I think you might have to adjust the positions of the internal viewpoints in the cab config file :

http://online.ts2009.com/mediaWiki/inde ... _container

For each 'camera' line, there are five decimal values. These are the X, Y and Z coordinates of the camera in metres relative to the 0,0,0 point of the interior mesh, and the Yaw and Pitch in radians

It will be the Z coordinate (third entry) that needs altering in each camera line

Code: Select all

cameralist
{
  camera0                               0.849,-8.917,2.579,-0.046,-0.327
  camera1                               0.018,-8.877,2.579,-0.036,-0.034
  camera2                               -0.847,-8.847,2.579,-0.037,0.06
}
In the example cameralist above you need to increase or decrease the 2.579 figures by the same amount that you moved the cab by .

try that to see if it works ?
Might be best to copy and save the config file before you alter it just in case that doesn't work .
High visibility pixels must be worn when on or about the line !!
User avatar
MF01
Milepost 5
Posts: 52
Joined: Fri Oct 20, 2017 3:02 pm
Trainz Version: T:ANE
Trainz Build: 90946

Re: Adding cab

Post by MF01 »

It works fine now thanks a lot Nexus for your precious help and thanks to other too !!!
Image
dave55007
Past 100!
Posts: 189
Joined: Sat Dec 18, 2010 11:05 am
Trainz Version: 2009
Trainz Build: 38869
Author KUID: 349132
Location: East Yorkshire

Re: Adding cab

Post by dave55007 »

In connection with this thread, I downloaded the PEV Attachment Maker tutorial and have a problem with some missing text. My computer is struggling to display one of the fonts, despite my having the font on my computer! This means I cannot carry out the procedure fully. The missing text is the Attachments Mesh example as demonstrated on P4 of the tutorial, and the 2 lines of the DOSWin.bat file on P5.
Can someone who has this tutorial do me a favour and let me know what the missing lines are please?

Regards,

Dave
Dave

Great Yorkshire Railways - a Great idea that never was!
Post Reply