It's me again. I've noted that - at least on my system - there seems to be an alpha sorting issue with the particle emitters. Is this just my install or is this a known bug?
I'm guessing you're referring to the problem where the particles are stacked from youngest at the back to oldest at the front of the screen, no matter where the particle is in space? If so, then yep, it's a bug.
- Code: Select all
Call( "Emitter:SetEmitterActive", argument );
Where the argument is 1 for on, and 0 for off.
- Code: Select all
Call( "Emitter:SetEmitterRate", argument );
Where the argument is the desired emitter rate, being the inverse of particles released (per second?). Anyway, low number is lots of particles. I've seen this being used to turn particle emitters of, by setting a rate of 10000.0 - so practically none. What is the reasoning behind this? Wouldnt it be easier to just turn the emitter off completely?
If the emitter is named Main Smoke Stack then it is hard locked by the internal code to emit in time with the chuff sounds, and SetEmitterActive won't work on it, so the trick was to reduce the rate of emission to practically nil as you have already observed. I don't recommend doing that though, as after a short period of the rate being so low, as soon as the script changes it back to a high emission rate it likes to throw out a clump of particles all at once, and once that clump has decayed it will emit normally again. This clump not only looks unsightly but it has a performance impact as it probably contains all of the hundreds if not thousands of particles all piled on top of one another at once.
Models with scripted driving wheel animation and adhesion physics require the chuff sound timing to also be scripted if it is to stay in sync, so in those cases you might as well script the visible chuff of steam and smoke too, but if you just wanted a relatively simple loco set up to use the core adhesion and chuff sound audio blueprints, and thus want the particles to stay in sync with the chuff sounds set by the game core as is done with Main Smoke Stack, you can do that quite easily: simply make a dummy particle blueprint for Main Smoke Stack with a completely alpha'd out texture (or just any texture with the alpha set to 0 for all three colour settings), then use GetEmitterActive to probe when the Main Smoke Stack is emitting (when a chuff beat is occurring), and turn your custom exhaust particle on or off in time with it using SetEmitterActive. No need to touch SetEmitterRate now, because you can have full control over whether your custom-named exhaust emitter should be exhausting or not, and leave the Main Smoke Stack emitter to mind its own business happily chuffing away to itself, invisibly.
- Code: Select all
Call( "Emitter:SetInitialVelocityMultiplier", argument );
Where the argument is a multiplyer of the initial velocity vector as specified in the particle blueprint. I've used this to some effect to generate a exhaust blast effect.
- Code: Select all
Call( "Emitter:SetEmitterColour", r, g, b, a );
Sets the RGBA colour of the emitter. This applies as a sort of global multiplier on the initial, mid and final colour. Control over the individual colours is impossible afaik.
There is GetEmitterActive as already mentioned, and GetEmitterRate, but otherwise I think you've got them all. SetEmitterColour with just three arguments (RGB) is also valid if you don't want to modify the alpha.
I'd love control over the width and lifetime of the particles.
Sadly we're restricted to setting those aspects in the blueprint only, as far as I know. To get controlled changing width and lifetimes, you have to resort to making creative use out of multiple particles, but be careful not to add
too many particles. In my experience, you can add a fair few emitters to a single locomotive (I think the JT BR Standards I worked on have around 80-90 of them), but if you do that you have to be strict with the max number of particles defined in each blueprint otherwise it is likely to temp dump the game. 3000 for chimney exhausts that might want to last a bit longer, 800 for cylinder cock blasts and other fairly large secondary effects, 200-500 for leaks and small extras, these are some figures I would suggest trying if you fancy going mad with the number of individual particles.
Kind regards,
Chris