Level Crossings - Making Your Own

Tips and discussion about scenery creation for RailWorks.

Level Crossings - Making Your Own

Unread postby ricksan » Wed Oct 20, 2010 12:12 pm

So you want to make your own grade crossing? There's nothing to it! *!rolleyes!* I'll assume you know how make and export animated scenery objects and that you are familiar with the Blueprint Editor.

The part names used in your model must of course observe RW's conventional 1_0500_objectname format. Beyond that, they can be anything you want with one exception, or rather two, those being the flasher lights. There must be two separate flasher parts, left and right, and in the "objectname" field they must be named "lc_lightsleft" and "lc_lightsright" respectively. The signals and gates are controlled by a LUA script. If you use a copy of the default script, and there's no reason not to, these part names match the names assigned to the variables NODE_CLOSED LEFT and NODE_CLOSED_RIGHT in the script.

Here are recommendations regarding frame animation.

Gates: A real-world gate usually takes 4 or more seconds to lower or raise, so set the animation up for at least 120 frames (4 x 30 fps). Strange as it may seem, at frame 0 the gate should be in the down (horizontal) position. Make this a key frame. Make another key frame at frame 120 and rotate the gate up to the raised position. Done! Just for fun, you might also want to try adding a little "bounce" when the gate reaches the limit of its rotation.

Flashers: The traditional way to animate signal flashers is to use two "lit" light objects, one for the left light and one for the right light, and animate them in reciprocating fashion. RailWorks uses a completely different approach. You don't animate them at all! In fact your signal can be a simple static scenery object. As long as there are separate left and right flashers and they have the part names noted above, it will work. Make the flashers so they are in the "lit" position -- that is, in front of the "dark" artwork. If you have two-directional flashers, the type with separate lamp housings that face the road in both directions, make sure the lights are visible in both directions. Here's a top view of what it should look like.

Image

RailWorks takes care of turning the light objects on and off in response to the current state of variables in the LUA script. The game software renders a light when it's ON and doesn't render the light at all when it's OFF. The rate at which the flashers are cycled on and off is also controlled by the LUA script using the variable WARN_LIGHT_FLASH_SECS. In the US, this is usually about 1.0 second.

Export the gate and signal models as IGS files and export the animated parts of the gate as an IA file. In the Blueprint editor, create an Animated Procedural Scenery blueprint for the gate. In the Anim set section, create an Animation (not Auto Animation) sub-blueprint. In the Animation ID field, you must enter "open" (without the quotes) for the gate. Here again, the Animation ID name for gates matches the name assigned to the variables ANIM_OPEN and ANIM_closed in the LUA script. As previously noted, the flasher signal can be a simple scenery object since it has no animated parts.

Now we'll tie everything together by filling out a Level Crossing blueprint, which is something new in RW2. For a complete crossing setup consisting of two gates and two signals, you'll need to define four children in the Container component sub-blueprint, that is, two gate children and two signal children. In the Child name field, call the gates "Barrier1" and "Barrier2" and call the signals "Warning1" and "Warning2" (without the quotes). Other names are permitted as long as they are the same ones used in the LUA script.

In the Script component BP field, copy-paste the name of the LUA script. The default one is called lc_us.lua and you can find it in the LevelCrossings folder under RailSimulatorUS. I made a copy of it and placed it among the other files in my Source folder. I used it as is except for the following minor edits. Open your copy of the LUA file using Notepad and find these lines:

-- Trigger distances
WARN_DISTANCE = 800.0
CLOSE_DISTANCE = 550.0
PASS_DISTANCE = -100.0

Adjust the WARN_DISTANCE variable to suit the usual speed of trains that use the crossing, higher for high-speed passenger trains, lower for slow freights. I changed the CLOSE_DISTANCE variable to be only 50 less than the WARN_DISTANCE so the gates begin to close shortly after the lights begin to flash. I also changed the PASS_DISTANCE to -10.0 so the whole cycle ends a few seconds after the train clears the crossing. As I previously mentioned, I also changed the value of WARN_LIGHT_FLASH_SECS to 1.0.

The Geometry ID field of the Level Crossing blueprint can be a problem. This is where you specify the placement gizmo, the little gray box that you first set on the crossing. One of these days RS.com may supply the source files for this item, but in the meantime you'll have to use your own gizmo. Just make a small box, texture it and export in the usual way. Now you'll be able to look at the composite grade crossing object in the Preview window. You can drag the four gate and signal components to positions and orientations that are reasonably close to where you'll eventually want them. That procedure places a set of transform-matrix coordinates in your XML and BIN files. Export again to retain these coordinates. You don't have to do this, but if you don't all the child objects will initially be sitting on top of one another in the World Editor, making it slightly more difficult to adjust them to their final positions.

At this point everything should be in place for you to install your own custom grade crossing object!

Some final notes about audio. The Level Crossing blueprint for the default US object, lc_us.bin, has a fifth child, referencing the audio controls for the looped bell sound and the one-shot gate motor sound. I'm not sure if this works or not. At first it worked for me, but for some reason now it doesn't. Anyway, you might want to try adding audio to your own custom object. Creation of audio files is a complex topic for another time. If you've never delved into the subject before, I recommend you read the Wiki article, as well as the outline tutorial on my web site. You should also inspect the relevant audio blueprints (Amb_P_US_LevelCrossingSound.bin and Amb_P_US_LevelCrossing.proxybin), to see how things should look. For extra credit, try and make this work!
Last edited by ricksan on Wed Dec 22, 2010 3:25 pm, edited 1 time in total.
ricksan
Forum Mod
 
