RW2 Level Crossings - Developer Notes

Tips and discussion about scenery creation for RailWorks.

RW2 Level Crossings - Developer Notes

Unread postby ricksan » Mon Oct 18, 2010 4:39 pm

Following are a few developer-oriented notes regarding RailWorks 2.

Level Crossings

It's been three years since Rail Simulator was first released. The newest iteration of the product, now titled "RailWorks2 TrainSimulator," features the addition of working level crossings. To see the US version, fire up the Barstow to San Bernardino route and drive a train across the University Parkway crossing, 5 miles north of the SB station. The crossing has a pair of warning flasher signals, each with an integral gate. Yes, the flashers are still amber instead of red, but other than that there's nothing to complain about. When a train approaches, the flashers operate and the warning bell sounds. Some ill-mannered motorists will continue to pass through the crossing, but after a brief delay the gates come down and everybody stops. Not long after the train clears the crossing, the gates rise, the flashers turn off, the bell goes silent and everyone continues on their way.

Very nice!

Things like flasher timing and the trigger distances of the train for various actions are controlled by variables in a LUA script which you can easily edit to your liking. It's called lc_us.lua and you can find it in the LevelCrossings folder under RailSimulatorUS.

In this post I'll address how to install a level crossing ("grade crossing" in the US).

Installing a grade crossing is a little tricky. There are several steps and they have to be done properly. All mouse clicks are with the left button except where otherwise noted.
1. In the World Editor, navigate to the grade crossing you want to protect. RS.com has provided a single US-style crossing object that incorporates two each of the familiar BSB signals and gates. This time around, of course, they're animated. You'll find the crossing object labeled "Level Crossing US" under the Track Infrastructure category (semaphore icon) of the Object Tools (house icon). Select it.
2. click somewhere in the intersection. The location is not critical. This sets in place the level crossing's placement gizmo, which is simple a gray box. It also sets out the signals and gates, but probably not where you'll want them. We'll fix that in a bit.
3. Click on each track. That places a double-headed arrow on the track. Again, the exact location isn't critical, but if neatness is your thing, more or less along the center line of the road would be appropriate. Once you have placed arrows on all the tracks, right click (important: right click once only).
4. Click the road on one side of the tracks, again more or less along the center line and about where you want the cars to stop. Now Shift+click the road on the other side of the tracks. Right click. There should now be two single-headed arrows on the road on either side of the tracks. Both arrows should be pointing towards the tracks.
5. Drag and rotate each signal and each gate into place the same way you would for any other scenery object. Right click.
If you mess up along the way, you'll have to delete the whole object and start over. Otherwise you're done!

Note that the right clicks have to be just so: only the three clicks, when and where mentioned here, will work.

In edit mode, when you click on the gray gizmo, you should see something like this:

Image

So can we animate the flasher lights on the gates? Is there any code in the LUA script we can add to or modify to our advantage? Can we add the machinery sound of the gates raising and lowering? Time will tell. The product has only just been released and it will take additional experimentation by the user community to answer these and similar questions. In the meantime, I hope this is enough information to get you going. In a few days I hope to post a brief tutorial for building your own custom crossing object. (I had one ready to go but RS.com changed a few things over the weekend!)

Other Items of Note

Export / Export This

Blueprint Editor users will notice that a new button, labeled "Export This," has been added. According to RS.com, the button exports the current blueprint but none of the referenced blueprints. This was done as a time saver, primarily for complex models with many blueprints such as steam locomotives. In most cases, "Export" will suffice.

Access to the World Editor

In RW2 the fly-out (fly-up?) panel at the bottom of the screen is gone! To get into the World Editor in a free roam scenario you have to click on a locomotive (one with a Driver, that is), click on the X button on the new user interface, and select World Editor from the black menu. What a pain!

Well not really. You can simply use the Ctrl+E shortcut. Actually, it was there before the advent of RW2, but not everybody, including me, knew about it.
ricksan
Forum Mod
 
Posts: 311
Joined: Fri Feb 13, 2009 10:55 am
Location: Bandon, OR USA

Re: RW2 Level Crossings - Developer Notes

Unread postby SMMDigital » Mon Oct 18, 2010 7:23 pm

Ricksan, is there any way you could PM me a copy of the US lua file? Due to work and other considerations, I won't be able to get the RW2 update until late in the week. I want to print out the script and see if there is any hope in adapting the SMM Crossing signals to it.
SMMDigital
 

