Dynamic diesel smoke

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

Re: Dynamic diesel smoke

Postby cjbarnes5294 » Fri Nov 07, 2014 6:24 pm

Trying to get the blasted thing to work for Matt, I noticed an awful lot of mistakes in my draft above, so apologies if you've been following and attempting to use the code. This is the current state of the code:

Code: Select all
--thanks to nschichan for documentation on the usage of require(), see: http://forums.uktrainsim.com/viewtopic.php?f=366&t=136148#p1687192

--original_Script is a string variable that we assign the file path between two quotation marks " "
original_Script = "Assets/RSC/Class52Pack01/RailVehicles/Class_52/AP/Scripts/c52-main.lua";
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

   Call("BeginUpdate");
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


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: Dynamic diesel smoke

Postby deltic009 » Fri Nov 07, 2014 6:51 pm

Thanks very much for all of your help thus far folks, I'm currently at work but shall hopefully give this a whirl and confirm it's working (no reason it shouldn't as Chris has tested it out) and then we're part way along the track, as it were.

I'm not striving for ultra realism, but would just like it to be some way better than what we currently have.

Cheers Chris again.
deltic009
Full Time Fireman
 
Posts: 62
Joined: Mon Apr 14, 2014 12:52 pm
Has thanked: 16 times
Been thanked: 34 times

Re: Dynamic diesel smoke

Postby deltic009 » Sun Nov 09, 2014 8:24 am

Well hello everybody, just wanted to share in the very latest update to the Class 52 pack - a few niggles with the exhaust to iron out but I'm very happy, and VERY grateful to Chris for his time in doing this. I have already gone a bit filthier on his textures than they were intially, now if only I can eradicate that blank bit of nothingness between full clag and running exhaust...

http://www.youtube.com/v/GKZuGo1Dp4o
deltic009
Full Time Fireman
 
Posts: 62
Joined: Mon Apr 14, 2014 12:52 pm
Has thanked: 16 times
Been thanked: 34 times

Re: Dynamic diesel smoke

Postby Nobkins » Sun Nov 09, 2014 10:20 am

Nice work. Enjoyed watching that.
TrainSimDev.com YouTube Channel
Video tutorials and other resources
User avatar
Nobkins
Site Admin
 
Posts: 547
Images: 3164
Joined: Wed Feb 05, 2014 12:24 am
Has thanked: 325 times
Been thanked: 185 times

Re: Dynamic diesel smoke

Postby JamesLit » Sun Nov 09, 2014 11:54 am

That's beautiful, well done, chaps.

As for the gap - sounds like one emitter is going off before the other one goes on? Perhaps have a look at the triggers for the different emitters to make sure they're as they should be? Just an idea. :)
The Forge Simulation | Like us on Facebook!
Owner & Director | Content built with care, not compromises.
User avatar
JamesLit
Driver
 
Posts: 388
Images: 26
Joined: Mon Apr 07, 2014 3:26 pm
Location: Kent
Has thanked: 435 times
Been thanked: 141 times

Re: Dynamic diesel smoke

Postby deltic009 » Sun Nov 09, 2014 12:37 pm

JamesLit wrote:That's beautiful, well done, chaps.

As for the gap - sounds like one emitter is going off before the other one goes on? Perhaps have a look at the triggers for the different emitters to make sure they're as they should be? Just an idea. :)

Having spoken to Chris since I posted this, it seems my crude attempt to limit particle production (as it killed my system) may have caused the breakage - I'm armed with anether method to reduce particles that hopefully doesn't break things.
deltic009
Full Time Fireman
 
Posts: 62
Joined: Mon Apr 14, 2014 12:52 pm
Has thanked: 16 times
Been thanked: 34 times

Previous

Return to Train Simulator Mess Room

Who is online

Users browsing this forum: No registered users and 0 guests