Flying snow

Discuss almost anything about RailWorks.

Flying snow

Unread postby styckx » Mon Oct 10, 2011 9:46 pm

I've always wanted this, and in theory know how it can be done but.. My LUA knowledge is a big fat.... ZERO

Particle emitter attached to the bottom of a loco as a child object to a `winter specific' train. Write lua script to control particle emitter based on speed.

Profit? Anyone with spare time want to guide me through some "lua for dummies" ?

http://www.youtube.com/watch?v=iKnwF1CdMHc
User avatar
styckx
 
Posts: 992
Joined: Wed Jun 30, 2010 5:27 pm

Re: Flying snow

Unread postby PapaXpress » Mon Oct 10, 2011 9:56 pm

well at least you aren't asking for this:
http://www.youtube.com/watch?v=1gF0cE12 ... re=related
Image
"Just post some random unrelated text. We have members here who can help you with that." ~ Chacal
"When all else fails, read the instructions... if that doesn't work either, try following them." ~ Old Prof
Image
The Grade Crossing - Atlanta North Project - Virtual Rail Creations
User avatar
PapaXpress
 
Posts: 5147
Joined: Sat Oct 23, 2010 10:30 pm
Location: that "other" timezone

Re: Flying snow

Unread postby ca2kjet » Mon Oct 10, 2011 10:37 pm

No way! That's right down the street from me. This would def be an awesome addition to TS2012!

Here's a shot taken down the same line. Would love to see that effect!

Image
User avatar
ca2kjet
 
Posts: 79
Joined: Sat Jun 25, 2011 5:12 pm

Re: Flying snow

Unread postby Kali » Tue Oct 11, 2011 1:11 am

I can do when I've got a spare minute, Bill. In theory all you need is this:

Code: Select all

SOME_MAX_SNOW_AMOUNT = 0.08 ( number pulled from thin air! )

function Update( p_interval )
... other stuff that's already in update

  lnSpeed = math.abs( Call("GetSpeed" ))
  lnSnowRate = 1 - ( SOME_CONSTANT_SNOW_RATE_MULTIPLIER * lnSpeed )
  if lnSnowRate < SOME_MAX_SNOW_AMOUNT then
    lnSnowRate = SOME_MAX_SNOW_AMOUNT
  end
  Call("SnowEmitter:SetEmitterRate", lnSnowRate )

.. and more stuff that's already in update
end


But emitters are quirky & usually need some tuning. That is the basic functionality though, have a look at some smoke code to see how to tune them better. One point: Emitter rates work backwards, the smaller the number the more the emitter puts out.
Kali
 
Posts: 1600
Joined: Mon Mar 14, 2011 1:00 am
Location: England-by-Sea

Re: Flying snow

Unread postby micaelcorleone » Tue Oct 11, 2011 8:31 am

You should have a look at the ZZASnowplow from Just Trains.
It has a similar effect: The faster it goes, the more particles it creates.
User avatar
micaelcorleone
 
Posts: 1668
Joined: Tue Oct 05, 2010 11:04 am
Location: Bavaria, Germany


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 4 guests

cron