Details of steam loco steam effects
Moderator: Moderators
-
scefhwil
- Well Established Forum Member
- Posts: 907
- Joined: Tue Dec 04, 2001 12:00 am
- Location: Bristol, England
Re: Details of steam loco steam effects
Not certain, but isn't the issue a syntax one? I'm no lua expert but after a lot of problems myself I have resolved to always use a double character comparison symbol. ie where you have
if value > 156.99 then
try using
if value >= 157.00 then
Stuart
if value > 156.99 then
try using
if value >= 157.00 then
Stuart
- spontin
- Well Established Forum Member
- Posts: 990
- Joined: Thu Jan 03, 2002 12:00 am
- Location: Trefriw, North Wales
- Contact:
Re: Details of steam loco steam effects
Hi ..... have tried both but no joy.scefhwil wrote:Not certain, but isn't the issue a syntax one? I'm no lua expert but after a lot of problems myself I have resolved to always use a double character comparison symbol. ie where you have
if value > 156.99 then
try using
if value >= 157.00 then
Stuart
Is the Control parameter correct...ie. BoilerPressureGaugePSI ....?
I noticed you spelt Gauge as Guage on the US site but presumed that was a typo..........??
Steve
Author
TS2022 - FR & WHR Route & Rolling Stock
TS2022 - Talyllyn Adventure 2.1
MSTS Talyllyn Railway route
All available from https://sprailways.co.uk
Contact via https://sprailways.co.uk/support
TS2022 - FR & WHR Route & Rolling Stock
TS2022 - Talyllyn Adventure 2.1
MSTS Talyllyn Railway route
All available from https://sprailways.co.uk
Contact via https://sprailways.co.uk/support
-
scefhwil
- Well Established Forum Member
- Posts: 907
- Joined: Tue Dec 04, 2001 12:00 am
- Location: Bristol, England
Re: Details of steam loco steam effects
Steve, I have the following in my script
gBPprev = Call( "*:GetControlValue", "BoilerPressureGaugePSI", 0 )
Which makes me think. Are you placing your scripting in the OnControlValueChange section? Mine is in the Update part. I'm not certain but have always assumed that OnControlValueChange reflected key/mouse changes so "name" is never "BoilerPressureGaugePSI"?
Stuart
gBPprev = Call( "*:GetControlValue", "BoilerPressureGaugePSI", 0 )
Which makes me think. Are you placing your scripting in the OnControlValueChange section? Mine is in the Update part. I'm not certain but have always assumed that OnControlValueChange reflected key/mouse changes so "name" is never "BoilerPressureGaugePSI"?
Stuart
- spontin
- Well Established Forum Member
- Posts: 990
- Joined: Thu Jan 03, 2002 12:00 am
- Location: Trefriw, North Wales
- Contact:
Re: Details of steam loco steam effects
Thanks Stuart. I think you've hit on the answer. I was simply assuming that Bill Hobbs' scripting for the Safety Valves should simply be replaced by the Pressure Gauge name without thinking through exactly what the Scripting actually performed in code.scefhwil wrote:Steve, I have the following in my script
gBPprev = Call( "*:GetControlValue", "BoilerPressureGaugePSI", 0 )
Which makes me think. Are you placing your scripting in the OnControlValueChange section? Mine is in the Update part. I'm not certain but have always assumed that OnControlValueChange reflected key/mouse changes so "name" is never "BoilerPressureGaugePSI"?
Stuart
I'll make some changes and let you know. Thanks for your help in sorting this problem with me.
Reagrds
Steve
Author
TS2022 - FR & WHR Route & Rolling Stock
TS2022 - Talyllyn Adventure 2.1
MSTS Talyllyn Railway route
All available from https://sprailways.co.uk
Contact via https://sprailways.co.uk/support
TS2022 - FR & WHR Route & Rolling Stock
TS2022 - Talyllyn Adventure 2.1
MSTS Talyllyn Railway route
All available from https://sprailways.co.uk
Contact via https://sprailways.co.uk/support
- spontin
- Well Established Forum Member
- Posts: 990
- Joined: Thu Jan 03, 2002 12:00 am
- Location: Trefriw, North Wales
- Contact:
Re: Details of steam loco steam effects
Suart
Success.....I now have working Safety Valves on my Talyllyn locos.
Many thanks for your help and good luck in sorting your generic updates for other loco types.
Regards
Steve
Success.....I now have working Safety Valves on my Talyllyn locos.
Many thanks for your help and good luck in sorting your generic updates for other loco types.
Regards
Steve
Author
TS2022 - FR & WHR Route & Rolling Stock
TS2022 - Talyllyn Adventure 2.1
MSTS Talyllyn Railway route
All available from https://sprailways.co.uk
Contact via https://sprailways.co.uk/support
TS2022 - FR & WHR Route & Rolling Stock
TS2022 - Talyllyn Adventure 2.1
MSTS Talyllyn Railway route
All available from https://sprailways.co.uk
Contact via https://sprailways.co.uk/support
- spontin
- Well Established Forum Member
- Posts: 990
- Joined: Thu Jan 03, 2002 12:00 am
- Location: Trefriw, North Wales
- Contact:
Re: Details of steam loco steam effects
Stuart
Sorry...I have a further question that you may have come across.
Does the function call "GetIsPlayer" work as intended?? I'm finding that any calls I make to change smoke rates in the Update function are affecting the AI locos as well as the Player loco, even though the calls are being made after the "EndUpdate" call when loco is not the Player loco.
Have you noticed this or am I again missing some obvious statement?
As always, any help or advice appreciated.
Steve
Sorry...I have a further question that you may have come across.
Does the function call "GetIsPlayer" work as intended?? I'm finding that any calls I make to change smoke rates in the Update function are affecting the AI locos as well as the Player loco, even though the calls are being made after the "EndUpdate" call when loco is not the Player loco.
Have you noticed this or am I again missing some obvious statement?
As always, any help or advice appreciated.
Steve
Author
TS2022 - FR & WHR Route & Rolling Stock
TS2022 - Talyllyn Adventure 2.1
MSTS Talyllyn Railway route
All available from https://sprailways.co.uk
Contact via https://sprailways.co.uk/support
TS2022 - FR & WHR Route & Rolling Stock
TS2022 - Talyllyn Adventure 2.1
MSTS Talyllyn Railway route
All available from https://sprailways.co.uk
Contact via https://sprailways.co.uk/support
-
scefhwil
- Well Established Forum Member
- Posts: 907
- Joined: Tue Dec 04, 2001 12:00 am
- Location: Bristol, England
Re: Details of steam loco steam effects
Hi Steve,
Can't say I've had any problems with GetIsPlayer, it has always returned acturately as far as I have used it. I seem to recall though that Bill Hobbs in his documentation had a secondary GetIsPlayer check at the start of the Update routine (see link in my post on 24th March above). Maybe he found the same thing as you?
Stuart
Can't say I've had any problems with GetIsPlayer, it has always returned acturately as far as I have used it. I seem to recall though that Bill Hobbs in his documentation had a secondary GetIsPlayer check at the start of the Update routine (see link in my post on 24th March above). Maybe he found the same thing as you?
Stuart
- spontin
- Well Established Forum Member
- Posts: 990
- Joined: Thu Jan 03, 2002 12:00 am
- Location: Trefriw, North Wales
- Contact:
Re: Details of steam loco steam effects
Ok....just for information.
I've done some simple tests to see if the call "GetIsPlayer" works as I think it should. My understanding (and open to correction, please) is that the call should return a value of "true" if the loco is selected as a "Player loco" and false if not (ie. an AI loco). I did this by simple changing the smoke colour if the call was true or false (red to black for example)
I found that the call only ever returns a value of "true" as soon as the scenario started (ie not picked a loco to start using in a free scenario).
I also found something strange when looking at the Script Manager tab for LUA errors in that as soon as I picked a loco, I had a LUA error "166 = Unable to execute non-function: Initialise".
. This error occurs in the standard scenarios supplied by RS so it may be nothing to worry about. However it just makes me a little less confident in the use of some of these calls.
The bottom line is that I want to script some commands for AI trains differently to Player trains (for smoke emitter controls) and at the moment I can't seem to be able to identify them.
Perhaps Adam or Derek can help by updating the WikiHelp with more info on the use and availability of the Engine Script Commands now that more and more people are trying to use them to improve the impact of RailWorks.
Again, if I've mis-understood the "GetIsPlayer" call then I apologise for timewasting but hopefully someone can put me right.
Regards
Steve
I've done some simple tests to see if the call "GetIsPlayer" works as I think it should. My understanding (and open to correction, please) is that the call should return a value of "true" if the loco is selected as a "Player loco" and false if not (ie. an AI loco). I did this by simple changing the smoke colour if the call was true or false (red to black for example)
I found that the call only ever returns a value of "true" as soon as the scenario started (ie not picked a loco to start using in a free scenario).
I also found something strange when looking at the Script Manager tab for LUA errors in that as soon as I picked a loco, I had a LUA error "166 = Unable to execute non-function: Initialise".
The bottom line is that I want to script some commands for AI trains differently to Player trains (for smoke emitter controls) and at the moment I can't seem to be able to identify them.
Perhaps Adam or Derek can help by updating the WikiHelp with more info on the use and availability of the Engine Script Commands now that more and more people are trying to use them to improve the impact of RailWorks.
Again, if I've mis-understood the "GetIsPlayer" call then I apologise for timewasting but hopefully someone can put me right.
Regards
Steve
Author
TS2022 - FR & WHR Route & Rolling Stock
TS2022 - Talyllyn Adventure 2.1
MSTS Talyllyn Railway route
All available from https://sprailways.co.uk
Contact via https://sprailways.co.uk/support
TS2022 - FR & WHR Route & Rolling Stock
TS2022 - Talyllyn Adventure 2.1
MSTS Talyllyn Railway route
All available from https://sprailways.co.uk
Contact via https://sprailways.co.uk/support
Re: Details of steam loco steam effects
Steve
Are you running your lua from the engine lua script or the engine simulation lua script? The simulation script is only run for player trains. Regarding the getisplayer command - it may be that in free roam scenarios once you have selected a train for the player it may remain "player allocated" after you have selected another. I think the core sim operation was geared more towards "standard" scenarios, where you won't get this problem.
Regarding the unable to execute initialise() warning - don't worry about this. The core code is just looking for an initialise function in each script when each object is created (this is part of the OOP architecture). It doesn't represent a problem. You can always define an initialise() stub function and it will go away.
Dave B
Are you running your lua from the engine lua script or the engine simulation lua script? The simulation script is only run for player trains. Regarding the getisplayer command - it may be that in free roam scenarios once you have selected a train for the player it may remain "player allocated" after you have selected another. I think the core sim operation was geared more towards "standard" scenarios, where you won't get this problem.
Regarding the unable to execute initialise() warning - don't worry about this. The core code is just looking for an initialise function in each script when each object is created (this is part of the OOP architecture). It doesn't represent a problem. You can always define an initialise() stub function and it will go away.
Dave B
- spontin
- Well Established Forum Member
- Posts: 990
- Joined: Thu Jan 03, 2002 12:00 am
- Location: Trefriw, North Wales
- Contact:
Re: Details of steam loco steam effects
Hi Davedavveb wrote:Steve
Are you running your lua from the engine lua script or the engine simulation lua script? The simulation script is only run for player trains. Regarding the getisplayer command - it may be that in free roam scenarios once you have selected a train for the player it may remain "player allocated" after you have selected another. I think the core sim operation was geared more towards "standard" scenarios, where you won't get this problem.
Regarding the unable to execute initialise() warning - don't worry about this. The core code is just looking for an initialise function in each script when each object is created (this is part of the OOP architecture). It doesn't represent a problem. You can always define an initialise() stub function and it will go away.
Dave B
Thanks for the reply.
I'm modifying the Engine LUA Script. I haven't touched the Simulation one as I didn't know what is was to represent!
I'll have another look at my scripts in a Standard Scenario form and see what difference there is. I assumed they would work in free roam as there seemed to be some check statements that were being used to ensure the loco was still a Player one.
I confess that the basic scripts that I've "butchered" are ones from Bill Hobbs or ones supplied with the Tornado so am starting out with some unknowns but assumed that they were used for a reason.
Glad to know that the LUA errors that I saw are not linked to my scripts!!
Thanks for the input.
Regards
Steve
Author
TS2022 - FR & WHR Route & Rolling Stock
TS2022 - Talyllyn Adventure 2.1
MSTS Talyllyn Railway route
All available from https://sprailways.co.uk
Contact via https://sprailways.co.uk/support
TS2022 - FR & WHR Route & Rolling Stock
TS2022 - Talyllyn Adventure 2.1
MSTS Talyllyn Railway route
All available from https://sprailways.co.uk
Contact via https://sprailways.co.uk/support
-
scefhwil
- Well Established Forum Member
- Posts: 907
- Joined: Tue Dec 04, 2001 12:00 am
- Location: Bristol, England
Re: Details of steam loco steam effects
I'd like to get this thread back onto the original topic, and also think these lua scripting issues deserve a thread of there own, so I have started one here:-
http://forums.uktrainsim.com/viewtopic. ... 1&t=105041
and will add my reply there.
Stuart
http://forums.uktrainsim.com/viewtopic. ... 1&t=105041
and will add my reply there.
Stuart
-
scefhwil
- Well Established Forum Member
- Posts: 907
- Joined: Tue Dec 04, 2001 12:00 am
- Location: Bristol, England
Re: Details of steam loco steam effects
I would still appreciate any advice on the above, otherwise I will be left to make my own guesses. Anyone?scefhwil wrote: I've managed to create a "pouring water" particle effect (it's not brilliant, but I think it looks effective) and now can switch between steam, smoke and a mix of both depending on the appropriate key presses. I just need now to decide on a condition that would equate to the injector being at max efficiency and thus result in no drain pipe discharges. I really only have the degree of the water value being open to use (varies between 0.00 for closed and 1.00 for fully open). I understand that in reality the actuall water valve opening required is variable (depending on steam pressure?), but what would be an appropriate opening amount to use as approx max efficiency, just to get the effect right?
Stuart
Was at the Dean Forest Railway over Easter and had some enjoyable runs behind GWR Pannier 9681. Unfortunately I couldn't pick up any sounds relating to the injectors, but I did get some good blower effects. This has inspired me to sort out my own steam loco "chuff" audio control in which to incorporate these files. This required some delving into the Black5 proxys. I hadn't really appreciated it but there are actually two chuffs sounds playing at the same time, one a hi pitch chuff and one a lo pitch chuff. The two are then volume level blended to give a different overall sound, ie between a "heavy" chuff (lots of bass) or a "light" chuff (no bass), depending on regulator and reverser levels. However, I also spotted some irregulatities in the scripting and there are some modifier curves that are defined but not used. So I want to create my own modifiers and would like some advise on how both volume level and chuff sound varies on real engines with both reverser setting and regulator setting. Any takers? What would be very helpful would be for volume to related a % level of volume with a % level of each of regulator and reverser, and for blending the hi and lo sounds a description of how each of regulator and reverser effect the change from "heavy" chuff to "light" chuff. Is it important to recognise the "2nd valve" and if so when does it happen and what does it effect (sound wise that is)?
Cheers
Stuart
-
ShySteamer
- New to the Forums
- Posts: 6
- Joined: Thu Mar 25, 2010 9:13 pm
Re: Details of steam loco steam effects
Hi Stuart,
I love what you are trying to do with the steam effects. I'm looking forward to seeing a video at some point.
Just a note about the injectors. In prototypical operation, you would be able to vary the amount of steam as well as water, but as far as I can tell, you can only have the steam on or off in RW - all or nothing. The procedure I use for putting on an injector (I am a fireman on a narrow gauge railway):
- Water on full (lots of water only appears at the overflow pipe).
- Steam on - prototypically you would adjust the steam valve to vary the amount of water going into the boiler.
- Reduce water flow (to match steam) until no water is overflowing.
- Injector is now on and there would be just a tiny amount of water appearing from the overflow. Any water would now be hot and you might see a small amount of steam from the hot water.
If there is no water on at all, and you open the steam valve, all of the steam comes out of the overflow pipe - significant amounts of steam too (almost cylinder drain cocks style) - and you would normally try to avoid doing this as it wastes steam!
In RW, as soon as the water is turned on, the steam would stop as the injector "picks up". (Prototypically, I have found that injectors don't pick up well if you put the steam on first!) So in RW I would say that once both the water and steam are on, there is no degree of injector efficiency as far as the particle effects are concerned. A real fireman would adjust the both flowrates of steam and water so that there would only be a minimum overflow at all levels of injector "efficiency".
To turn the injector off, you would first shut the steam valve (which would cause water to appear at the overflow) and then shut the water off. The water would generally keep flowing for a few seconds as the water valve at the tender or tank will be some distance from the overflow pipe.
I hope this helps!
ShySteamer
I love what you are trying to do with the steam effects. I'm looking forward to seeing a video at some point.
Just a note about the injectors. In prototypical operation, you would be able to vary the amount of steam as well as water, but as far as I can tell, you can only have the steam on or off in RW - all or nothing. The procedure I use for putting on an injector (I am a fireman on a narrow gauge railway):
- Water on full (lots of water only appears at the overflow pipe).
- Steam on - prototypically you would adjust the steam valve to vary the amount of water going into the boiler.
- Reduce water flow (to match steam) until no water is overflowing.
- Injector is now on and there would be just a tiny amount of water appearing from the overflow. Any water would now be hot and you might see a small amount of steam from the hot water.
If there is no water on at all, and you open the steam valve, all of the steam comes out of the overflow pipe - significant amounts of steam too (almost cylinder drain cocks style) - and you would normally try to avoid doing this as it wastes steam!
To turn the injector off, you would first shut the steam valve (which would cause water to appear at the overflow) and then shut the water off. The water would generally keep flowing for a few seconds as the water valve at the tender or tank will be some distance from the overflow pipe.
I hope this helps!
ShySteamer
-
scefhwil
- Well Established Forum Member
- Posts: 907
- Joined: Tue Dec 04, 2001 12:00 am
- Location: Bristol, England
Re: Details of steam loco steam effects
Thanks for the reply ShySteamer, I was beginning to think interest had gone away. Your comments are most helpful and I'm sure now that I will base my injector effects on what you've described.
As posted above I am unfortunately having problems with using my scripts where cab jumping is involved. Seems RW isn't yet ready to be used in the way I'm trying. Have yet to see if the latest update has had any affects though, so here's hoping. If not then I my have to revert to plan A and have separate AI-only locos (bring back the #?).
Stuart
As posted above I am unfortunately having problems with using my scripts where cab jumping is involved. Seems RW isn't yet ready to be used in the way I'm trying. Have yet to see if the latest update has had any affects though, so here's hoping. If not then I my have to revert to plan A and have separate AI-only locos (bring back the #?).
Stuart
- emrhd01
- Very Active Forum Member
- Posts: 4821
- Joined: Thu Aug 03, 2006 1:48 pm
- Location: Nottingham- East Bridgford
Re: Details of steam loco steam effects
Hi Stuart,Thanks for the reply ShySteamer, I was beginning to think interest had gone away.
Interest has definately not gone away (just didn't know how best to describe it, but ShySteamer has done a good job) and I am watching this Thread and your progress very closely and wish you all the best in what you are trying to achieve with RW.
Rob.
Proud to be a member of the VW/SSS BETA Testing Team.
Proud to be a member of the VW/SSS BETA Testing Team.