Horns in AI

Approach_Medium

Trainz Addict
Hi;
I want to have my AI trainz sound their horns numerous times as they approach grade crossings. Do I need multiple triggers for this, or can I use a single trigger and have the horn blast multiple times?

I haven't done much with triggers, so if anyone can suggest a good tutorial, that would work.

Thanks

FW
 
There are some whistle posts available that you can assign scripts. B&M Whistle Post is one of them. When the train approaches, it will blow the horn.

Another way is to assign an HTML object to a trigger or a trackmark When the train passes it will run the script and play the hornsound. There's are problems with this method, which I can't seem to solve. The train will pass by the trigger once, and the horn will sound, but if another train runs over it, the horn won't sound. If there are two trackmarks - one for either direction - a train running in one direction will blow the horns at both instances once, and then they're both disabled. Also blowing the horn twice for both directions kind of defeats the purpose of this doesn't it.

Maybe somone else, whose better at scripting can chime on this.

John
 
There are some whistle posts available that you can assign scripts. B&M Whistle Post is one of them. When the train approaches, it will blow the horn.

Another way is to assign an HTML object to a trigger or a trackmark When the train passes it will run the script and play the hornsound. There's are problems with this method, which I can't seem to solve. The train will pass by the trigger once, and the horn will sound, but if another train runs over it, the horn won't sound. If there are two trackmarks - one for either direction - a train running in one direction will blow the horns at both instances once, and then they're both disabled. Also blowing the horn twice for both directions kind of defeats the purpose of this doesn't it.

Maybe somone else, whose better at scripting can chime on this.

John
Maybe I'll try the whistle posts. I am trying to learn scripting, and the horn might be a fairly easy one to start with.

Edit: Looks like BNSF50 has done it for me! He's got 3 "Crossing ahead whistle post": <kuid:39134:102220>, <kuid:39134:102221>, <kuid:39134:102222>

FW
 
Last edited:
There is a whistle sign rule. Add it to the session then add a trackmark where you want the engine to sound. Then add the trackmark to the whistle sign rule and weather you want it to blow horn once or twice and if you want it to turn on its bell.

hth,
hert:wave:
 
Thank you all! I'm going to try this later today.

Edit: I'm having trouble finding the Whistle rule on DLS. have been looking in both CM and the black pages. What keyword should I use? Tried Whistle, horn; get a lot of sounds, and boards, but nothing for rules.

Thanks
FW
 
Last edited:
There is a Horn track mark in surveyor under tracks that can be placed anywhere on a track spline that will cause the horn to blow. There a 2 of them, bi-directional & one direction.

Johnny
 
This is what I used ages ago. You'll need to edit the HTML file to make it work. It's pretty easy to use otherwise.

Good luck at scripting. I'll be taking a Java class soon(tm), and after thay perhaps if' I still have my brains left I'll give it a try too.

John
I should learn Java as well. I've been on and off with C++, but probably would get more from J#
I'll check my local library and see what they have. Then, if I really get into it, I can buy the book.

FW
 
Update:
I installed the Whistle Sign Rule, and a trackmark.
I set it to blow the horn twice, and sound the bell for RR Xing.
When the train reached the trackmark, the horn sounded one rather short time only, and the bell started and continued.

I'm not sure if there is any way I can program the horn to sound as I really want it to, but I may have to play with the script.

As for the bell, I'm thinking that I need another trackmark to tell it when to stop?

FW
 
Back
Top