Adding a tail light to rearmost vehicles.

General discussion about Train Simulator, your thoughts, questions, news and views!

Moderator: Moderators

deltic009
Very Active Forum Member
Posts: 4017
Joined: Fri Nov 27, 2009 1:06 am

Re: Adding a tail light to rearmost vehicles.

Post by deltic009 »

gptech wrote:From memory, as I won't be home till late, there are 2 long lists of transforms. I changed the value of -1 to 1 in the second list after taking a punt on the names defined in list 1 were in the same order order as those values in list 2.
This put the light over the roof of the coach but did support the link between the lists. There are 2 entries for the light, front facing and rear facing I think so I was going to see what happened with them swapped over.


That's about as far as I got, maybe it'll help you along.
If it's like child object entries (and I suspect it is) then i know how to make the relevant calculations.
Matthew Wilson, development team at Vulcan Productions

http://www.vulcanproductions.co.uk
https://www.facebook.com/VulcanFoundry/
gptech
Very Active Forum Member
Posts: 19585
Joined: Fri Oct 10, 2008 5:48 pm
Location: Wakefield, West Yorkshire

Re: Adding a tail light to rearmost vehicles.

Post by gptech »

It wasn't a matrix Matthew, just one list of numbers and the second of transform names. Further down the .Geo though is a huge section dealing with what appeared to be what you're thinking of---- or at least something akin to a matrix. Transform 77 and 78 are the ones (I think)
It's not easy to describe from memory, but you should be able to see what's what.
User avatar
rfletcher72
Very Active Forum Member
Posts: 8643
Joined: Sat Apr 28, 2007 10:59 pm
Location: The Steel City
Contact:

Re: Adding a tail light to rearmost vehicles.

Post by rfletcher72 »

gptech wrote:It wasn't a matrix Matthew, just one list of numbers and the second of transform names.
If again my memory is functioning today, the order of these values listed in the .geo for each node are the same as that of matrices in a .bin file,
Richard
gptech
Very Active Forum Member
Posts: 19585
Joined: Fri Oct 10, 2008 5:48 pm
Location: Wakefield, West Yorkshire

Re: Adding a tail light to rearmost vehicles.

Post by gptech »

It probably is Richard; I think I'm not been conveying what I meant properly so as a picture speaks a thousand words (well, a direct lift from the .Geo)

Code: Select all

 	<TransformDependency>
		<e d:type="sInt32">-1</e>
		<e d:type="sInt32">-1</e>
		<e d:type="sInt32">-1</e>
		<e d:type="sInt32">-1</e>
		<e d:type="sInt32">-1</e>
		<e d:type="sInt32">55</e>
		<e d:type="sInt32">55</e>
		<e d:type="sInt32">55</e>

<Truncated>

	</TransformDependency>
	<TransformName>
		<e d:type="cDeltaString">softshade</e>
		<e d:type="cDeltaString">decals01</e>
		<e d:type="cDeltaString">roofrails</e>

<Truncated>	

        </TransformName>
As you can see, it isn't a set of values per transform, though of course it could be the resultant figure from a matrix multiplication.

Further down the .Geo are multiple sections with values for each transform that are more akin to a matrix,

Code: Select all

							</Child>
							<Centre d:numElements="4" d:elementType="sFloat32" d:precision="string">0.0000000 0.0000000 0.0000000 1.0000000</Centre>
							<Radius d:type="sFloat32" d:alt_encoding="0000008047BCEE3F" d:precision="string">0.960483</Radius>
							<TransformID d:type="sInt32">79</TransformID>
						</cHcSGBoundingSphere>
					</Child>
but definitely not a matrix.


Any way, matrix maths is too hard after a long shift, so I went for the easy approach first...

Image


Just edit this bit in the transform name listing:

Code: Select all

		<e d:type="cDeltaString">lights_fwdtail</e>
		<e d:type="cDeltaString">lights_revtail</e>
to:

Code: Select all

		<e d:type="cDeltaString">lights_revtail</e>
		<e d:type="cDeltaString">lights_fwdtail</e>
This works on both ends of that particular coach (for me at least) which is the NSE BSK.

Before I get too excited could you, both of you, some of you, lots of you just give it a whirl?
If it seems to be universal we can look at the other stock.

EDIT:

Ahhh...the penny's dropped (told you it had been a long shift) and I believe you're thinking of the sections immediately above the list of transform dependancies and names. This does indeed feature 16 values per transform, just as a .bin matrix. Given that, it should be fairly simple now to either forgo he re-naming and edit the values, or stick with the re-naming and just tweak the values so that the light is on the *right* side.

EDIT 2:

