Fuel and sand quantity?

sniper297

Coconut God
Setting up loco refueling tracks, got to wondering if activating the sand was a waste of time. Looking over the locos I use, C-41, E8, GP9, RS11, only the C-41 tender appears to need refilling occasionally, the diesels seem to have infinite fuel because I click view details and there's no fuel quantity shown anywhere that I can find.

So questions, are there any diesels that actually use fuel? If so, which models, and does the remaining oil show up in view details during a session?

Do any locos at all use up sand, or could you run from Chicago to Omaha and back with the sanders running full blast for 436 years with any Trainz loco?
 
Some of the Russian diesels consume fuel, in fact voraciously so - after taking one for a run from Avery to Drexel there wasn't much left in the tank.

However it is annoying that so many of the built in locos don't consume fuel. Part of running a railroad is ensuring the traction units have sufficient fuel for the turn and/or making arrangements to take them to a depot to replenish supplies.
 
Hmm, I see more hacking in my future to make the first generation US diesels suck sand and oil, probably a script? Anyway for now I'll quit activating sand and diesel for my sessions, no sense fiddling with it if none of my locos use it. It's there on the route for whoever wants to make a session using modern newfangled ES99MACintoshDash80 contraptions :hehe: and dadblasted furriner dinkytoy bumpercars :p that actually consume the stuff.
 
Yes scripting is the way. I wrote one years ago for fuel consumption that's floating around somewhere. The webpage that hosted the script was discontinued by AT&T recently - last month actually so it's not up for public dl at the moment. Several people have used it and there are a number of threads in the forums here about getting it working. I don't know if there are any locos on the dls that use it. I think Paul Hobbs asked to use it in one of his payware diesels at one point. I'm pretty sure there's at least one he used it in.

It was basically a proof of concept that I did. It was made available to anyone for freeware work and I hoped others would use it as a starting point. Stopping out-of-fuel locos was not handled too eligantely but did work to some extent. I had hoped others would try to improve on it. Phil Cambel's payware locos use encripted scripts and no one knows exactly how he did it.

Bob Pearson
 
I understand how fuel consumption may be associated with the current throttle notch in a script: it wouldn't be too difficult to implement, but I think that consuming all the fuel would require hours of continuous running. It would be useful in "neverending" sessions, however.

Sand consumption would be much more interesting, but so far I have not been able to find a flag for sand use (I was looking for something like GetSandUse ;), with values of 0 = sanding inactive and 1 = sanding active). Does anybody know if such flag exist?
 