Re: RW2 Level Crossings - Developer Notes

Unread postby g_nash » Mon Oct 18, 2010 7:38 pm

ricksan wrote:Following are a few developer-oriented notes regarding RailWorks 2.

In a few days I hope to post a brief tutorial for building your own custom crossing object. (I had one ready to go but RS.com changed a few things over the weekend!)



would appreciate that .. will be a couple of weeks before I can devote any real time to modeling these , advanced knowledge of pittfalls always helpfull
g_nash
 
Posts: 461
Joined: Fri Feb 13, 2009 11:43 pm

Re: RW2 Level Crossings - Developer Notes

Unread postby ricksan » Mon Oct 18, 2010 8:23 pm

I don't know if it's legal to make the LUA script available through this medium. Probably is, but it won't do much good. The RW2 Level Crossing setup is a different concept than the signal-based crossing that SMMDigital made. Although the LUA script has a major influence on Level Crossing behavior, altering it isn't the answer. The part animations have to be just so, and a new Level Crossing blueprint has to be created, to serve as a container for the child animated objects as well as the bell sound and the LUA script.

As I mentioned, I had a Level Crossing object with custom child objects working in the RW2 Beta as of last Thursday, but over the weekend RS.com modified the way the flashers are animated. Please give me a chance to figure that aspect of the object out. Once everything checks out again I'll write up the tutorial I promised. I anticipate there will be little need for modifications of the LUA script other than to suit personal preferences.
ricksan
Forum Mod
 
Posts: 311
Joined: Fri Feb 13, 2009 10:55 am
Location: Bandon, OR USA

Re: RW2 Level Crossings - Developer Notes

Unread postby SCLALINE » Mon Oct 18, 2010 10:46 pm

Im hoping so for now i'll keep SMM's signals as they look a heck of a lot better
User avatar
SCLALINE
 
Posts: 672
Joined: Sun Oct 03, 2010 10:19 am
Location: Orlando, FL

Re: RW2 Level Crossings - Developer Notes

Unread postby SMMDigital » Mon Oct 18, 2010 11:21 pm

They do look a lot better (biased), but they don't stop traffic or work correctly with multiple AI trains. Now, there is another issue that I have not considered prior to now.

Will these level crossings work with Scale Roads?

As I understand it, the traffic in RW is blueprinted into the roads. The traffic in scaled roads is a seperate loft to floats above the road. Im thinking that a level crossing built with ScaleRoads will not stop traffic.
SMMDigital
 

Re: RW2 Level Crossings - Developer Notes

Unread postby GreatNortherner » Tue Oct 19, 2010 4:56 am

Hi,

Thanks Rick for your detailed instructions, very helpful indeed!

For all those that want to use other 3rd party or even the default lights-only crossbucks on the new working grade crossings, we can always do the quick'n'dirty trick: place the new grade crossing as per instructions, then bury the signal objects underground, then place your own (static) signals or crossbucks instead. Unless the new system is much more 'touchy' than RW usually is, traffic should still stop and you use whichever crossing signal you like.

They should also work with SR (or any other 3rd party road.) Technically speaking, the traffic sections of SR are also road lofts, only without a visible road section attached to them. The only tricky bit might be to actually place the "traffic stopper gizmos" on the SR traffic road section and not the visible (traffic-free) road section. Might be a bit tedious, but should work.

Cheers!
Michael
User avatar
GreatNortherner
 
Posts: 1584
Joined: Sun Feb 15, 2009 11:19 am
Location: Czech Republic

Re: RW2 Level Crossings - Developer Notes

Unread postby SMMDigital » Tue Oct 19, 2010 7:42 am

Well, I have begun to dissect the Level Crossing Signals (caught a break and was able to download this morning). I can't make any sense out of the Script file. I can see where it is calling for certain functions, but I can't find the animations or assets that it's calling for. Very strange this thing is.

Through a bit of trickery and substitution, I was able to get one of my crossings into the level crossing structure, so it's confirmed that I can do that. I would, however have to break the SMM crossings into several sections. I'm not exactly sure why RSC decided to model these crossings in two sections.

On a personal note, stopping traffic and responding to trains aside, i'm very disappointed in the Level Crossings. These are the same poor looking things that were released four or five years ago. I would expect that if they were going to go to the effort of making level crossings, they would try to make them a bit more accurate looking at the same time. Railworks can handle so much more, poly-wise, than these poor things are giving. And as a nitpick, the gate-motor boxes are on the wrong side, most modern signals (made within last few years) only have one weight, and the lights are still yellow! Very disappointed indeed.

