by SMMDigital » Sat Dec 17, 2011 4:11 pm
A simple repeating beacon on a building or tower is totally different than a crossing signal, and it should affect framerates no more than a static point light.
The difference between the AndiS and Kuju signal scripts is quite significant. In the AndiS script version, each individual light is animated. That means each light, is treated as a moving part and has to be set to an "off" position inside the signal, and an "on" position outside the signal. The great thing about it is that the animation can be repeated in an infinite 2-second loop as long as the train is between the track sensors. The bad thing as that all together, including gate animations, you may have fifteen different animations to keep track of in a single signal.
The kuju script is a simple "on" / "off" render, meaning that no matter how many parts you have, if they are all named the same for what the script requires, they are either rendered in the game or they're not - no moving parts. The problem comes on animating the flashing lights on the gate. In the AndiS script, there are three gate animations - open, closing, and closed. Train triggers open gate, gate closes, stays closed with lights flashing then plays the closing animation backwards. In the Kuju script, there is only one animation - the closed gate. When a train triggers the sensor, the animation is played BACKWARDS to simulate a closed gate. The script thenp checks the track status every so often to see if it should keep the gate closed. That is the reason why the gate lights "lock", because there is no closed gate animation. Halfway through the train, the script gets ready to play the gate animation again, this time in forward motion, when then end of the train passes.
As I said earlier, the length of the gate animation can be lengthened. Let say, to 30 seconds, so from the time your gate goes down to thirty seconds into the train, the lights will flash. If the train is 70 seconds long, then you will have 20 seconds of locked lights, then 30 seconds before the train ends, the lights flash again, right? No. Once the animation begins to repeat, it has to complete it's cycle. So in this case, you will get gates down an flashing for 90 seconds - 20 seconds after the train has passed. Not a big deal to me, but my mailbox would fill up real quick if I allowed that. Then there is the framerate issue. Lengthening the gate animation so the lights will flash all through the train for some reason really slows down the game.
Look over the typos, i'm on my Hemroid Dumbphone.