Posts: 311
Joined: Fri Feb 13, 2009 10:55 am
Location: Bandon, OR USA

Re: Level Crossings - Making Your Own

Unread postby g_nash » Wed Oct 20, 2010 7:13 pm

ricksan wrote: I'll assume you know how make and export animated scenery objects and that you are familiar with the Blueprint Editor.



But I don't know how to do that !**conf**! *!twisted!*

Thanks for the tips !*salute*! , need to make a bunch of descriptions before these gets looked at *!sad!*

edit .. on a different topic .. since you appear to have contact with rw , do you why the art files are no longer available ?
g_nash
 
Posts: 461
Joined: Fri Feb 13, 2009 11:43 pm

Re: Level Crossings - Making Your Own

Unread postby SMMDigital » Wed Oct 20, 2010 7:25 pm

Thanks for the great info Ricksan! With your tut here, I should be able to get a prototype Beta of the SMM Xings out tomorrow. I already have the gate and signal itself as seperate assets. It looks as if animating them is going to be MUCH easier than the way I did it when the Xings were standalone signals.

The only problem I foresee is that i'm going to loose functionality in the gate lights and the pilot lights on the sides of the signal lamps. I'm already schemeing on how to get those in. Things are going to get even more complicated when I go for a Cantilever that has three different light sets.
SMMDigital
 

Re: Level Crossings - Making Your Own

Unread postby ricksan » Wed Oct 20, 2010 11:25 pm

The flashers on the cantilever shouldn't be a problem. You'll still have one set of left lights and one set of right lights. Each set will have multiple copies of the polygons representing the "lit" light, but they're all part of the same lc_lightsleft/right part. They'll all blink on and off together, but if you wanted you could swap the positions of some of them (right one where the left one should be and vice versa) for variety. The "left" and "right" designations are just arbitrary names to differentiate between the two parts.

I can't help you with the gate flashers and such, but I know you'll figure something out!

As for the other post about art files, if you're referring to the art file for the amber signal lights, it's still available. Look in RailSimulatorUS/ RailNetwork/ LevelCrossings/ textures.
ricksan
Forum Mod
 
Posts: 311
Joined: Fri Feb 13, 2009 10:55 am
Location: Bandon, OR USA

Re: Level Crossings - Making Your Own

Unread postby SMMDigital » Wed Oct 20, 2010 11:46 pm

Ok, this is good news. I'm figuring that since I don't have to move anything in the animation, and the part is rendered there or not, I can simply join the main lamps and the pilot lamps into one part. Now to just figure out the gate lamps.
SMMDigital
 

Re: Level Crossings - Making Your Own

Unread postby g_nash » Thu Oct 21, 2010 12:24 am

ricksan wrote:As for the other post about art files, if you're referring to the art file for the amber signal lights, it's still available. Look in RailSimulatorUS/ RailNetwork/ LevelCrossings/ textures.


Ah yeah ... meant Art Plugins *!embar*! .. have seen yet another ( unanswered ) request these , wondered if you had heard of their return , there's little point in me giving the guy poor info in reply .
g_nash
 
Posts: 461
Joined: Fri Feb 13, 2009 11:43 pm

Re: Level Crossings - Making Your Own

Unread postby SMMDigital » Thu Oct 21, 2010 1:37 am

Done! Just for fun, you might also want to try adding a little "bounce" when the gate reaches the limit of its rotation.


This is a great idea, and was integrated into my original signals. Unfortunately, since RW is using the same animation for both the up and down motion of the gate, when the gate starts to go down, it vibrates as if it has just come back up. It looks kind of funny.

Thanks to Ricksan's tut, my signals worked on the first try. Now to add audio, and I think i've found a workaround for the gate lights.
SMMDigital
 

Re: Level Crossings - Making Your Own

Unread postby SMMDigital » Thu Oct 21, 2010 3:48 am

The early Test Beta version of the SMM Level Crossing replacement is now online at http://www.smmdigital.net. If you are not technically savy at the internal workings of Railworks (or your computer), you may want to pass on testing this and wait for the final version.

@Hawk - You can remove the Cantilever Signals from the website's file library. Pretty soon i'll have new versions of these for distribution.

crossings800.jpg
You do not have the required permissions to view the files attached to this post.
SMMDigital
 

Re: Level Crossings - Making Your Own

Unread postby Hawk » Thu Oct 21, 2010 8:24 am

SMMDigital wrote:@Hawk - You can remove the Cantilever Signals from the website's file library.

Done! !*salute*!
Hawk
 

Re: Level Crossings - Making Your Own

Unread postby SCLALINE » Thu Oct 21, 2010 9:43 am

You Rock!!!!
BTW i made some adjustments to the trees and will send them to You soon
User avatar
SCLALINE
 
Posts: 672
Joined: Sun Oct 03, 2010 10:19 am
Location: Orlando, FL

Re: Level Crossings - Making Your Own

Unread postby Conner » Wed Nov 02, 2011 3:39 am

I am sorry for bumping up an old post but i am busy to make my own dutch crossing. I want to know how i get flashing lights in Ts2012. The way told here in the first seems not to work anymore.

Hope somebody can help me out. !!*ok*!!
Conner
 


Return to Scenery Design

Who is online

Users browsing this forum: No registered users and 1 guest