Wednesday, November 9, 2011

Got children?

It's not one of the deepest mysteries of Railworks, but it seems to be one of the most talked about, most closely guarded secrets in the game. Just how do you add loads to rolling stock as child objects? In this post I intend to find out.

My example will begin with using two models. The first is the RTTX 90ft flatcar which is available as part of the RSC SD40-2 Wide Nose DLC from Steam. The second model is a set of trailers which recently became available from 90000ft.


I begin by cloning one of the flatcar models, the same way I would when I repaint a model. I will use 'Variant2' found under 'RSDL\USWagons01\RailVehicles\Freight\FlatcarRTTX90' and clone it to '90kVar01'. I then open the 'Flatcar03_loaded1.bin' in RW_Tools (you can also use SERZ.exe if you like) to edit the XML found inside. I'll need to rename my new object and 'USFC01 Flatcar 90k FedEx 1' will fit the bill.

   USFC01 Flatcar 90k FedEx 1
   
    
     
      
       USFC01 Flatcar 90k FedEx 1
       USFC01 Flatcar 90k FedEx 1
       USFC01 Flatcar 90k FedEx 1
       USFC01 Flatcar 90k FedEx 1
       USFC01 Flatcar 90k FedEx 1
       
       
       
       
       
      
     
    
   
After converting all the other dependencies, I can now replace the old trailer child object with the new one.
original:

      
       Single Trailer
       
        
         
          
           RSDL
           USWagons01
          
         
         RailVehicles\Freight\FlatcarRTTX90\Variant2\Flatcar_RTTX90_trucks_1.xml
        
       
       
        
         
        
       
      
...
new:

      
       Single Trailer
       
        
         
          
           90000ft
           NewEngland
          
         
         Scenery\Equipment\SemiTrailerFedEx.xml
        
       
       
        
         
        
       
      
...
Lets take a peek at how I am doing...


Not exactly what I expected, but at least its showing up, right? What has happened is that the original trailer model was created in the correct position when it was still being designed in the modeling application, and  probably with the flatbed model in place underneath to boot. Its co-ordinates are built into the GeoPcDx and there is no need to alter its values (that why the 'Element' element is empty). This means I need to add my own positioning.... not for the faint of heart. So lets get to some trial and error. I will add a very basic Matrix to the child.

 
   
    1.0000
    0.0000
    0.0000
    0.0000
    0.0000
    1.0000
    0.0000
    0.0000
    0.0000
    0.0000
    1.0000
    0.0000
    0.0000
    0.0000
    0.0000
    1.0000
   
 

But what does each element mean? Unfortunatly there is not too much documentation about this, but with some quick Googling, I did find this on ULTrainSim. Essentially I need only to change the 14th (Y) and 15th (Z) values to re-position the trailer where I want (with lots of trail and error), and now my matrix looks like this:

 
   
    1.0000
    0.0000
    0.0000
    0.0000
    0.0000
    1.0000
    0.0000
    0.0000
    0.0000
    0.0000
    1.0000
    0.0000
    0.0000
    1.1000
    -5.5000
    1.0000
   
 

I can probably hear your next question... 'What did you do? You made the number negative!' The short answer is that it will flip the child around 180 degrees (on whatever axis you are adjusting). The other values do strange things like stretch and angle the child which I will likely cover in a Part 2.


But wait! There's more! With a little elbow grease, some teeth grinding and just a bit of patience, you can can make any model a child of another!


If you need to add more children first find section 'ContainerComponent' in the BIN file. Within that section look for an element named 'Children', and then add you a '<cEntityContainerBlueprint-sChild d:id="28432008">' section with all the information filed out. If you are copy/pasting from other models make note that the 'd:id' attribute needs to be unique within the BIN or you will have duplication and the last one read in wins.

Example cEntityContainerBlueprint-sChild:

  Single Trailer
  
   
    
     
      SMMDigital
      scenery
     
    
    buildings\smm_bulktank15x40.xml
   
  
  
   
    
     1.0000
     0.0000
     0.0000
     0.0000
     0.0000
     1.0000
     0.0000
     0.0000
     0.0000
     0.0000
     1.0000
     0.0000
     0.0000
     5.1000
     0.0000
     1.0000
    
   
  



One last thing every parent needs to remember is that some children just don't play well together.


Extra Credit: The RTTX model was really well thought out, so much so that there is a way to remove all other files from the clone so you only have 'Flatcar03_loaded1.bin' and 'Flatcar03_loaded2.bin' left and it still works. This makes it extra portable, and you have no restrictions with distribution (there are no GEO files) as long as you own the original content (I'll give you a hint, its the only way to pull it off). I'll leave this puzzle to you, kind readers to play with.

No comments:

Post a Comment