Is there a way to make the horn trigger the bell?

Help, problems, solutions, questions and answer about the new TS2014 upgrade - all in one place.

Is there a way to make the horn trigger the bell?

Unread postby Scott » Sat May 31, 2014 1:56 pm

Since I got Canadian Mountain Passes I noticed when i sounded the horn the bell rang on its own, is there a way to make the horn trigger the bell?
Scott
 
Posts: 30
Joined: Wed Oct 02, 2013 3:16 pm

Re: Is there a way to make the horn trigger the bell?

Unread postby buzz456 » Sat May 31, 2014 2:00 pm

Scott wrote:Since I got Canadian Mountain Passes I noticed when i sounded the horn the bell rang on its own, is there a way to make the horn trigger the bell?


Huh? !*roll-laugh*! You said that's what it is doing?
Buzz
39 and holding.
"Some people find fault like there's a reward for it."- Zig Ziglar
"If you can dream it you can do it."- Walt Disney
Image
User avatar
buzz456
Site Admin
 
Posts: 20902
Joined: Sun Mar 21, 2010 8:30 am
Location: SW Florida

Re: Is there a way to make the horn trigger the bell?

Unread postby Antwerp » Sat May 31, 2014 3:19 pm

Allow me to fix his question to make it more understandable.

"Since I got Canadian Mountain Passes. I noticed when I sounded the horn, the bell rang on its own. Is there a way to make the horn trigger the bell for other locomotives?"
Pharisee - noun - A self-righteous person; a hypocrite.
Antwerp
 
Posts: 952
Joined: Mon Dec 24, 2012 1:54 pm
Location: Antwerp, OH

Re: Is there a way to make the horn trigger the bell?

Unread postby Chacal » Sat May 31, 2014 10:28 pm

Yes, with lua scripting.
Over the hill and gathering speed
Chacal
Site Admin
 
Posts: 6464
Joined: Tue Jul 05, 2011 1:11 pm
Location: Quebec, Canada

Re: Is there a way to make the horn trigger the bell?

Unread postby Scott » Sun Jun 01, 2014 12:17 am

How do you do lua scripting?
Scott
 
Posts: 30
Joined: Wed Oct 02, 2013 3:16 pm

Re: Is there a way to make the horn trigger the bell?

Unread postby Chacal » Sun Jun 01, 2014 1:03 am

That's a big question that I can't answer in a post.
Like asking "How do I do brain surgery?".

In short, scripts let you program what happens when a player interacts with the controls of an engine.
The engine blueprint lists the control values and links them to actions from the player (e.g. pulling the horn lever).
Default results are already built-in (e.g. sounding the horn), but you can add extra results (e.g. sounding the bell) by writing a script.

Have a look at the developer docs in the RWA file library. There is one about signals.
It is the basic reference for scripting in Railworks.

Then find some lua scripts in your Railworks engines, for example the Centipede or the recently published Alco RS1 for the RW&A route.
Open them in your favorite text editor and compare them with the docs, and read the comments in the scripts.
You will also find posts about this topic here at RWA, on the UKTrainsim forum and in various tutorials found with a Google search.

Here are a few examples of engine lua scripts:
Assets\Britkits\Alco\RailVehicles\Diesel\RS3\Default\Engine\RS3_EngineScript.lua
Assets\GreatNortherner\EMD-SD7-9\RailVehicles\Engines\SD7\Simulation\sd7 simulation.lua
Assets\Kuju\RailSimulatorUS\RailVehicles\Diesel\ES44AC\Black\Engine\ES44ACEngineScript.lua
Assets\Kuju\RailSimulatorUS\RailVehicles\Diesel\F7\Default\UPRR\F7A_EngineScript.lua
Assets\Kuju\RailSimulatorUS\RailVehicles\Diesel\SD40-2\Black\Engine\SD40-2EngineScript.lua

You can find all of them by opening a command window in your railworks\assets folder and typing this command:
dir /B /W /S *.lua > lua.txt

Then open lua.txt and you'll see a list of all your scripts. Several hundreds of them.

Hope this helps.
Have fun.
Over the hill and gathering speed
Chacal
Site Admin
 
Posts: 6464
Joined: Tue Jul 05, 2011 1:11 pm
Location: Quebec, Canada

Re: Is there a way to make the horn trigger the bell?

Unread postby Scott » Sun Jun 01, 2014 7:39 am

Thanks for the answer I'll look in to it.
Scott
 
Posts: 30
Joined: Wed Oct 02, 2013 3:16 pm

Re: Is there a way to make the horn trigger the bell?

Unread postby HankySpanky » Sun Jun 01, 2014 3:18 pm

I thought that I read somewhere that you can delete *.lua files because they aren't necessary and just take up space.
!*don-know!*
"Manny - I need shoes!"
User avatar
HankySpanky
 
Posts: 323
Joined: Mon Jul 15, 2013 2:50 pm
Location: Ft. Lauderdale

Re: Is there a way to make the horn trigger the bell?

Unread postby Chacal » Sun Jun 01, 2014 3:23 pm

You can delete the .lua files if you have the corresponding .out files, which are the compiled sripts.
If you don't, then deleting the lua files will result in your engines not working correctly.
Also by deleting the lua files you won't be able to see the source code anymore and learn about scripting.
Over the hill and gathering speed
Chacal
Site Admin
 
Posts: 6464
Joined: Tue Jul 05, 2011 1:11 pm
Location: Quebec, Canada

Re: Is there a way to make the horn trigger the bell?

Unread postby Scott » Sun Jun 01, 2014 7:08 pm

It's a shame you can't see the out files to see how it was done.
Scott
 
Posts: 30
Joined: Wed Oct 02, 2013 3:16 pm


Return to TS 2014 - Train Simulator

Who is online

Users browsing this forum: No registered users and 1 guest

cron