EDIT: disregard the following [The info I got from Auran is the key press name for sand is "train_sand" and it's bound by default to v and KPminus. I think it is passed to the cab script as simply user pressed key. I don't think the current state of sanding on or off is available to the script so you'd have to keep track of the state yourself. I have not tried to program this in a script so I don't know if it's accurate.]

I should check my own scripts before I reply to questions on the forum. I've used this in a script to log engine data for both steam and diesel locomotives:

Locomotive myloco;
float sanding;
sanding = myLoco.GetEngineSetting("sanding");

I think it works for TC3 and on.


With the script I wrote for fuel consumption, the consumption is based on gals/hr/hp per notch setting. I based the constant used in the calcs on an average of the data available for 4 stroke diesels published on Al Krug's site. So if you use the default data in the script you just supply the rated hp of the diesel engine and it gives you a real life consumption rate. There is another factor in the script you can supply that adds a time compression on the fuel rate so you don't have to run for 20 hrs or whatever before the next fill up is required.

Bob Pearson
 
Last edited:
The next step is to see what happens in Trainz if your loco actually does run out of fuel. Does it shut down as in real life or does it carry on running albeit with no fuel in the tank?
 
My VR T class loco's on the DLS use Bob's fuel script on them. Never really ran out of fuel with them though...

They are under the username 'S301' if anyone is interested.
 
The next step is to see what happens in Trainz if your loco actually does run out of fuel. Does it shut down as in real life or does it carry on running albeit with no fuel in the tank?
Well I can tell you, if left on its own the loco will keep running as if nothing happened. I try to shut it down in the script (edit - and do after a fashion) but I didn't find anything provided by the Trainz api that would actually shut it down like a dead engine. So you have to program something that tries to negate this behavior. That's why I mentioned Phil's scripts were encripted. He found a way to do it but no one can read his scripts to see how it was done and he hasn't volunteered any info.

The approach I took is pretty blunt force but kind of gets the job done in some cases. You can still get the loco to limp along if you're persistent fortuantely the AI seems to give up after several tries. A big drawback is it doesn't work right with multiple diesel locos in a train. Trainz doesn't allow you to single out 1 diesel - they all work off 1 "train" throttle and all deliver power. I was hoping someone would find a better way and let the rest of us in on it. In any case what I did is available in the script and anyone can read and use or modify it for freeware projects.

Bob Pearson
 
Last edited:
it is possible to zero a single locomotive's tractive effort in a consist and it wont be able to move. you could do this on fuel depletion and shut off the engine. i have plans for this setting in the future for my own projects.

i wrote fuel consumption into my 70MACs just for the cab computer display. nothing really happens when it runs out, but i figure it would take 12 hours to deplete and i dont know anyone who would run it for that long.
 
it is possible to zero a single locomotive's tractive effort in a consist and it wont be able to move. you could do this on fuel depletion and shut off the engine. i have plans for this setting in the future for my own projects. ...
What I ended up doing is just setting the throttle to 0 and resetting it if moved before the fuel tanks are refilled. Works for a single loco. With multi setups they all work off the same throttle so whole train looses power. With a loco alone or with a light consist you might still be able to get it to move slowly by repeatedly advancing the throttle after the script resets it as the loco will still generate power - I don't think you can stop that at least I didn't find a way to.

Bob Pearson
 
What I ended up doing is just setting the throttle to 0 and resetting it if moved before the fuel tanks are refilled. Works for a single loco. With multi setups they all work off the same throttle so whole train looses power. With a loco alone or with a light consist you might still be able to get it to move slowly by repeatedly advancing the throttle after the script resets it as the loco will still generate power - I don't think you can stop that at least I didn't find a way to.

Bob Pearson

putting the tractive effort to 0 will cause it not to generate power. it wont move at all no matter what the throttle is set to. no need to lock it.
 
but I didn't find anything provided by the Trainz api that would actually shut it down like a dead engine
For DCC mode or for controlled by AI loco it is impossible. For player in "cabin mode" it is possible. Only with two functions:

Vehicle.SetWheelslipTractionMultiplier(1.0)

to remove squeaking sound and

Vehicle.SetMaximumTractiveEffort(0)

to remove traction force. Or, if you like, it is possible to use

Vehicle.SetMaximumTractiveEffort(traictonForce(position, velocity, sand, gear, weather...))

where traictonForce is user-defined function.

PS this algorithm is known in our part of community since 2008, and it works in trs2006 - ts12.
 
Thanks Tram and NS. Guess it's time to update the script - I wrote it back in 2005.

Now if I can stop the engine sounds it will sound dead. 8-)

Bob Pearson
 
On, "Trainz 2006," there are 3 engines that's name begins with, "L SD70." You might try this on 1 of them. They require you to fill them with fuel and sand as well as turn them on. You can also turn them off if you want. The only downsides I'm thinking of are in, "Manage Content," you can't open up the script of any of the engines. And I don't think you can clone them either.

Justin
 
One would think after 6-7 years that Phil would spill the beans? if for nothing else but to improve the community..

not that its much to do with the current topic but non of his work runs on my install of ts12 at least the freeware/stuff on the Auran serve doesn't work.

yet lots of other does.. I have looked the images of the loco's and they look nice shame they don't work for me....
 
some jointedrail locos consume fuel and sand and i tested it by getting one and running it dry and the result? the engine slows to a stop and will not move until refuelled so if your tank runs dry you will have to get another loco to tow it to a refuelling depot
 
Back
Top