Tender lamps... for a friend!

Discuss anything related to Train Simulator from DoveTail that does not fit in one of the more specific categories.

Tender lamps... for a friend!

Postby JamesLit » Thu Jul 02, 2015 10:20 pm

Hi guys,

Asking for a friend. :D

What would be the best way to approach fully working tender lamps that talk to the lamps on the front of the loco?

One would assume scripting. He's giving scripting it a go but is having some difficulties. What kind of approach should he be taking? Thanks gents. :)
The Forge Simulation | Like us on Facebook!
Owner & Director | Content built with care, not compromises.
User avatar
JamesLit
Driver
 
Posts: 370
Images: 26
Joined: Mon Apr 07, 2014 3:26 pm
Location: Kent
Has thanked: 433 times
Been thanked: 141 times

Re: Tender lamps... for a friend!

Postby VictoryWorks » Fri Jul 03, 2015 9:01 am

Consist messages are what you need on this one.

Basically whenever a lamp change of some kind occurs on the loco then you transmit a message to the tender. When the message is received by the tender it shows/hides lamps, glows, etc. in the normal way.
The way you choose to send the information in the message is really up to you - one by one, as a string of all of them (e.g. 1100). You just need to be able to read the message when it's received - string.sub is your friend on that one.
User avatar
VictoryWorks
Driver
 
Posts: 333
Joined: Mon Apr 07, 2014 1:22 pm
Has thanked: 41 times
Been thanked: 224 times

Re: Tender lamps... for a friend!

Postby JamesLit » Fri Jul 03, 2015 5:47 pm

VictoryWorks wrote:Consist messages are what you need on this one.

Basically whenever a lamp change of some kind occurs on the loco then you transmit a message to the tender. When the message is received by the tender it shows/hides lamps, glows, etc. in the normal way.
The way you choose to send the information in the message is really up to you - one by one, as a string of all of them (e.g. 1100). You just need to be able to read the message when it's received - string.sub is your friend on that one.


I thought as much on the consist messages front!

I'll get that back to him and hopefully we can wrap this one up shortly. Many thanks, Pete. :)
The Forge Simulation | Like us on Facebook!
Owner & Director | Content built with care, not compromises.
User avatar
JamesLit
Driver
 
Posts: 370
Images: 26
Joined: Mon Apr 07, 2014 3:26 pm
Location: Kent
Has thanked: 433 times
Been thanked: 141 times

Re: Tender lamps... for a friend!

Postby cjbarnes5294 » Fri Jul 03, 2015 6:33 pm

It's worth adding to Pete's excellent description just to say that you should only send a consist message when you need to, not just hammer it out every time the script updates, because it can be particularly costly on runtime performance. So for example, only send a consist message if there is a detected change in a lamp control value since the last update and when the control value is exactly equal to 1, or 0, or whatever. This helps to keep everything running efficiently.

Chris
The Red Queen Hypothesis, applicable to train sim development?

"Here, you see, it takes all of the running you can do, to keep the same place."
cjbarnes5294
Driver
 
Posts: 398
Images: 82
Joined: Mon Mar 31, 2014 12:40 pm
Location: Gloucestershire/North Yorkshire
Has thanked: 551 times
Been thanked: 187 times

Re: Tender lamps... for a friend!

Postby JamesLit » Fri Jul 03, 2015 10:59 pm

cjbarnes5294 wrote:It's worth adding to Pete's excellent description just to say that you should only send a consist message when you need to, not just hammer it out every time the script updates, because it can be particularly costly on runtime performance. So for example, only send a consist message if there is a detected change in a lamp control value since the last update and when the control value is exactly equal to 1, or 0, or whatever. This helps to keep everything running efficiently.

Chris


Thanks Chris, thankfully he's knowledgeable enough to know the right thing there - but it's an important thing for anyone else reading this thread who may not have that knowledge! :D Not heard whether he's had any luck yet, I shall keep pestering him.... :)
The Forge Simulation | Like us on Facebook!
Owner & Director | Content built with care, not compromises.
User avatar
JamesLit
Driver
 
Posts: 370
Images: 26
Joined: Mon Apr 07, 2014 3:26 pm
Location: Kent
Has thanked: 433 times
Been thanked: 141 times

Re: Tender lamps... for a friend!

Postby Carinthia » Tue Jul 14, 2015 10:01 am

It may be worth studying the Steam Sounds Supreme mods to the Jubilee. This achieves headlamp control on the tender as on the smokebox end but it is at the expense of the standard automatic tail lamp arrangement on the rear of the train.

John
User avatar
Carinthia
Full Time Fireman
 
Posts: 53
Joined: Tue May 20, 2014 3:09 am
Has thanked: 4 times
Been thanked: 2 times

Re: Tender lamps... for a friend!

Postby JamesLit » Tue Jul 14, 2015 5:28 pm

Carinthia wrote:It may be worth studying the Steam Sounds Supreme mods to the Jubilee. This achieves headlamp control on the tender as on the smokebox end but it is at the expense of the standard automatic tail lamp arrangement on the rear of the train.

John


An idea indeed but I'm pretty sure all SSS related scripts are compiled .out files.

He seems to have got it sorted now so thanks for your help, all.
The Forge Simulation | Like us on Facebook!
Owner & Director | Content built with care, not compromises.
User avatar
JamesLit
Driver
 
Posts: 370
Images: 26
Joined: Mon Apr 07, 2014 3:26 pm
Location: Kent
Has thanked: 433 times
Been thanked: 141 times


Return to Train Simulator Mess Room

Who is online

Users browsing this forum: No registered users and 1 guest