Page 1 of 1

Numberboard Child Objects

Unread postPosted: Thu Oct 22, 2020 12:57 pm
by LoganTMT
Hey all, I'm in need of help trying to get some new numberboards made for the RRMods GP40-2. I'm doing a private project but I can't seem to get any help on making child objects with autonumbering to be located in the correct locations They need to be... Can someone help me get them working for the locomotive?

Thanks,
Logan Thurman

Re: Numberboard Child Objects

Unread postPosted: Thu Oct 22, 2020 3:03 pm
by MaineLines
Not sure anyone has solved the child object with autonumbering problem yet.

Re: Numberboard Child Objects

Unread postPosted: Thu Oct 22, 2020 3:43 pm
by EngineerJohn
The Tru-Rail guys have but they're a very secretive bunch. Sure you can get in their discord but good luck getting anything out of them as far as knowledge goes.

Re: Numberboard Child Objects

Unread postPosted: Thu Oct 22, 2020 4:13 pm
by Kali
If you search for "portable autonumbers" you'll find one of my old threads from about 2013 where I was talking about how to do this for TS2012 - unfortunately I very much doubt the examples from back then will load in the game now ( I have no idea, haven't fired it up in years ) but back then you set the number panels up on a child object as if it was the main object, and then use a script call ( SetText? I think ) to set the number for the child object - nothing more to it than that. I'm pretty sure there was an explanation of how to position them ( or at least I went into it a bit ). Things may have changed massively or not at all, but it might be some use.

Edit: thought I'd expand a bit - unless something significant has changed ( which would be a bit daft at this point ) child object location is a 4x4 matrix, pretty standard in 3d graphcis work; there's a thread here - viewtopic.php?f=9&t=6253 - which may or may not give links to useful tools, and there's a post I made at UKTS about it still extant - https://forums.uktrainsim.com/viewtopic ... 0#p1549720. There's also a Wikip page about matrix transformations.

As for actually locating the object I think I used to pull out the coordinate of the coupler if it was near the end of the vehicle, and then use some guesswork. You can do other things like make a child object of a cage with markings every metre or so, and attach that to the model origin as a giant 3d ruler.

Re: Numberboard Child Objects

Unread postPosted: Sun Nov 22, 2020 10:07 am
by kris120
Much easier, as you do not need to calculate:

Place an object in the editor (scenario editor is perfect as the object is inside the tile of the folder scenery inside the scenario).
Set the angle by which you want to rotate. Rotate the object (e.g. Headlight).
Save the scenario.
Decompile the scenery tile with serz.
Search for "cFarMatrix" inside the xml. You will find something like this:
<Height d:type="sFloat32" d:alt_encoding="0000008071E95F40" d:precision="string">127.648</Height>
Code: Select all
<RXAxis d:numElements="4" d:elementType="sFloat32" d:precision="string">0.9659258 -0.2588190 0.0000000 0.0000000</RXAxis>
<RYAxis d:numElements="4" d:elementType="sFloat32" d:precision="string">0.2588190 0.9659258 0.0000000 0.0000000</RYAxis>
<RZAxis d:numElements="4" d:elementType="sFloat32" d:precision="string">-0.0000000 0.0000000 1.0000000 0.0000000</RZAxis>


Just copy the values in your blueprint, line by line :
Code: Select all
<Matrix>
                        <cHcRMatrix4x4>
                           <Element>
                              <e d:type="sFloat32">0.9659258</e>
                              <e d:type="sFloat32">-0.258819</e>
                              <e d:type="sFloat32">0</e>
                              <e d:type="sFloat32">0</e>
                              <e d:type="sFloat32">0.258819</e>
                              <e d:type="sFloat32">0.9659258</e>
                              <e d:type="sFloat32">0</e>
                              <e d:type="sFloat32">0</e>
                              <e d:type="sFloat32">0</e>
                              <e d:type="sFloat32">0</e>
                              <e d:type="sFloat32">1</e>
                              <e d:type="sFloat32">0</e>
                              <e d:type="sFloat32">0.4</e>
                              <e d:type="sFloat32">0.12</e>
                              <e d:type="sFloat32">-0.36</e>
                              <e d:type="sFloat32">1</e>
                           </Element>
                        </cHcRMatrix4x4>

This rotates your child 15° to the right.
Positioning here is 0.4m to the right, 0.12m forward and 0.36m down.