Caliban wrote:The WHL 37 isn't as complex as I wanted, but yes - the smoke is dependent on engine load, RPM and whether it's revving up - this matters somewhat, because there's more unburned fuel when the engine is accelerating and the fuel racks are somewhat in advance of the ideal position.
You can set colour and alpha in one call ( SetEmitterColour? ), rate in another although the way it work is horrible, and the initial velocity in another one I forgot the name of. There are a bunch of things I wish you could do, but those are enough to bring life to the exhaust at least. Most of the hassle is working out engine load and fuel burn - for a DH load should be easy given that torque converters aren't adjustable like alternators. There is an ideal amount of fuel for each specific RPM as a diesel takes a fixed amount of air at a given RPM ( assuming turbos have spooled up etc ), the more fuel injected above that the more likely it'll come out the exhaust partly burned ( and so the blacker the smoke ).
--original_Script is a string variable that we assign the file path between two quotation marks " "
original_Script = "Assets\RSC\Class52Pack01\RestOfPathToScript\APsEngineScript.out" --I'm afraid I don't know the name of the script or where it's located
require(original_Script);
-- store legacy functions before redefining them, although I think you'd only need to redefine Initialise and Update for particles
old_Initialise = Initialise;
old_Update = Update;
function Initialise
old_Initialise()
--turn on and off the various emitters as required, e.g:
EmitterOn("StationaryFumes");
EmitterOff("EngineExhaust");
EmitterOff("EngineClag");
--see below for explanations for EmitterOn and EmitterOff
end
function Update(time)
old_Update(time)
--code to control the particles, you could include some of the ideas from earlier in this thread
end
--extra function for turning on emitters without needing to retype the long call function
function EmitterOn(name)
Call(name..":SetEmitterActive", 1);
end
--same as the above, but for turning emitters off instead
function EmitterOff(name)
Call(name..":SetEmitterActive", 0);
end
Caliban wrote:You can set colour and alpha in one call ( SetEmitterColour? )
cjbarnes5294 wrote:Caliban wrote:You can set colour and alpha in one call ( SetEmitterColour? )
I use SetEmitterColour to change the RGB values i.e. Call("Name:SetEmitterColour", red, green, blue), but I didn't think you could change the alpha as well? I wonder if passing it 4 arguments, RGBA, instead of 3, RGB, would work? It would certainly be extremely useful if the alpha channel can be controlled.
Chris
Return to Train Simulator Mess Room
Users browsing this forum: No registered users and 0 guests