P.S. - I offered to let RSC use my crossing signals a couple of months ago. I never got reply to the PM.

UPDATE 2010-019 0900 - I have figured out the animation calls for the script. Now it seems to be a matters of adapting the shape files i've already got and doing some animation work. To Ricksan and anyone else who might be interested, here are the Animation calls:

10 -- Animation names
11 ANIM_OPEN = "open" -- Applies to crossing barrier (CrossingBarrier01.Geo)
12 ANIM_CLOSED = "open" -- Applies to crossing barrier (CrossingBarrier01.Geo)
13
14 NODE_CLOSED_LEFT = "lc_lightsleft" -- CrossingLights01.ban
15 NODE_CLOSED_RIGHT = "lc_lightsright" -- CrossingLights01.ban

Once I opened up the blueprint files of each of these signals, it became clear what names were called.
SMMDigital
 

Re: RW2 Level Crossings - Developer Notes

Unread postby Hawk » Tue Oct 19, 2010 8:06 am

SMM - After this RW update, do your signals in the library here still work?

Should they remain in the library, or be deleted?
Hawk
 

Re: RW2 Level Crossings - Developer Notes

Unread postby micaelcorleone » Tue Oct 19, 2010 8:20 am

For me they still work (the normal ones).
But I have a question: Mine are the normal crossings from smmdigital.net, but in railworksamericas's file library there are "cantilever" signals. So what's the difference?
Thanks for answering. !*salute*!
User avatar
micaelcorleone
 
Posts: 1668
Joined: Tue Oct 05, 2010 11:04 am
Location: Bavaria, Germany

Re: RW2 Level Crossings - Developer Notes

Unread postby SMMDigital » Tue Oct 19, 2010 4:28 pm

Hawk, lets leave the signals in the library for right now. I've already seen a couple of suggestions on how to get them to co-exist with the RW level crossings. i should know within a couple of weeks if i'm going to be able to adapt them, then we'll deal with them from there.

Micheal, the cantilevers are built on the same scripts as the normal crossings, but are flasher lamps placed on cantilevered structures to permit better visibility at the crossing.
SMMDigital
 

Re: RW2 Level Crossings - Developer Notes

Unread postby Hawk » Tue Oct 19, 2010 8:22 pm

SMMDigital wrote:Hawk, lets leave the signals in the library for right now. I've already seen a couple of suggestions on how to get them to co-exist with the RW level crossings. i should know within a couple of weeks if i'm going to be able to adapt them, then we'll deal with them from there.

Not a problem. !*salute*!
Hawk
 

Re: RW2 Level Crossings - Developer Notes

Unread postby Trainguy76 » Tue Oct 19, 2010 10:41 pm

SMMDigital wrote:Will these level crossings work with Scale Roads?

As I understand it, the traffic in RW is blueprinted into the roads. The traffic in scaled roads is a seperate loft to floats above the road. Im thinking that a level crossing built with ScaleRoads will not stop traffic.


Short answer yes, other answer is... sorta.

http://www.youtube.com/watch?v=rl6iCw2iG6w

(I never placed the road asset, so it's not there.)

Reminds me of going to school.
User avatar
Trainguy76
 
Posts: 630
Joined: Mon Feb 15, 2010 12:46 am
Location: San Bernardino, California

Re: RW2 Level Crossings - Developer Notes

Unread postby SMMDigital » Tue Oct 19, 2010 11:04 pm

"It's like going to school again."

You said it! I've spent my last two breaks poring over blueprints, ban files, and lua scripts trying to figure this thing out. I've had to pretty much throw out what I learned making the signals the first time around. What chaps my but about it is that the signal script is well-nigh complex, but the shape file GEO is only 4kb! (The SMM sigs are up in the 1/2 MB range).

Talk about polishing a turd!
SMMDigital
 

Re: RW2 Level Crossings - Developer Notes

Unread postby SMMDigital » Wed Oct 20, 2010 6:56 am

The shape files are now attached to the level crossing asset, but they are not animated nor attached to the script. Any suggestions or help on how to animate them the RSC way would be appreciated.

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

Next

Return to Scenery Design

Who is online

Users browsing this forum: No registered users and 1 guest