Thanks for the offer. Actually, I did not get around touching Blender anyway, messing with Lua is enough to waste a day. I just used the shunt signal from RSC for "something animated". Anyway, here it is:
http://andis.ukts.googlepages.com/AnimatedCrossing.zip
Temporary usage guide is this:
Make a source folder (like "Animated Crossing" under AndiS or Reppo.
Unzip the above archive. You will find a Lua script and a blueprint with the same name.
Now you have 2 options.
1) If you have nothing animated ready, copy the following from the RW signal source distribution, folder RailNetwork/Signals/UK Semaphore/Sem_Shunt (European version):
pt_shunt.IGS
pt_shunt_ToGo.IA
pt_shunt_ToStop.IA
the Textures folder
one level up, you find the LightGlows folder, which you put besides the Textures folder in your source folder.
Now you export the my blueprint with fingers crossed.
Then you start the game, click the blue cube to select the "Animated Crossing" product, find it as a signal under the same name, place it, with link 0 pointing to the "road crossing" and link 1 pointing away from it. In other words, link 0 goes where you want to start the closing animation if a train travels in the direction shown by the arc of the link. Link 1 goes where you want to start the closing for the opposite direction.
2) If you have something animated and gate-shaped to try out, open the Lua script.
Look for the line starting "-- commenting out any of the following" (line 17). Following that, you find 4 lines defining the names of your animations. Just change the names between the quotes. If you don't have one of the animations, comment the line out by prefixing --.
The animations are:
- Warning, played before the gates actually close.
- Closing of the gates.
- Something played all the time during the gates are closed (like a flashing light).
- Opening of the gates.
I only tested the closing and opening of the gates. The continuous loop needs a little work, the current version does not include that simply because I did not get around testing it.
I have no idea about sounds, but they would be easy to add, be they animations, or be they started by this system call I came across once. Anyone interested (and having such sounds) just tell me.
For double track, clone the blueprint and change the number of track links from 2 to 4. There is no limit to the number of tracks, but links 0, 2, 4, ... must always point to the crossing and 1, 3, 5, ... away from it.
I foresaw the construction of complex gates by composing them in the asset editor, with gates and flashing lights being child elements of the signal blueprint. However, I am not so sure this is a popular idea, because the asset editor is not so popular.
More important, I think that for prototypical behaviour, we don't get around independent objects which then can be combined and arranged by the route builder as needed. Under this scheme, you would have innocent looking items with 1 track link sending "close the gates" to the crossing. There, you would have one or more items looking like gates of traffic lights, each of which has as many links as there are tracks in the crossing.
The big plus would be, that you could open the gate as soon as the train is a few metres away. Currently, the gate is kept closed until the whole train passed the alarming point for the opposite direction, which is quite long.
The other plus is that you can then freely combine different parts (gates, lights) without the need for a new blueprint for each combination.
The downside is that I first need to check with other signal creators which of the meagre 10 message numbers that Kuju granted third-party extensions they already used. Else, there would be stupid interferences with other people's signals. The current (stupid) version is guaranteed to work with any signalling system.
Just try it out, give your thoughts, etc etc ...