It seems that the re-name/swap of the transforms is needed, otherwise the light faces the wrong way....OK, could be done with matrix manipulation but I like easy :wink:

Then it's just swapping the matrix values for the height and offset over, setting the offset to a positive rather than negative value and vica versa.

Image

Much easier than sums!!! :roll:

I've tried it in combination with a Kuju Mk1 BG and it seems compatible, both with itself at the rear and the BG.
deltic009
Very Active Forum Member
Posts: 4017
Joined: Fri Nov 27, 2009 1:06 am

Re: Adding a tail light to rearmost vehicles.

Post by deltic009 »

Top work as always Gary, now all we need to do is find out how those clever folk make executable files that can use RW tools to do a find and replace in the Geo and then we're not distributing copyrighted stuff etc etc.
Matthew Wilson, development team at Vulcan Productions

http://www.vulcanproductions.co.uk
https://www.facebook.com/VulcanFoundry/
User avatar
DaveDewhurst
Very Active Forum Member
Posts: 1994
Joined: Wed Nov 28, 2007 10:21 am
Location: Birkenhead
Contact:

Re: Adding a tail light to rearmost vehicles.

Post by DaveDewhurst »

I have, in the past used a patch program, there are free ones available.
You show it the two files (before the edit and after) it figures out what's changed and makes an exe to do it without having to distribute the copyrighted files

Dave
gptech
Very Active Forum Member
Posts: 19585
Joined: Fri Oct 10, 2008 5:48 pm
Location: Wakefield, West Yorkshire

Re: Adding a tail light to rearmost vehicles.

Post by gptech »

Yeah, that's probably a bigger hurdle than stumbling upon a way to do it :-?
I suppose the best way would be to contact AP.
User avatar
31160
Well Established Forum Member
Posts: 876
Joined: Thu Jun 13, 2013 3:47 pm
Location: Somerset

Re: Adding a tail light to rearmost vehicles.

Post by 31160 »

It has to be said that this is much needed many thanks to the usual suspects who are sorting this for us :)
deltic009
Very Active Forum Member
Posts: 4017
Joined: Fri Nov 27, 2009 1:06 am

Re: Adding a tail light to rearmost vehicles.

Post by deltic009 »

31160 wrote:It has to be said that this is much needed many thanks to the usual suspects who are sorting this for us :)
Aww come on, you know me, start off with one job end up doing twenty
Matthew Wilson, development team at Vulcan Productions

http://www.vulcanproductions.co.uk
https://www.facebook.com/VulcanFoundry/
nschichan
Been on the forums for a while
Posts: 135
Joined: Thu Sep 15, 2011 10:52 pm

Re: Adding a tail light to rearmost vehicles.

Post by nschichan »

Good evening,

While the lights node can't be hidden by scripts as the core game overrides the display of the nodes, it is interesting to note that they can be animated out or their position can be changed by animations.

To do so just create an animation rotating two nodes (lights_revtail and lights fwdtail) by 180 degrees for say 24 frames with the end start keyframe having the same rotation values with your favorite 3d suite. Looking at the Mk1 BFK GeoPcDx it looks like the tail light nodes are not centered to the origin so you'll have to translate them as well from what I can see in the GeoPcDx:

For the lights_fwdtail node: 0.8413574 2.0650878 -10.1435909 (former position of lights_revtail)
For the lights_revtail node: -0.7981251 2.0485723 10.152489 (former position of lights_fwdtail)

Those coordinates are given in the RW coordinate system (Y axis pointing up) so it may require some changes in your 3d software for correct results.

Then export the animation to ia and ban file and add the following entry to the AnimSet section of the wagon blueprint:

Code: Select all

<iAnimObjectRenderBlueprint-cAnimation d:id="42424242">
	<AnimationID d:type="cDeltaString">lights_fix</AnimationID>
	<AnimationName d:type="cDeltaString">Path\To\Exported\Animation\</AnimationName>
	<AnimateInEditor d:type="cDeltaString">eTrue</AnimateInEditor>
</iAnimObjectRenderBlueprint-cAnimation>
And voila, you should have the lights appearing at the correct location.

Cheers,
--
nschichan
deltic009
Very Active Forum Member
Posts: 4017
Joined: Fri Nov 27, 2009 1:06 am

Re: Adding a tail light to rearmost vehicles.

Post by deltic009 »

nschichan wrote:Good evening,

While the lights node can't be hidden by scripts as the core game overrides the display of the nodes, it is interesting to note that they can be animated out or their position can be changed by animations.

To do so just create an animation rotating two nodes (lights_revtail and lights fwdtail) by 180 degrees for say 24 frames with the end start keyframe having the same rotation values with your favorite 3d suite. Looking at the Mk1 BFK GeoPcDx it looks like the tail light nodes are not centered to the origin so you'll have to translate them as well from what I can see in the GeoPcDx:

For the lights_fwdtail node: 0.8413574 2.0650878 -10.1435909 (former position of lights_revtail)
For the lights_revtail node: -0.7981251 2.0485723 10.152489 (former position of lights_fwdtail)

Those coordinates are given in the RW coordinate system (Y axis pointing up) so it may require some changes in your 3d software for correct results.

Then export the animation to ia and ban file and add the following entry to the AnimSet section of the wagon blueprint:

Code: Select all

<iAnimObjectRenderBlueprint-cAnimation d:id="42424242">
	<AnimationID d:type="cDeltaString">lights_fix</AnimationID>
	<AnimationName d:type="cDeltaString">Path\To\Exported\Animation\</AnimationName>
	<AnimateInEditor d:type="cDeltaString">eTrue</AnimateInEditor>
</iAnimObjectRenderBlueprint-cAnimation>
And voila, you should have the lights appearing at the correct location.

Cheers,
Very interesting and thanks for the help, I'm particularly interested in this method as it doesn't involve a need to edit the Geo file in anyway, so may avoid other issues arising from that.

Say, as with many things at one time, animation is something I haven't messed with in Blender (my preferred 3d package) at all, so it's completely alien to me - and I still don't have any internet in the new house yet for tutorials etc.

I shall watch this space for updates though from the usual protagonists and thenameplate hopefully a set of us will have picked up some new skills!!
Matthew Wilson, development team at Vulcan Productions

http://www.vulcanproductions.co.uk
https://www.facebook.com/VulcanFoundry/
gptech
Very Active Forum Member
Posts: 19585
Joined: Fri Oct 10, 2008 5:48 pm
Location: Wakefield, West Yorkshire

Re: Adding a tail light to rearmost vehicles.

Post by gptech »

deltic009 wrote:Very interesting and thanks for the help, I'm particularly interested in this method as it doesn't involve a need to edit the Geo file in anyway

Unless you need to remove the spurious light at the wrong end maybe?
Would a separate animation conflict with any existing 'dynamic' light? Would an animation be 'dynamic'?
Incidentally, does anybody know just how many coaches/which ones have the light 'built in', and was this a DT addition or an AP one?

The idea of an animation is versatile though, could it be extended to add lights to stock that don't have them?--that way you'd just need the single animation (or 2 if you wanted a flashing rear light) and link to it from the .bin
gptech
Very Active Forum Member
Posts: 19585
Joined: Fri Oct 10, 2008 5:48 pm
Location: Wakefield, West Yorkshire

Re: Adding a tail light to rearmost vehicles.

Post by gptech »

nschichan, (or anybody else with the required talent)
any chance you could knock up some kind of animation so that we can have a play about?---doesn't have to be spot on, just something that will show in-game.
User avatar
Carinthia
Very Active Forum Member
Posts: 1123
Joined: Tue Mar 06, 2012 7:07 pm
Location: at the end of the regulator

Re: Adding a tail light to rearmost vehicles.

Post by Carinthia »

gptech wrote:
deltic009 wrote:Incidentally, does anybody know just how many coaches/which ones have the light 'built in', and was this a DT addition or an AP one?
A feature of the DT coaches as far as my ownership goes back, so i assume from day one.

[cheeky mode]
. . . and when this is done, there are the only partially working headcose discs on the DT Class 40, and the non-working tail lamps on trains after the SSS mod on the Jubilee (they are permanently on the tender).
[/cheeky mode]

John
deltic009
Very Active Forum Member
Posts: 4017
Joined: Fri Nov 27, 2009 1:06 am

Re: Adding a tail light to rearmost vehicles.

Post by deltic009 »

Carinthia wrote:
gptech wrote:
deltic009 wrote:Incidentally, does anybody know just how many coaches/which ones have the light 'built in', and was this a DT addition or an AP one?
A feature of the DT coaches as far as my ownership goes back, so i assume from day one.

[cheeky mode]
. . . and when this is done, there are the only partially working headcose discs on the DT Class 40, and the non-working tail lamps on trains after the SSS mod on the Jubilee (they are permanently on the tender).
[/cheeky mode]

John
Harsh but genuine mode - the DT 40 has been nullified by the Railright one, and I don't have the SSS Jubilee add on.
Matthew Wilson, development team at Vulcan Productions

http://www.vulcanproductions.co.uk
https://www.facebook.com/VulcanFoundry/
Locked

Return to “[TS] General Discussion”